This is a Database Management System (DBMS) project for managing a library.
It demonstrates relational database design, data normalization, CRUD operations, and stored procedures.
Tables:
-
Books
- book_id (PK)
- title
- author
- published_year
- genre
-
Members
- member_id (PK)
- name
- phone
- join_date
-
Borrowing
- borrow_id (PK)
- book_id (FK → Books)
- member_id (FK → Members)
- borrow_date
- return_date
01_create_tables.sql– Creates tables with constraints.02_insert_data.sql– Inserts sample data.03_CRUD_queries.sql– Demonstrates Create, Read, Update, Delete operations.04_stored_procedures.sql– Includes procedures to borrow and return books.
- Create a PostgreSQL database (e.g.,
library_db). - Run scripts in the following order:
psql -U <username> -d library_db -f SQL/01_create_tables.sql psql -U <username> -d library_db -f SQL/02_insert_data.sql psql -U <username> -d library_db -f SQL/03_CRUD_queries.sql psql -U <username> -d library_db -f SQL/04_stored_procedures.sql