Question: Urgent help please! Products table [ [ Id , name,price,Quantity ] , [ 1 , T - shirt, 1 9 . 9 9 ,
Urgent help please!
Products
tableIdname,price,QuantityTshirt,Hoodle,Hat,
tableidNameJohn SmithSmith DoeBob Johnson
Orders
Orders
tableiddate,customerid
Order Lines
tableidorderidproductidquantity
Write the results of the following queries:
tabletableSELECT FROM CUSTOMERs where namelike Smith:;table SELECT from Customers WHEREid not in select customerid from orders;tableSELECT customer.name, count FROMorders o customers C WHEREocustomeridcid GROUP BYcustomername;tableSELECT pname, avgpprice I. quantityFROM orders o orderlines I, Products pWHERE pidlproductid and I.orderidoidGROUP BY pname;tablecustomername; SELECT customerid SUMIquantityppriFROM Orders o orderline I, products pWHERE customerid IN HAVING COUNTDISTINCT order,
and pidlproductid and lorderid
id
GROUP BY customerid;Products
tableIdname,price,QuantityTshirt,Hoodie,Hat,
tableidNameJohn SmithSmith DoeBob Johnson
Orders
Orders
tableiddate,customerid
Order Lines
Order Lines
tableidorderidproductidquantity
Write the results of the following queries:
tabletableSELECT FROM CUSTOMERs where namelike Smith;table SELECT from Customers WHEREid not in select customerid from orders:tablelike Smith;SELECT customer.name, count FROMorders o customers c WHEREocustomeridcid GROUP BYtableSELECT pname, avgpprice I. quantityFROM orders o orderlines I, Products pWHERE pidlproductid and I.orderididcustomername;,GROUP BY pname;
SELECT customerid SUMIquantity price as totalrevenue
FROM Orders orderline products
WHERE customerid IN I
SELECT customerid
FROM Orders
GROUP BY customerid
HAVING COUNTDISTINCT orderid
and pidlproductid and I.orderid
oid
GROUP BY customerid;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
