Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This project will utilize SQL to create user views for the provided set of queries. EXAMPLES: 1. List all libraries with the library name, address,

This project will utilize SQL to create user views for the provided set of queries.

EXAMPLES:

1. List all libraries with the library name, address, and telephone number.

CREATE VIEW LibraryNames (Number, Name, Address, Phone) AS

SELECT Library#, LibraryName, Address, Phone

FROM LIBRARY

2. Retrieve the name, city, and grade point average of students with a high GPA) greater than or equal to 3.7) SELECT stu_lname, stu-fname, stu_GPA FROM student

WHERE stu_GPA >= 3.7 ORDER BY stu_lname, stu_fname;

3. List the name and hiring date of faculty hired in 1994 or 1995 SELECT fac_lname, fac_fname, fac_hire_date FROM faculty

WHERE fac_hire_date BETWEEN 1-JAN-1994 AND 31-DEC-1995

ORDER BY fac_lname, fac_fname;

COUNTY LIBRARY SYSTEM

Use the following relations for the SQL queries for this project.

LIBRARY (LIBRARY_ID, LIBRARY_NAME, STREET_ADDRESS, CITY, STATE, ZIPCODE, PHONE, MANAGER_NAME)

BRANCH (BRANCH_ID, BRANCH_NAME, STREET_ADDRESS, CITY, STATE, ZIPCODE, PHONE, BRANCH_MANAGER, LIBRARY_ID)

FK LIBRARY_ID -> LIBRARY

PUBLISHER (PUBLISHER_ID, PUBLISHER_NAME, STREET_ADDRESS, CITY, STATE, ZIPCODE, PHONE)

BOOK (BOOK_ID, BOOK_TITLE, PUBLICATION_DATE, PUBLISHER_ID, PRECIS)

FK PUBLISHER_ID -> PUBLISHER

AUTHOR (AUTHOR_ID, FIRST_NAME, LAST_NAME, DATE_OF_BIRTH, DATE_OF_DEATH)

BOOKAUTHOR (BOOK_ID, AUTHOR_ID)

FK BOOK_ID -> BOOK

FK AUTHOR_ID -> AUTHOR

COPY (COPY_ID, BOOK_ID, COST, BRANCH_ID)

FK BOOK_ID -> BOOK

FK BRANCH_ID -> BRANCH

CATEGORY (CATEGORY_ID, CATEGORY_NAME)

BOOK_CATEGORY (BOOK_ID, CATEGORY_ID)

FK BOOK_ID -> BOOK

FK CATEGORY_ID -> CATEGORY

REVIEWER (REVIEWER_ID, FIRST_NAME, LAST_NAME)

REVIEW (REVIEW_ID, BOOK_ID, REVIEWER_ID, REVIEW_DATE, REVIEW)

FK BOOK_ID -> BOOK

FK REVIEWER_ID -> REVIEWER

PATRON (PATRON_ID, FIRST_NAME, LAST_NAME, STREET_ADDRESS, CITY, STATE, ZIPCODE, PHONE, FEE_BALANCE)

CHECKOUT (CHECKOUT_ID, COPY_ID, PATRON_ID, OUT_DATE, DUE_DATE, RETURN_DATE)

FK COPY_ID -> COPY

FK PATRON_ID -> PATRON

WAITLIST (BOOK_ID, PATRON_ID, BRANCH_ID, ON_DATE, OFF_DATE,)

FK BOOK_ID -> BOOK

FK PATRON_ID -> PATRON

FK BRANCH_ID -> BRANCH

QUERIES REQUIRED

1. List all libraries with the library name, address, and telephone number.

2. List all branches with the branch number, name, address, and name of the manager.

3. List all the books in the library system with the number, title, publication date, and prcis.

4. List all the patrons with their number, name, and address.

5. List all authors who are still living with their number, name, and birth date.

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

DB2 11 The Database For Big Data And Analytics

Authors: Cristian Molaro, Surekha Parekh, Terry Purcell, Julian Stuhler

1st Edition

1583473858, 978-1583473856

More Books

Students also viewed these Databases questions