Library Management System
Library Management System
First Normal Form (1NF): Ensure each attribute contains only atomic values (e.g.,
no lists or arrays within a single cell).
Second Normal Form (2NF): Eliminate partial dependencies. All non-key attributes
should be fully dependent on the primary key.
Third Normal Form (3NF): Remove transitive dependencies. No non-key attribute
should be dependent on another non-key attribute.
Data Types:
Table Creation
1. Books
CREATE TABLE Books (
BookID INTEGER PRIMARY KEY,
Title VARCHAR(100),
Author VARCHAR(100),
PublicationDate DATE,
Genre VARCHAR(50)
);
2. Members
3. Loans
CREATE TABLE Loans (
LoanID INTEGER PRIMARY KEY,
BookID INTEGER,
MemberID INTEGER,
LoanDate DATE,
DueDate DATE,
ReturnDate DATE,
FOREIGN KEY (BookID) REFERENCES Books(BookID),
FOREIGN KEY (MemberID) REFERENCES Members(MemberID)
);
SQL Queries
List all books by a specific author:
Additional Considerations:
Indexes: Create indexes on frequently searched columns (e.g., BookID in the Loans
table) to improve query performance.
Data Integrity: Implement constraints (e.g., NOT NULL, UNIQUE) to ensure data
consistency.
Security: Consider security measures like user authentication and access control.
Scalability: Design the database to accommodate future growth and changes in
requirements.
This is a basic foundation for a library database. You can extend it further by
adding tables for genres, publishers, and more.