Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Consider the small scenario for a library. There is a table to hold people who are members of the library, which keeps a name,

1. Consider the small scenario for a library. There is a table to hold people who are members of the library, which keeps a name, address, email address, library ID number (unique), unpaid fines. There is a table which, has an entry each book on loan that holds the library ID number of the member who has the book and the ISBN of the book that is on loan. There is a table that describes each book that the library holds the following information: the book's IDBN, the title, the year it was published, the publisher, the status (available, checkedout, on-hold, checked-out-on-hold), and the ID of the shelf that the book is stored on. ISBNs are unique. There is a table which associates authors (by name) with books they have authored or coauthored. Each author has one entry for each book he/she has written that the library holds, identified by ISBN. There is a table hold the birthdate of each author (by name) who has written or co-written a book that library holds. There is a table that holds an entry for each book on hold with the ID number of the member with the holds. There is a table that holds an entry with each shelf that holds the unique ID of the shelf and the number of books it can hold. The is a table with an entry for each book that holds the ISBN of the book and its shelf ID location. Write the SQL create table statements for each of the tables described above. Make reasonable assumptions for the column domain types. Use the descriptions to identify and define primary keys for tables (in some cases, the only candidate key may be all of the table columns). Use the descriptions to identify and define foreign keys. The foreign keys should ensure reasonable facts: books cannot be checked out by nonexistentent members; members cannot check out non-existent books; books cannot be stored on non-existent shelves, shelves cannot hold non-existent books; etc. 2. Write the create domain statement for a domain which represents the possible values of a book's status from problem number 1. 3. Write a view which displays the email and book for each book which is checked-out or checkout- on-hold. 4. Add a constraint to the table holding member data to add a table constraint that checks that the unpaid fine value is under $10.00. 5. Add a column to the table holding member data to add a column contains the number of books the member has checked out.

Please right the commands for sql database. thanks

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_2

Step: 3

blur-text-image_3

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

Seven Databases In Seven Weeks A Guide To Modern Databases And The NoSQL Movement

Authors: Luc Perkins, Eric Redmond, Jim Wilson

2nd Edition

1680502530, 978-1680502534

More Books

Students also viewed these Databases questions

Question

What is the effect of including a module in a class?

Answered: 1 week ago