{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

MIdterm Review Homework - Midterm Review Homework CSC 5559...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Midterm Review Homework CSC 5559 Assume you have the following table definitions: sales ( date datetime, # Date of sale bc char(2), # Branch Code cc char(2), # Customer Code sn numeric(2), # Salesperson Number pc char(2), # Product Code qty numeric(3) # Quantity purchased ); branch ( code char(2), # Branch Code st char(2), # State Code where Branch is located mgrnum numeric(2) # Manager Number ) emp ( enum numeric(2), # Employee Number name varchar(20), # Employee Name mgrnum numeric(2) # Manager Number ) prod ( code char(2), # Product Code descrip varchar(20) # Product Name ) manu ( date datetime, # Date of Manufacture code char(2), # Product Code mst char(2), # State where Manufactured defects numeric(3), # Percent Defects in Batch qty numeric(3) # Quantity manufactured )
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
cust ( code char(2), # Unique Customer Code name varchar(20), # Customer Name st char(2), # State of Customer Residence rating numeric(2) # Customer Rating ) Create an SQL query for each of the following requirements. Convert the requirement to logic, then to SQL. Pay attention to the comments above as they describe what the attributes are. 1. Show me everything about each sale where the quantity purchased is greater than the average
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}