Answered step by step
Verified Expert Solution
Link Copied!

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)
copies(copv_id, branch_id, barkaid, cost)
loans(loan id sapx_id 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 10 copies.
(c) Find the names of borrowers who have been members since 2005 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 book-branch combination, find the number of copies of the book available at the branch. Give the branch name, book title, and count in the results.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Solaris 11.2 System Administration (oracle Press)

Authors: Harry Foxwell

1st Edition

007184421X, 9780071844215

More Books

Students also viewed these Databases questions

Question

6. Discuss the steps involved in conducting a task analysis.

Answered: 1 week ago