For this project you will create a database for a virtual library.
The books from the library can be “checked out” by Users for a fixed period of time. For this assignment let us assume that books cannot be renewed. A User may check out any number of books at a time. Since the books are eBooks, any number of Users can check out a book at the same time.
• The library contains a collection of eBooks. Basic information about each book needs to be stored
• Title, primary author, secondary authors (if any), date of first publication, number of pages, publisher, translator (if any)
• For non-fiction books, a list of the key topics covered by the book needs to be stored. For works of fiction (including poems, plays, novels, collection of stories), the topic is just ‘fiction’.
• For each book, we also need to store information about when it was checked out by which User.
• For each User we need to store certain information
• User id, name, phone, address, university affiliation (if any)
Design/create the database tables carefully first.
Insert at least 3 books, 5 users. The database must contain information about at least 5 check outs of books.
Write the queries below (Obviously, your database must be designed so that it can support these queries):
1. Which books have been checked out since such and such date.
2. Which users have checked out such and such book.
3. How many books does the library have on such and such topic.
4. Which users from New York University have checked out books on Machine Learning between this date and that date.
The virtual library has added a new social media feature. Users can now post and view comments about books they have checked out. Your database design must support this feature. For each book and User, we need to store the comments made about the book by the User
Each check out must contain at least 3 comments about the book by the User who has checked out the book.
Write the queries below (Again, your database must be designed so that it can support these queries)
1. What comments have been made by any User about such and such book between such and such dates, ordered from the most recent to the least recent.
2. Show for a given User, what comments they have made about such and such book.
What to Submit:
1. Your database design (similar to what we did in Lecture 1)
2. The code to create the database
3. The code to populate the database
4. The code for the queries
5. Take screenshots of the outputs of your queries
This is doable without any SQL tool but of course you can check your work better with one. You can use Access, SAS SQL, MySQL, etc.
This assignment has been answered 5 times in private sessions.
© 2022 Codify Tutor. All rights reserved