From a793927e38f8692a854900614bafc35b043922ed Mon Sep 17 00:00:00 2001 From: StephSteve Date: Mon, 13 Jul 2020 14:21:47 -0400 Subject: [PATCH 1/3] SQL part 1 --- part1.sql | 5 +++++ part2.sql | 0 2 files changed, 5 insertions(+) create mode 100644 part1.sql create mode 100644 part2.sql diff --git a/part1.sql b/part1.sql new file mode 100644 index 0000000..0a58daa --- /dev/null +++ b/part1.sql @@ -0,0 +1,5 @@ + +SELECT customers.customerName, employees.lastName, employees.firstName +FROM customers +INNER JOIN employees ON customers.salesRepEmployeeNumber=employees.employeeNumber +ORDER BY customerName ASC; \ No newline at end of file diff --git a/part2.sql b/part2.sql new file mode 100644 index 0000000..e69de29 From 089e6f78b90e6069d345194405fbaff02b5058ee Mon Sep 17 00:00:00 2001 From: StephSteve Date: Mon, 13 Jul 2020 14:50:32 -0400 Subject: [PATCH 2/3] sql part 2 --- part2.sql | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/part2.sql b/part2.sql index e69de29..ddf1cbf 100644 --- a/part2.sql +++ b/part2.sql @@ -0,0 +1,10 @@ +/*Determine which products are most popular with our customers. +-For each product, list the total quantity ordered along with the total sale + generated (total quantity ordered * priceEach) for that product. +-The column headers should be Product Name, Total # Ordered and Total Sale. +-List the products by Total Sale descending.*/ + +SELECT productName AS 'Product Name',(quantityOrdered * priceEach) AS 'Total sale', quantityOrdered as 'Total # Ordered' +FROM products JOIN orderdetails ON products.productcode=orderdetails.productcode +ORDER BY (quantityOrdered * priceEach) desc; + From 8bbbb08efe58cddd71712f1904fc086708570ed0 Mon Sep 17 00:00:00 2001 From: StephSteve Date: Mon, 13 Jul 2020 23:27:05 -0400 Subject: [PATCH 3/3] part 3 --- part3.sql | 7 +++++++ part4.sql | 0 2 files changed, 7 insertions(+) create mode 100644 part3.sql create mode 100644 part4.sql diff --git a/part3.sql b/part3.sql new file mode 100644 index 0000000..726a20d --- /dev/null +++ b/part3.sql @@ -0,0 +1,7 @@ +/*Write a query which lists order status and the # of orders with that status. +Column headers should be Order Status and # Orders. +Sort alphabetically by status. Recieved help from Lakshmi*/ + +SELECT ORDERS.STATUS AS 'Order Status', COUNT(*) AS '#of Orders' FROM orders +group BY ORDERS.STATUS +ORDER BY orders.STATUS; diff --git a/part4.sql b/part4.sql new file mode 100644 index 0000000..e69de29