Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using the given Database and it's tables and rows, Write the following SQL queries: 1. List the pno and pname of parts that cost more
Using the given Database and it's tables and rows, Write the following SQL queries:
1. List the pno and pname of parts that cost more than the average cost of all parts.
2. For each part that has been sold, get pno and pname values along with total sales in dollars for that part.
customers cno | cname street zip phone ||1111 Charles 123 Main St. 167226||316-636-5555 2222 Bertram237 Ash Avenue 167226|316-689-5555 Barbara ||111 Inwood St. 60606|316-111-1234 ||4444||Will |111 Kenwood St. ||54444||416-111-1234 Bill ||211 Marlwood St. 28408416-111-1235 ||6666 Keely 211 Pinewood St. 28411 416-111-1235 17777| Maera 211 Marlwood St. 28408416-111-1235| employees || eno |enamezip || hdate ||1000||Jones 67226|95-12-12 |1001 Smith 60606 92-01-01 1002 Brown 5030294-09-01 1003||Green 28411 ||02-09-01 1004 Purple 28411 03-01-01 zipcodes zip city 67226 Wichita 60606 Fort Dodge 50302 Kansas City 54444 Columbia 66002 Liberal 61111 Fort Hays 28411 Wilmington 28408 Wilmington orders ono cno eno received shipped 1020 1111 1000 94-12-10 94-12-12 ||10211111 1000 95-01-12 95-01-15|| 1022 2222 1001 95-02-13 95-02-20 ||1023||3333||1000 03-02-15||NULL | 1024 4444 1000 03-02-15 03-02-16 ||1025|5555||1000||03-02-15||03-02-16 odetails ono pno qty 1020 105061 1020 10800 1 1020105082 ||1020105093 ||1021|106014 ||1021|105067 1022||106011 ||1022||107011_ ||1023||108001 ||1023||109001 ||1023||105062 1024 10506|12 1025 10601 2 parts pno pname qoh price olevel ||10506||Land Before Time I 200 ||19.99||20 10507 Land Before Time II (156|19.99||20 10508 Land Before Time III 190||19.99||20 10509||Land Before Time IV 60 |19.9920 (10601| Sleeping Beauty 300 24.9920 10701 When Harry Met Sally 120 19.99 30 10800 Dirty Harry (140 14.9930 10900 Dr. Zhivago 100|24.9930 10901||A Star is Born 100 4.99 30 ||10902 Star Wars 500 24.99 30 | 10903 Lord of the Rings (100|34.99|30 |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