Data assignment 4 (1)
Data assignment 4 (1)
Tables
SQL Script
Below is the SQL script implementing the schema, operations, and comments for clarity.
1
2
Explanation of the SQL Script
Schema Design:
● Books Table: Stores details about books, ensuring Quantity cannot be negative.
● Members Table: Holds member information with unique emails.
● Loans Table: Tracks loans and enforces referential integrity via foreign keys.
Sample Operations:
References
Silberschatz, A., Korth, H. F., & Sudarshan, S. (2019). Database System Concepts. McGraw-Hill
Education.