Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use the give table below to answer the following questions. sName Smith sCity SI S2 PI P2 P3 P4 PS Nut Bolt Red Blue 12

image text in transcribed

image text in transcribed

Use the give table below to answer the following questions. sName Smith sCity SI S2 PI P2 P3 P4 PS Nut Bolt Red Blue 12 17 17 10 Blake Paris Screw Red S4. S5 30 Athens Blue 12 SP SNo (PK) (FK S1 S1 S1 S1 S1 S2 S2 S3 S3 S3 S4 P1 P2 P3 P4 PS PI P2 Pl P2 P3 P2 P3 P4 200 100 100 200 200 200 S5 Table: Content of the Supplier-Parts DB Tables For each of the questions, write the corresponding SQL commands to retrieve the required data displaved in each table Display information about parts that have their weights greater than the average weight of all parts. pNo pName P2 P3 Screw Bolt Find supplier numbers of suppliers located in London who supply screws (i.c., such that the part name is 'screw") or bolts. The constraint is that you may not use any join or product, but use a subquery(ies). (Hint: Use subquery(ies).) SNo S2 S4 For cach part find the total, minimum, average, and maximum quantity of individual orders (each order is a tuple in p) and the total number of orders. Display the part number and for that part: the number of orders, total, minimum, average, maximum quantity of individual orders for that part and also the average quantity on order over all parts. Furthermore, display information in reverse order by part number pNo COUNT(pNo) SUM(qty) MIN(qty) AVG(qty MAX(qty) AVGqty P5 100 400 1000 1000 100 100.0000 100 200.0000 200 333.3333 400 250.0000 400 233.3333 300 246.1538 246.1538 246.1538 246.1538 246.1538 P2 P1 4 3 200 100 Find each part for which its largest individual order in terms of quantity is larger than the largest quantity on order for either nut or a cam. and the largest quantity for a nut and the largest quantity for a cam. pNo MAX (qty) MAXnutORcam P2 400 P3 400 300 For each part find the total, minimum, average, and maximum quantity of individual orders (each order is a tuple in p) and the total number of orders, but only for those parts for which the average quantity on order is greater than the average quantity on order over all parts. Display the part number and for that part: the number of orders, total, minimum, average, maximum quantity of individual orders for that part and also the average quantity on order over all parts. Furthermore, display information in reverse order by part number pNo COUNT(pNo) SUM(qty) MIN(qty) AVG(qty) MAX(qty) AVGqty P3 P2 4 1000 1000 333.3333 400 250.0000 400 246.1538 246.1538 200

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Infrastructure For Medical Research In Databases

Authors: Thomas Heinis ,Anastasia Ailamaki

1st Edition

1680833480, 978-1680833485

More Books

Students also viewed these Databases questions