Question: Using the James River database, write SQL scripts to answer the following questions: List all the customers in Alphabetical Order Create a distinct list of
Using the James River database, write SQL scripts to answer the following questions:
List all the customers in Alphabetical Order
Create a distinct list of artists - First and Last Names
How many items did each artist create?
What is the average cost for bracelets?
Who makes the most expensive necklace and how much is it?
How many invoices for each customer?
Which Invoices were created before May 15th?
How many invoices are higher than $100 pre tax?
List each invoice and how many items are on each.
List each invoice greater than $200 that was created on or after May 15th.



but leave the table LI F statements pueletions in your answer to part B, wrire the actual database! JEWELRY PROJECT QUESTIONS Assume that James River designs a database with the following tables: CUSTOMER (CustomerID, LastName, FirstName, Phone, EmailAddress) PURCHASE (InvoiceNumber, InvoiceDate, PreTaxAmount, CustomerID) PURCHASE_ITEM (InvoiceNumber, InvoiceLineNumber, ItemNumber, RetailPrice) ITEM (ItemNumber, ItemDescription, Cost, ArtistLastName, ArtistFirstName) The referential integrity constraints are: CustomerID in PURCHASE must exist in CustomerID in CUSTOMER InvoiceNumber in PURCHASE_ITEM must exist in InvoiceNumber in PURCHASE ItemNumber in PURCHASE_ITEM must exist in ItemNumber in ITEM Assume that CustomerID of CUSIOMFR. ItemNumber of ITEM, and Invoice Number of PURCHASE are all surrogate keys with values as follows: Chapter a Stmaturnd Qurry Language 261 RE 345 s. pie Data for JRJ PURCHASE Table FIGURE 3-46 sample Data for JRJ PURCHASE_ITEM Table Write SQI statements and answet questions for this database as follows: A. Write SQL, CRFATE TABLE statements for each of these tables. Omit foreign keys. B. Write foreign key constraints for the relacionships in each of these tables. Make your own assumptions regarding cascading deletions and justify those assumptions. (Hint: You can combine the SQL for your answers to parts A and B.) C. Wrice SQL statements to insert the data shown in Figure 3-43, Figure 3-44, Figure 3-45, and Figure 346 into these tables. Assume that surrogate key column valnes will be supplied by the DBMS. FIGURE 3-44 Samnlo nata fnr IR I ITEM Tahla
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
