Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

SQL Help ! Using Create 1. Create a table that implements the many-to-many relationship between titles and authors. Include a field to track the royalty

SQL Help !

Using Create

1. Create a table that implements the many-to-many relationship between titles and authors. Include a field to track the royalty share the author receives for a title (must be between 0 and 100%).

Using Alter

Modify the Titles table:

2. Add a field indicating whether there is a contract with an author for this book. This field should default to true.

3. Add a field for the amount of advance payment made to author(s); advance cannot be a negative number; an advance cannot be made if there is not a contract.

4. Add a field for Projected Sales; projected sales cannot be negative or zero.

5. Add a field for Notes.

Expand the Database

Add a table to identify the Sales of books to stores.

6. Add a text field to identify each store by four characters; this is required.

7. Add a field to store up to 20 characters to capture the Purchase Order number; this is required.

8. Add a field to capture the date of the sale, defaulting to today.

Add a table for Sales Details; this is a join table between Sales and Titles.

9. Add fields to serve as foreign keys as appropriate.

10. Make the combination of foreign key values the primary key.

11. Add a field to track the quantity ordered; this is required and must be greater than zero.

12. Add a field to track the quantity shipped; this is required and must be greater than zero.

13. Add a field to track the shipping date; date must be on or before today and after January 1, 1998.

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

SQL For Data Science Data Cleaning Wrangling And Analytics With Relational Databases

Authors: Antonio Badia

1st Edition

3030575918, 978-3030575915

More Books

Students also viewed these Databases questions