Question: Consider the following ER diagram and its reduction. Create Table Books ( ISBN char(10) primary key, Title char(20), Subject char(20)); Create Table Member (SSN char(10),

 Consider the following ER diagram and its reduction. Create Table Books
( ISBN char(10) primary key, Title char(20), Subject char(20)); Create Table Member

Consider the following ER diagram and its reduction. Create Table Books ( ISBN char(10) primary key, Title char(20), Subject char(20)); Create Table Member (SSN char(10), ID integer, Primary key (SSN, ID), Foreign key (ID) references Library (ID), Foreign key (SSN) references Person (SSN)); Create Table Borrowed (SSN char(10), ID integer, ISBN char(10), Primary key (SSN, ID, ISBN), Foreign key (ID) references Library (ID), Foreign key (ISBN) references Books (ISBN), Foreign key (SSN) references Person (SSN)); Write SQL statements to answer the following queries. a) Find the name of the library that has the most number of books. ( 5 points) b) Find the number of times that each book with subject "Computer" has been borrowed. (5 points) c) Find the number of times that a person living in "NY" has borrowed books with subject "Medicine" from libraries in "NJ". (5 points) d) Find the name of the libraries that have more than 500 members. ( 5 points)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!