Question: Part-I Write the following queries in SQL, using the relational database below: book( book-id , title, publisher-name) book-authors( book-id , author-name) publisher publisher-name, address, phone)

 Part-I Write the following queries in SQL, using the relational database

Part-I Write the following queries in SQL, using the relational database below: book( book-id , title, publisher-name) book-authors( book-id , author-name) publisher publisher-name, address, phone) book-copies book-id , branch-id , no-of-copies) book-loans book-id , branch-id , card-no , date-out , return-date) library-branch branch-id , branch-name, address) borrower card-no , name, address, phone) i. What is the maximum number of branches that a reader has borrowed at least two different book titles from each branch? (20p) ii. Which book title with at least two authors have the maximum number of copies overall in all branches? (20 p) iii. Which readers have borrowed at least a title from all except one of the whole branches of the library? (20p) iv. Which branches of the library has at least one copy for two Dan Brown written book titles currently available for loan? (20p) Part-II Assume you have three entity sets and only one relationship set between them. Illustrate and discuss all scenarios (different mapping cardinalities and participations) that will affect the relations to be obtained from the E-R diagram drawn. (20 p) Part-I Write the following queries in SQL, using the relational database below: book( book-id , title, publisher-name) book-authors( book-id , author-name) publisher publisher-name, address, phone) book-copies book-id , branch-id , no-of-copies) book-loans book-id , branch-id , card-no , date-out , return-date) library-branch branch-id , branch-name, address) borrower card-no , name, address, phone) i. What is the maximum number of branches that a reader has borrowed at least two different book titles from each branch? (20p) ii. Which book title with at least two authors have the maximum number of copies overall in all branches? (20 p) iii. Which readers have borrowed at least a title from all except one of the whole branches of the library? (20p) iv. Which branches of the library has at least one copy for two Dan Brown written book titles currently available for loan? (20p) Part-II Assume you have three entity sets and only one relationship set between them. Illustrate and discuss all scenarios (different mapping cardinalities and participations) that will affect the relations to be obtained from the E-R diagram drawn. (20 p)

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!