Basic SQL Queries

docx

School

Utah State University *

*We aren’t endorsed by this school

Course

2100

Subject

Information Systems

Date

Dec 6, 2023

Type

docx

Pages

12

Uploaded by KidFreedom5699

Report
Brett Chase Bruggeman A02231449 DATA 2100 HW Minor – Basic SQL Queries Part A 1. Table Primary Key Customer CustID Product ModelID OrderLine OLID Region RegionID SalesOrder SOID Service SvcID USState StateID Part B 2.
SELECT all FROM Region;
3. SELECT ModelID, MSRP FROM "Product" ORDER BY ModelName asc; 4. SELECT StateName, Population, RegionID
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
FROM USState WHERE Population > 15000000 ORDER By Population desc; 5. SELECT StateName, Population
FROM USState WHERE StateName like 'N%' and Population > 3000000 ORDER By StateName asc; 6. SELECT Fname, Lname, Children, Marital, CustState
FROM Customer WHERE Children >= '4' and CustState = 'CO' and Marital = 'married' ORDER BY Children DESC, Lname; 7. SELECT Fname, Lname, CustState, Children + 2 [ChildrenUpdate]
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
FROM Customer WHERE CustState in ('AZ', 'CA', 'WA') and Children > 0 ORDER BY Children DESC, Lname; 8. SELECT ModelName, MSRP, MSRP + (MSRP * 0.08)[PriceUpdate]
FROM Product WHERE ModelName not in ('RapidBunny') and MSRP > 350 ORDER BY ModelName ASC; 9. SELECT SvcID, Product, SvcRating, SvcDays, SvcDate
FROM Service WHERE SvcRating = 5 and SvcDays <= 3 ORDER BY SvcDays desc, SvcDate; 10. SELECT OrderTotal, SODate, SOID
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
FROM SalesOrder WHERE SODate >= '2023-08-23' and SODate <= ('2023-08-27') ORDER BY SODate, OrderTotal DESC; 11. SELECT ModelID, ModelName, Cost, MSRP, (MSRP - Cost) / Cost [ProductMarkup]
FROM Product ORDER BY [ProductMarkup] desc; 12. SELECT Fname, Lname, CustState, Children, HasPets, Marital
FROM Customer WHERE (Children > 0 or HasPets = 'y') and Marital = 'single' ORDER BY Lname, Fname;
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help