From a64e1434db481e0e9fe49d716c87908435491bc7 Mon Sep 17 00:00:00 2001 From: M King Date: Fri, 19 Mar 2021 14:19:44 -0700 Subject: [PATCH] this is my lesson 1 assignment --- sql.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sql.txt b/sql.txt index 81dc19b..20387b4 100644 --- a/sql.txt +++ b/sql.txt @@ -1,14 +1,28 @@ (1) Using the Customer Table, select the CustomerName, ContactName, and Country. Use ORDER BY to order by Country. Use LIMIT and OFFSET to get entries 11 through 20. Paste your SQL statement below. +SELECT CustomerName, ContactName, Country FROM Customers ORDER BY Country LIMIT 10 OFFSET 10; + (2) Select all columns from the Customer table where the ContactName starts with A. Paste your SQL statement below. +SELECT * FROM Customers WHERE ContactName LIKE "A%"; + (3) Select all columns from the OrderDetails table where the ProductID is 51 and the quantity is greater than 10. Paste your SQL statement below. +SELECT * FROM OrderDetails WHERE ProductID = 51 AND quantity > 10; + (4) Insert 3 rows into the Products table. Note that you will have to specify a valid SupplierID and CategoryID, corresponding to rows from the Supplier and Category tables. Paste your three SQL statements below. +INSERT INTO Products (SupplierID, CategoryID) VALUES (1, 3); +INSERT INTO Products (SupplierID, CategoryID) VALUES (2, 1); +INSERT INTO Products (SupplierID, CategoryID) VALUES (2, 4); + (5) Update the two top rows of the Products Table to increase the price by 1.50. (Get SQL to do the addition for you.) Paste your SQL statement below. +UPDATE Products SET price = price + 1.50 WHERE ProductID IN ( SELECT ProductID from Products LIMIT 2); + (6) Delete all rows of the Products Table where the price is less than 7.00. Paste your SQL statement below. + +DELETE FROM Products WHERE price < 7.00; \ No newline at end of file