Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Table 1: CUSTOMER. Problem 1 Assume that The Queen Anne Curiosity Shop designs a database with the following tables. CustomerID LastName First Name City Phone
Table 1: CUSTOMER. Problem 1 Assume that The Queen Anne Curiosity Shop designs a database with the following tables. CustomerID LastName First Name City Phone Shire Robert Seattle 20624-2433 Goodyear Katharine Seattle 206-324-3544 CUSTOMER(Customer ID,Lastname,stName , city, Phone . VENDORVencorID.Companyare, contactLas LN ame, ContactFirstName, City Ena) LUEMItem ID. Item Description, Purchase Date, ItemCost, Vendor ID ) SALE (SaleID. Customer Io, Item ID, SaleDate, SubTotal Tax, Total Bancroft Chris Bellevue 425-635-9788 Table 2: VENDOR. The referential integrity constraints are: vendorD in ITEM must exist in vendorID in VENDOR CustomerID in SALE must exist in CustomerID in CUSTOMER temID in SALE must exist in ItemID in ITEM VendoscDI Company Name ContactlantName ContactFirsLName City Linens and Thin Huntington Seattle European Specialties Tedeema Ken Seattie late Andrew I Kirkland increase smewhere on New Yock Brokerage Mark Seattle I ButObusineEEcom Assume that CustomerID of CUSTOMER, ItemID of ITEM, and SalclD of SALE are all surrogate keys starting at 1, incrementing by 1. Write SQL statements and answer questions for this database as follows. Table 3: ITEM. ItemlD Item Description Purchase Date temCoast VendorID 1. Write SQL CREATE TABLE statements for each of these tables. (60 points) 7-Nov-12 Antique Jenk Ant he Doak Chair 2- N. 300 Table L |4-Nov-12 600 (QMake your own assumptions regarding cascading deletions/updates Candles 14-Nov-12 2R-N 70 Antique Chair Antique Chair 28-Nov-12 1OGO (b) See data samples in Question 2 to determine whether an attribute should be NULL or NOT NULL. Table 4: SALE SaleID CustomerID ItemID Sale Date Subtotal Total (c) For data types, refer to our sample SQL in slides 2. Write SQL statements to insert following data to each table. Make sure you insert the complete and exactly the same data as shown in the following tables. 40 points) 14-Dev-12 3500 290.5 3790.5 15-Dec-12 1000 103 15-Dec-12 50 4.16 54.1 15-Jan-13 3000 29 3249
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started