Docsity

Data Base Management system, Study notes of Database Management Systems (DBMS)

Toggle sidebar
bg1
DATABASE
MANAGEMENT SYSTEMS
Compiled for exam revision | Based on Chapters: RDBMS Introduction & ER Modelling
EXAMINATION STUDY GUIDE
Complete Examination Notes
Covering RDBMS Fundamentals and Entity-Relationship Data
Modelling — reorganised, explained, and compressed from both
course presentations into one printable revision guide.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21

Partial preview of the text

Download Data Base Management system and more Study notes Database Management Systems (DBMS) in PDF only on Docsity!

DATABASE

MANAGEMENT SYSTEMS

Compiled for exam revision | Based on Chapters: RDBMS Introduction & ER Modelling

E X A M I N A T I O N S T U D Y G U I D E

Complete Examination Notes

Covering RDBMS Fundamentals and Entity-Relationship Data

Modelling — reorganised, explained, and compressed from both course presentations into one printable revision guide.

Table of Contents

Unit 1 — DBMS Fundamentals

1.1 Data, Database and DBMS — Basic Definitions

1.2 Tasks Performed by a DBMS

1.3 Characteristics of a DBMS

1.4 Advantages and Disadvantages of DBMS

1.5 File System vs DBMS Approach

1.6 Types of Databases

1.7 RDBMS and Its Terminology

1.8 DBMS vs RDBMS

Unit 2 — DBMS Architecture & Foundations

2.1 DBMS Architecture: 1-Tier, 2-Tier, 3-Tier

2.2 Three-Schema (ANSI/SPARC) Architecture

2.3 Data Independence (Logical & Physical)

2.4 Data Abstraction and Its Levels

2.5 Data Models

2.6 Database Languages (DDL, DML, DCL, TCL)

2.7 ACID Properties of Transactions

2.8 Database Users and the DBA

Unit 3 — The Entity-Relationship (ER) Model

3.1 What Is an ER Diagram?

3.2 Entities and Their Types

3.3 Attributes and Their Types

3.4 Relationships and Mapping Cardinalities

3.5 ER Diagram Notation Reference (Crow's Foot)

3.6 Generalization, Specialization and Aggregation

Unit 4 — Keys, Constraints & Relational Terminology

4.1 Relations, Tuples, Schema and Instance

4.2 Keys in a Database

4.3 Integrity Constraints

4.4 NULL Values and Properties of Relations

Unit 5 — Converting ER Diagrams into Relational Tables

5.1 The Eight Conversion Rules

5.2 Worked Example — Library Management System

Unit 6 — SQL Constraints

6.1 Overview of SQL Constraints

6.2 NOT NULL, UNIQUE, PRIMARY KEY, FOREIGN KEY — Syntax

6.3 Dropping Databases and Tables

Unit 7 — Relational Algebra

DBMS Fundamentals

1.1 Data, Database and DBMS — Basic Definitions

Every database course starts with three words that are easy to mix up: data, database, and DBMS. Getting the distinction clear now

avoids confusion later.

DATA

Data is a collection of distinct, small units of information. A single piece of data is one fact about something — a name, a

number, a date. Data can exist as text, numbers, images, or bytes, and can be stored on paper or electronically.

DATABASE

A database is a highly organised, inter-related collection of data. It lets you retrieve, insert, and delete information efficiently,

and it organises data using structures such as tables, schemas, views, and reports.

EXAMPLE

A college database organises information about admin staff, teaching staff, and students. Instead of keeping separate paper files

for each department, all this related data lives together and can be searched, updated, or deleted through the database.

DATABASE MANAGEMENT SYSTEM (DBMS)

A DBMS is the sophisticated software that controls a database and its environment. It provides an interface for creating

databases, storing data, updating data, and building tables, while also handling protection, security, and consistency when

multiple users access the data at once. Popular DBMS products include MySQL, Oracle, SQL Server, and PostgreSQL.

EXAM POINT

Data is the raw fact. A database is the organised collection of that data. A DBMS is the software that manages the database. Many

students lose marks by treating "database" and "DBMS" as the same thing — they are not.

1.2 Tasks Performed by a DBMS

A DBMS allows users to carry out four broad categories of tasks:

Task What It Covers Data Definition Creating, modifying, and removing the definitions that describe how data is organised in the database. Data Updation Inserting, modifying, and deleting the actual data stored in the database. Data Retrieval Fetching data from the database so it can be used by applications for various purposes. User Administration Registering and monitoring users, maintaining data integrity, enforcing security, handling concurrency control, monitoring performance, and recovering data after unexpected failures.

1.3 Characteristics of a DBMS

Uses a digital repository on a server to store and manage information.

Gives a clear, logical view of the processes that manipulate data.

Contains automatic backup and recovery procedures.

Follows ACID properties, which keep data in a healthy, reliable state even if something fails (see Unit 2.7).

Reduces complex relationships between data.

Supports manipulation and processing of data.

Provides security of data.

Can present the same database from different viewpoints depending on what the user needs.

U N I T 1

  • • • • • • • •

1.4 Advantages and Disadvantages of DBMS

Advantages Disadvantages Controls redundancy — all data sits in one database file instead of scattered copies.

Cost of hardware/software — needs a fast processor and large memory to run efficiently.

Data sharing — authorised users across an organisation can share the same data.

Size — occupies large disk space and memory.

Easy maintenance — centralised nature makes upkeep simpler. Complexity — adds design and operational complexity. Reduces development time and ongoing maintenance effort. Higher impact of failure — since most data sits in one place, damage or corruption can cause major loss. Backup & recovery subsystems restore data automatically after hardware/software failure.

Multiple user interfaces — GUIs, application program interfaces, etc.

1.5 File System vs DBMS Approach

Before DBMS software existed, organisations used the file system approach : a decentralised setup where each department stored

and controlled its own data with the help of a data-processing specialist, who created file structures and wrote programs to generate

reports. The database approach replaced this with a well-organised collection of meaningfully related data, stored only once but

accessible to different users, supporting operations such as insertion, deletion, selection, and sorting.

Comparison: File System vs DBMS

Feature File System DBMS Data Storage Stored in files within directories. Stored in databases, typically organised into tables. Data Access Manual, using OS-level file handling. Managed using query languages like SQL. Relationships No inherent support between files. Supported using keys and constraints. Data Integrity Must be managed manually. Enforced through built-in constraints (e.g. primary keys). Redundancy High risk of redundancy and inconsistency. Reduced through normalisation and constraints.

Security Limited, relies on OS-level permissions. Advanced: user roles, access control, encryption. Transactions No transaction management. Supports ACID-based transaction management. Backup/Recovery Manual, error-prone. Automated. Concurrency Little or no support. Supported, with conflict-prevention mechanisms. Scalability Suitable for small, simple needs. Scales to large, complex data sets. Examples Text files, spreadsheets. MySQL, Oracle, PostgreSQL, SQL Server.

1.6 Types of Databases

Databases can be classified in several ways depending on how data is stored, distributed, or accessed:

Centralized Database

Stores data at one central system. Users access it from different

locations through applications that authenticate them before

granting access.

EXAMPLE

A central library system holding the combined database of

every library branch in a university.

Distributed Database

Data is spread across different database systems within an

organisation, connected via communication links that let end

users access it easily.

EXAMPLE

Apache Cassandra, HBase, Ignite.

1.8 DBMS vs RDBMS

Feature DBMS RDBMS Data Structure Stored in a file system — hierarchical, network, or other non-relational forms.

Stored in tables (relations) of rows and columns.

Relationships Not inherently supported; handled manually by the application.

Supported using primary and foreign keys.

Data Integrity Managed at the application level, with fewer built-in constraints.

Enforced using primary key, foreign key, and unique constraints. Normalization Not a primary focus — redundancy and inconsistency are common.

Supported, to eliminate redundancy and keep data consistent. Query Language Typically no SQL, or only limited support. Uses SQL for manipulation and querying.

Transactions May not fully support ACID properties. Fully supports ACID properties. Scalability Suited to smaller, less complex data sets. Designed for larger, more complex data and relationships. Examples File systems, XML databases. MySQL, PostgreSQL, Oracle, SQL Server.

Quick Revision — Unit 1 Data → raw facts. Database → organised collection. DBMS → software that manages it. Four DBMS tasks: Definition, Updation, Retrieval, User Administration. 8 database types: Centralized, Distributed, Relational, NoSQL (4 sub-types), Cloud, Network, Hierarchical, Object-oriented. RDBMS terms: Table, Row/Tuple, Column/Attribute, Degree (columns), Cardinality (rows), Domain, Primary Key. RDBMS = DBMS + relational model (tables, keys, SQL, ACID, normalization).

DBMS Architecture & Foundations

2.1 DBMS Architecture: 1-Tier, 2-Tier, 3-Tier

DBMS design depends on its architecture. The basic client/server architecture handles large numbers of PCs, web servers, database

servers and other networked components.

DBMS Architecture

↓

1-Tier 2-Tier 3-Tier

Tier Description 1-Tier The database is directly available to the user — the user sits on the DBMS and uses it directly, and any change is applied straight to the database. It doesn't offer a handy tool for end users, and is mainly used for developing local applications where programmers need a quick response. 2-Tier Same idea as basic client-server. Client-side applications communicate directly with the database server, typically through APIs such as ODBC or JDBC. The client handles user interfaces and application programs; the server handles query processing and transaction management. 3-Tier Adds another layer between client and server. The client cannot talk to the database directly — it interacts with an application server, which then talks to the database. The end user has no idea the database even exists beyond the application server. Used for large web applications.

2.2 Three-Schema (ANSI/SPARC) Architecture

Also called the three-level architecture , this framework describes the structure of a specific database system and separates user

applications from the physical database. The main objective is to let multiple users access the same underlying data with a

personalised view, while the data itself is stored only once. This separation matters because:

Different users need different views of the same data.

A user's view requirements may change over time.

Users shouldn't need to worry about physical implementation details — compression, encryption, hashing, internal optimisation.

All users should access the same data according to their own needs.

The DBA should be able to change the conceptual structure without disturbing users.

The internal structure should stay unaffected by changes to physical storage.

External Level External Level

↓ ↓ (External / Conceptual Mapping) Conceptual Level

↓ (Conceptual / Internal Mapping) Internal Level

↓

Database

U N I T 2

  • • • • • •

2.4 Data Abstraction and Its Levels

DATA ABSTRACTION

The process of hiding unwanted and irrelevant details from the end user, so they see only the data they need without knowing

what is stored or how it is stored. This keeps data safe and simplifies access while maintaining security and efficiency.

EVERYDAY ANALOGY

While buying clothes, you see only colour, size and brand — not the manufacturing details behind them. A database user

similarly sees only relevant data, not internal storage mechanics.

Data abstraction happens across the same three levels described in the three-schema architecture:

Level Role Physical / Internal Lowest level — defines how data is actually stored (structures, access methods). Most complex; hidden from the user. Logical / Conceptual Intermediate level — defines what data is stored and the relationships between it. Less complex; used by programmers. View / External Highest level — different views of the same database, each simplified for a specific type of user. Easiest to understand.

2.5 Data Models

DATA MODEL

Models the description of data, its semantics, and consistency constraints, providing the conceptual tools to describe a

database's design at each level of abstraction.

Model Description Examples / Applications Relational The most widely used model. Organises data into tables (relations) of rows and columns; relationships established through keys.

MySQL, PostgreSQL, Oracle, SQL Server — business, e-commerce, finance.

Entity-Relationship (ER) A conceptual model representing data as entities and the relationships between them, mainly used during database design.

Design tools that generate ER diagrams later converted to relational models. Object-Oriented Integrates object-oriented programming concepts — data represented as objects, similar to Java or C++.

ObjectDB, db4o — CAD/CAM, multimedia, simulation. Document / Semistructured

Data stored in documents (JSON, BSON, XML) with key-value pairs, arrays, and nested documents.

MongoDB, CouchDB — content management, blogging, real-time analytics.

2.6 Database Languages

Database Languages

↓

DDL DML DCL TCL

Category Full Form Commands DDL Data Definition Language CREATE, ALTER, DROP, TRUNCATE, COMMENT, RENAME

DML Data Manipulation Language INSERT, UPDATE, DELETE, MERGE, CALL, EXPLAIN PLAN, SELECT (DQL) DCL Data Control Language GRANT, REVOKE TCL Transaction Control Language COMMIT, ROLLBACK, SAVEPOINT, AUTOCOMMIT

EXAM POINT

SELECT is sometimes classified separately as DQL (Data Query Language), but it is grouped under DML in most syllabi since it

"manipulates" the view of data even though it doesn't change it.

2.7 ACID Properties of Transactions

The ACID properties are a set of principles ensuring reliable processing of database transactions, maintaining integrity, consistency,

and reliability of data.

1. Atomicity — "All or nothing"

A transaction is treated as one indivisible unit: either every operation in it completes, or none of them are applied.

EXAMPLE

Transferring money between two bank accounts involves a debit and a credit. If either operation fails, atomicity rolls back the

entire transaction so neither account is updated.

2. Consistency

A transaction takes the database from one valid state to another valid state, honouring all predefined rules (constraints, triggers,

etc.).

EXAMPLE

If a banking rule states that the total balance across all accounts must equal a fixed value, consistency ensures a transfer

transaction never breaks that rule.

3. Isolation

Multiple transactions running concurrently do not interfere with each other; each executes as if it were the only transaction in the

system.

EXAMPLE

Two people transferring money simultaneously are processed independently, preventing dirty reads, non-repeatable reads, and

phantom reads.

4. Durability

Once a transaction is committed, its changes are permanently recorded, even if the system crashes immediately afterward.

EXAMPLE

After a confirmed bank transfer, the balance update is written to persistent storage and survives a crash.

Summary of ACID Properties

Property Key Concept Ensures Atomicity All or nothing Complete execution of all parts of a transaction, or none at all Consistency Valid state → valid state Database integrity is maintained throughout Isolation Independent execution Transactions don't interfere with each other Durability Permanent changes Committed transactions are saved permanently

The Entity-Relationship (ER) Model

3.1 What Is an ER Diagram?

ER DIAGRAM

A graphical representation of the entities, relationships, and attributes that define the structure of a database. It defines entities,

their associated attributes, and the relationships between entities, helping visualise the logical structure of a database before it

is built.

ER Model

↓

Entity Attribute Relationship Strong / Weak Key / Composite / Multivalued / Derived 1:1 / 1:M / M:M

3.2 Entities and Their Types

ENTITY

A real-world object, concept, or thing with a distinct existence in the database. Represented as a rectangle in an ER diagram.

EXAMPLE

In a university database: Student, Course, Professor are all entities.

WEAK ENTITY

An entity that depends on another entity for its existence (it has no complete key of its own) — e.g. a DEPENDENT entity that

only makes sense in relation to an EMPLOYEE.

3.3 Attributes and Their Types

ATTRIBUTE

A characteristic or property of an entity that gives more information about it. Represented as an oval connected to its entity.

Street City State Country ↓

Address (composite attribute)

Phone_no. (multivalued — double oval)

Type Definition Example Simple Cannot be divided further. Name Composite Can be divided into sub-parts. Full_Name → First_Name + Last_Name Derived Value can be derived from other attributes; usually not stored (shown with a dashed oval).

Age derived from Date_of_Birth

Multivalued Can hold multiple values (shown with a double oval). Phone_Numbers for a Person Key Attribute Uniquely identifies an entity (shown underlined). Student_ID

U N I T 3

3.4 Relationships and Mapping Cardinalities

RELATIONSHIP

Describes how two or more entities are associated with each other. Represented as a diamond connected to the entities involved.

Employee — is assigned — Project

Mapping constraints (cardinality) define how many instances of one entity can relate to instances of another. This is one of the most

frequently tested topics.

Type Definition Example One-to-One (1:1) A single instance of one entity relates to a single instance of another.

Each Employee has one Parking_Space, and vice versa.

One-to-Many (1:M) A single instance of one entity relates to many instances of another, but not vice versa.

A Department has many Employees; each Employee belongs to one Department. Many-to-Many (M:N)

Many instances of one entity relate to many instances of another.

Students enrol in many Courses; each Course has many Students.

3.5 ER Diagram Notation Reference (Crow's Foot)

Beyond the simple 1/M labels, formal ER notation (Crow's Foot) also expresses optionality — whether the minimum participation is

zero or one. This table is a complete reference:

Concept Notation Meaning Example One-to-One 1 : 1 One entity relates to exactly one entity Person ↔ Passport One-to-Many 1 : M One entity relates to many entities Department → Employee Many-to-Many M : N Many entities relate to many entities Student ↔ Course Exactly One 1..1 Minimum 1, maximum 1 (mandatory) Employee → ID Card One or More 1..N Minimum 1, maximum many (mandatory) Order → Order Item

Zero or One 0..1 Minimum 0, maximum 1 (optional) Employee → Parking Space Zero or Many 0..N Minimum 0, maximum many (optional) Customer → Order

EXAM POINT

"Mandatory" means the minimum cardinality is 1 (every instance MUST participate); "Optional" means the minimum is 0

(participation is allowed but not required).

3.6 Generalization, Specialization and Aggregation

These three concepts refine and organise an ER model so it can represent complex, real-world scenarios more accurately.

1. Generalization — "Bottom-up approach"

GENERALIZATION

The process of extracting shared characteristics from two or more entities and creating a generalized, higher-level entity. It

abstracts common attributes and relationships from multiple entities into one broader superclass, reducing redundancy.

Represented by a triangle pointing from the subclass entities up to the generalized superclass.

EXAMPLE

Car, Bike, and Truck share attributes like Registration_Number, Color, and Engine_Type. These can be generalized into a higher-

level entity, Vehicle.

Keys, Constraints & Relational Terminology

4.1 Relations, Tuples, Schema and Instance

Consider a STUDENT relation used throughout this section:

ROLL_NO NAME ADDRESS PHONE AGE 1 RAM DELHI 9455123451 18 2 SHYAM NOIDA 9455123452 19

3 MOHIT GURGAON 9455123453 20 4 SOHAN NOIDA 18

Term Meaning Attribute A property that defines an entity, e.g. ROLL_NO, NAME, ADDRESS. Relation Schema Defines the structure of the relation — the relation's name with its attributes, e.g. STUDENT (ROLL_NO, NAME, ADDRESS, PHONE, AGE). If a schema has more than one relation, it is a Relational Schema. Tuple Each row in the relation. The STUDENT relation above has 4 tuples. Relation Instance The set of tuples in a relation at a particular moment in time. It can change with every insertion, deletion, or update. Degree The number of attributes in the relation. STUDENT has degree 5. Cardinality The number of tuples in a relation. STUDENT has cardinality 4.

Column The set of values for one particular attribute, e.g. the ROLL_NO column is {1, 2, 3, 4}. NULL Value A value that is unknown or unavailable, shown as blank space — e.g. PHONE for ROLL_NO 4 is NULL.

SCHEMA VS INSTANCE

Schema is the overall design or blueprint of the database — tables, fields, data types, relationships, constraints. Instance is the

actual data stored at a particular moment — a snapshot of the database's content.

Schema vs Instance

Aspect Schema Instance Definition Blueprint or design of the database. The actual data stored in the database. Nature Static, does not change frequently. Dynamic, changes as data is manipulated.

Purpose Describes the structure of the database. Represents a snapshot of content at a specific time. Example Tables, columns, data types, relationships. Rows of data in the tables at a given moment.

4.2 Keys in a Database

KEY

A data item (a column or set of columns) used to uniquely identify a record in a table, and to fetch a single record or set of

records efficiently.

U N I T 4

Key Definition Example Candidate Key An attribute or set of attributes that can uniquely identify a record. A table can have multiple candidate keys.

Customer_ID alone, or Customer_ID + Store_ID + Location_ID together, in a transaction table. Primary Key The candidate key chosen to identify each record; must never repeat and can never be NULL.

Student_ID in a Students table.

Alternate Key A candidate key that was not chosen as the primary key. Store Name, if Store_ID is already the primary key. Unique Key Uniquely identifies a record, similar to a primary key, but it can contain one NULL value.

Email address column in a Users table.

Foreign Key A column (or set of columns) in a child table that refers to the primary key of a parent table, enforcing a link between the two tables.

DepartmentID in a Students table, referencing DepartmentID in a Departments table.

COMMON CONFUSION

Primary Key vs Unique Key — both enforce uniqueness, but a primary key can never be NULL and a table can have only one,

while a unique key can allow one NULL value and a table can have several unique keys.

4.3 Integrity Constraints

INTEGRITY CONSTRAINTS

Pre-defined rules applied to table columns (or relations) to preserve the overall validity, integrity, and consistency of the data.

Every insert, update, delete, or alter operation is checked against these rules; the operation succeeds only if the constraint

evaluates to true. This prevents accidental damage to the database.

Integrity Constraint

↓

Domain Entity Integrity Referential Integrity Key Constraint

1. Domain Constraint

Restricts the kind of values a column can hold, based on its declared data type — string, integer, character, DateTime, currency, etc.

EXAMPLE

In a Students table with an integer Class column, entering "A" instead of a number violates the domain constraint.

2. Entity Integrity Constraint

Ensures the primary key of a table can never be NULL, since a NULL primary key would make that record impossible to identify.

NULLs are allowed anywhere else in the table.

EXAMPLE

An Employees table where the ID column (primary key) has a blank value in one row violates entity integrity.

3. Referential Integrity Constraint

FOREIGN KEY / REFERENTIAL INTEGRITY

A FOREIGN KEY creates a relationship between a parent table (holding the original data) and a child table (referencing it),

ensuring that a value used as a foreign key in the child table must already exist as a primary key value in the parent table.

EXAMPLE

An Employees table has Dept_ID as a foreign key referencing the Departments table's primary key. If an employee row has

Dept_ID = 4, but no department with ID 4 exists in the Departments table, the referential integrity constraint is violated.

Converting ER Diagrams into Relational Tables

5.1 The Eight Conversion Rules

Once an ER diagram is finalised, it must be converted into actual relational tables. These eight rules cover every conversion case you

will be asked about.

Rule 1 — Strong Entity → Table

For every strong entity, create one table: entity name becomes table name, simple attributes become columns, and the key attribute

becomes the primary key.

AUTHOR(Author_ID, Author_Name)

Rule 2 — Composite Attribute → Separate Components

Store the simple components of a composite attribute, not the composite attribute itself.

Address → Street, City, State, PIN MEMBER(Member_ID, Member_Name, Street, City, State, PIN)

Rule 3 — Multivalued Attribute → Separate Table

Create a separate table for a multivalued attribute, since a single column cannot hold multiple values.

MEMBER(Member_ID, Member_Name) MEMBER_PHONE(Member_ID, Phone) Primary key: (Member_ID, Phone)

Rule 4 — Derived Attribute → Usually Not Stored

A derived attribute is normally excluded from the table since it can be calculated from other attributes.

Age can be calculated from Date_of_Birth, so: PERSON(Person_ID, Name, Date_of_Birth) — not storing Age separately

Rule 5 — 1:1 Relationship

Place the primary key of one entity as a foreign key in the other table — preferably in the table with total participation.

PERSON(Person_ID, Name) PASSPORT(Passport_ID, Issue_Date, Person_ID) — Person_ID is FK

Rule 6 — 1:N Relationship

Place the primary key of the "1" side as a foreign key in the table on the "N" side. This is one of the most important and most tested

rules.

MEMBER (1) —— (N) ISSUE_RETURN

MEMBER(Member_ID, Member_Name, ...) ISSUE_RETURN(Issue_ID, Issue_Date, Member_ID) — Member_ID is FK

Rule 7 — M:N Relationship

Create a brand-new table containing the primary keys of both participating entities as foreign keys; their combination usually

becomes the composite primary key.

AUTHOR (M) —— (N) BOOK

AUTHOR(Author_ID, Author_Name) BOOK(Book_ID, Title, ISBN, ...) WRITES(Author_ID, Book_ID) Primary Key: (Author_ID, Book_ID)

U N I T 5

Rule 8 — Weak Entity

Create a separate table containing the weak entity's own attributes, the owner entity's primary key as a foreign key, and the weak

entity's partial key. The combination generally forms the primary key.

EMPLOYEE(Emp_ID, Name) DEPENDENT(Emp_ID, Dependent_Name, Age) Primary Key: (Emp_ID, Dependent_Name)

EXAM POINT

General reduction rules to remember for any ER diagram: every entity type becomes a table; every single-valued attribute

becomes a column; a key attribute becomes the primary key; a multivalued attribute becomes its own table with a composite

key; a composite attribute is replaced by its individual components; and derived attributes are not stored.

5.2 Worked Example — Library Management System

Task: draw an ER diagram for a Library Management System with these entities — Book, Author, Member, Librarian, Issue/Return.

Step 1: Entities and Attributes

BOOK

Book_ID — Primary Key

Title

ISBN

Publisher

Edition

AUTHOR

Author_ID — Primary Key

Author_Name

MEMBER

Member_ID — Primary Key

Member_Name, Phone, Email, Address

LIBRARIAN

Librarian_ID — Primary Key

Librarian_Name, Phone

ISSUE_RETURN

Issue_ID — Primary Key

Issue_Date, Due_Date, Return_Date, Fine

Step 2: Relationships and Cardinalities

Relationship Cardinality Explanation Author — Writes — Book M:N One author can write many books; one book can have multiple authors. Member — Issues — Book M:N A member can issue many books; a book can be issued many times over its lifetime. Librarian — Manages — Issue_Return

1:N One librarian can process many transactions.

Book — Has — Issue_Return 1:N One book can have many issue/return transactions over time. Member — Makes — Issue_Return

1:N One member can have many issue/return transactions.

ER Diagram — Library Management System

AUTHOR — M WRITES N — BOOK ↓ 1 HAS ↓ N

MEMBER — 1 MAKES N — ISSUE_RETURN — N PROCESSED BY 1 — LIBRARIAN

Step 3: Final Reduced Tables

AUTHOR(Author_ID, Author_Name) BOOK(Book_ID, Title, ISBN, Publisher, Edition) MEMBER(Member_ID, Member_Name, Phone, Email, Address) LIBRARIAN(Librarian_ID, Librarian_Name, Phone)

  • • • • • • •
    • • • • • •