Help with a few SQL commands? Attached is the table for SQL. Do not worry about
ID: 3692011 • Letter: H
Question
Help with a few SQL commands?
Attached is the table for SQL.
Do not worry about the script. I wll input them in.
Find how many different vendors are in the product table
Count the number of customers with a balance of more than $500
Find the average price of all products.
Find the minimum price for each sales code
Find the total value of all items carried in inventory
Find how many products are supplied by each vendor
CUS TOMER contains CUS LNAME DATE FK2 P CODE US NITIAL CUS AREACODE LINE UNiTs LINE PRICE is found in P DESCRP P INDATE PHONE P PRICE V STATE VOR DERExplanation / Answer
1.FIND THE AVERAGE PRICE OF ALL PRODUCTS
ANS:
SQL>SELECT AVG(PRICE) FROM PRODUCTS;
2.FIND THE MINIMUM PRICE FOR EACH SALSE CODE
ANS:
SQL>SELECT MIN(PRICE) FROM PRODUCT;
3.FIND HOW MANY DIFFERENT VENDORS IN PRODUCT TABLE
ANS:
SQL>SELECT PVENDOR FROM PRODUCTS;
4:COUNT THE NUMBER OF COSTEMERS WITH BALANCE OF MORE THAN $500.
ANS:
SQL>SELECT CNAME,BAL FROM CUSTEMOR WHERE BAL>$500;
5.FIND HOE MANY PRODUCTS ARE SUPPLIED BY EACH VENDOR.
SQL>SELECT PNAME,PRICE,VNAME,LOC FROM PRODUCT ,VENDOR;
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.