Department of Computer Science
CS262 Database Concepts
Lab 8 – Implementation Using MySQL/Oracle 2
Aim
______________________________________________________________________________
The aim of this lab is to familiarise you with the MySQL/Oracle Database Management System,
enabling you to define relations and constraints and populate a database.
Your Tasks
______________________________________________________________________________
You overall task will be to design an end-to-end Library Management System which performs the
following tasks:
A. Updates new books into the database.
B. Searches any given room based on author name or title.
C. Maintains an entry into the database for every book issued with the return date.
D. On any given date lists all the books along with their issuers, which must be returned.
E. List any overdue books and fines.
The logical model is as follows (data types/domains not specified):
Borrower (borrower_id, first_name, last_name, email, phone, address)
Author (author_id, first_name, last_name, email, phone, address)
Book (book_id, title, edition, year, price, isbn, pages, aisle, description)
Copy (book_id, copy_id, status)
Author_list (author_id, book_id, role)
Loan (borrower_id, book_id, copy_id, loan_date, return_date)
a) Determine and rewrite the above schema with the correct domain/ data type for each attribute.
b) Using SQL create the above relations in MySQL/Oracle. Include the following constraints.
Note the queries you used to specify the constraints.
i. Loan date must not be greater than return date.
ii. Price in Book must be between P100 and P1000.
iii. Copy Status can only be ‘available’, ‘borrowed’ or ‘reserved’.
iv. Loan date must not be greater than today’s date.
c) Enter data into the relations to check the above constraints.