Question: Propmt In this project you will build a database for a public library. This database is aimed to collect and analyze information about the clients'
Propmt In this project you will build a database for a public library. This database is aimed to collect and analyze information about the clients' reading interests. The project concentrates only on books and the clients' interests in books. The analyses that will result from this project will be used by the library's management to decide on the future purchasing policy.
A Write the SQL statements in order to create the tables for the database. Use the Entity Relationship Diagram ERD of the database shown in Figure For simplicity, we are assuming in this project that a book cannot be written by more than one author. You need to create the tables as well as the required constraints, including the keys primary and foreign and the relationships between tables. B Populate your database with the sample set of data given to you in the tables below the assignment prompts.
C Write the following queries to retrieve the information detailed below.
Display all contents of the Clients table
First names, last names, ages and occupations of all clients
First and last names of clients that borrowed books in March
First and last names of the top authors clients borrowed in
Nationalities of the least authors that clients borrowed during the years
The book that was most borrowed during the years
Top borrowed genres for client born in years
Top occupations that borrowed the most in
Average number of borrowed books by job title
Create a VIEW and display the titles that were borrowed by at least of clients
The top month of borrows in
Average number of borrows by age
The oldest and the youngest clients of the library
First and last names of authors that wrote books in more than one genre
As you work on these queries, create indexes that will increase your queries' performance.
You must include comments in your code that address the purpose of your query and explains each step. PLEASE INCLUDE COMMENTS THAT EXPLAIN THE CODE FOR EACH STEP, AND PLEASE COMPLETE EACH STEP FROM AC
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
