Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Avishant
Starting Member
1 Post |
Posted - 2011-03-14 : 19:31:35
|
| CUSTOMER (CustomerID, LastName, FirstName, Phone, Email)PURCHASE (InvoiceNumber, Date, PreTaxAmount, CustomerID)PURCHASE_ITEM (InvoiceNumber, ItemNumber, RetailPrice)ITEM (ItemNumber, Description, Cost, ArtistName)whereCustomerID in PURCHASE must exist in CustomerID in CUSTOMERInvoiceNumber in PURCHASE_ITEM must exist in InvoiceNumber in PURCHASEItemNumber in PURCHASE_ITEM must exist in ItemNumber in ITEM.Q1: Write CREATE TABLE statements for each of these tables. Include any foreign keyconstraints appropriate for each of these tables. Make your own assumptions regardingcascading updates and deletions and justify those assumptions.Q2: Write a SQL statement to list the LastName and FirstName of customers who havemade at least one purchase with PreTaxAmount greater than $200. Use a subquery.Q3: Write a SQL statement to list the LastName and FirstName of customers who havepurchased an item that was created by an artist with a name that begins with the letter J.Use a subquery.Q4: Write a SQL statement to show the sum of PreTaxAmount for each ArtistName butexclude any items that were part of purchases with a PreTaxAmount less than $25. |
|
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2011-03-14 : 19:53:09
|
| Avishant,You won't find many people here who will do your homework, but if you give it your best shot first, you'll find many people who will help you.JimEveryday I learn something that somebody else already knew |
 |
|
|
|
|
|
|
|