Ch. 10 — SQL

ClassicModels Schema

customers customerNumbercustomerNamecontactLastNamecontactFirstNamephoneaddressLine1addressLine2citystatepostalCodecountrysalesRepEmployeeNumbercreditLimitcustomerLocation 122 rows
employees employeeNumberlastNamefirstNameextensionemailreportsTojobTitleofficeCode 23 rows
offices officeCodecityphoneaddressLine1addressLine2statecountrypostalCodeterritoryofficeLocation 7 rows
orderdetails orderNumberproductCodequantityOrderedpriceEachorderLineNumber 2996 rows
orders orderNumberorderDaterequiredDateshippedDatestatuscommentscustomerNumber 326 rows
payments checkNumberpaymentDateamountcustomerNumber 273 rows
productlines productLinetextDescriptionhtmlDescriptionimage 7 rows
products productCodeproductNameproductScaleproductVendorproductDescriptionquantityInStockbuyPriceMSRPproductLine 110 rows
Exercise 2
For orders with more than 2 products, find any product contributing more than 50% of the order value.
SELECT only — ClassicModels
Write your SQL above and click Run Query.