Uploaded by Danish Khan

SQL queries

advertisement
List prod name, finish ,and std price for all desks & tables in prod table that cost more tha
300 (use like)
Slide 38
SELECT Product_name, Product_finish
FROM Product_t
WHERE (Product_name LIKE ‘*Desk’ OR Product_name LIKE ‘*Table’) AND Unit_price > 300;
SQL query to display cust id, ame, & order id for all customers and their orders, if any
SELECT c.Customer_ID, Customer_name, o.Order_ID
FROM Customer_t c LEFT JOIN Order_t o ON c.Customer_ID=o.Custtoemr_ID;
SELECT Customer_t.Customer_ID, Customer_name, Order_t.Order_ID
FROM Customer_t, Order_t
WHERE Customer_t.Customer_ID = Order_t.Order_ID;
Query too produce the prod desc & the prodStdPrice of all products where prodStdPrice is
greater than 275.
SELECT Product_escriptionn, Unit_Price as Product_StandardPrice
FROM Product_t
WHERE Unit_Price > 275;
Query to produce Avg ProdStdPrice oof all proodcuts in Prod table, show the Avg
ProdStdPrice
SELECT AVG(Unit_Price) AS ProdductStandardPrice
FROM Product_t;
Download