Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Answer all parts Consider the following relational schema: Primary keys are highlighted and underlined authors ( author.id , lastename, first name ) books ( kook.id
Answer all parts
Consider the following relational schema:
Primary keys are highlighted and underlined
authors
author.id lastename, first name
books
kook.id title, num.pages, authoraid
branches
branch.id branch name address, phone ne
copiescopvid branchid barkaid, cost
loansloan id sapxid boxrower id due date
borrowers
borrower.id name, member since
Write SQL queries to answer the following:
a Using SQL Statement create a relational schema for the above entities. Remember to consider foreign keys when creating tables.
b Find the titles of books that have fewer than copies.
c Find the names of borrowers who have been members since and have read all the books.
d Find the average number of pages in the books for each branch and order the result by increasing average page count.
e For each bookbranch combination, find the number of copies of the book available at the branch. Give the branch name, book title, and count in the results.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started