From 790d877e31cf48a1e4033a9f30894d25ccf9ef73 Mon Sep 17 00:00:00 2001 From: Emmanuel Orubele Date: Wed, 8 Jul 2020 22:07:04 -0400 Subject: [PATCH] Added parts 1,2,3,4,5, and 6 SQL data files to the exercise --- part1-productsQuery.sql | 5 +++++ part2-customersQuery.sql | 5 +++++ part3-ordersQuery.sql | 6 ++++++ part4-paymentQuery.sql | 4 ++++ part5-employeeQuery.sql | 7 +++++++ part6-productsQuery.sql | 8 ++++++++ 6 files changed, 35 insertions(+) create mode 100644 part1-productsQuery.sql create mode 100644 part2-customersQuery.sql create mode 100644 part3-ordersQuery.sql create mode 100644 part4-paymentQuery.sql create mode 100644 part5-employeeQuery.sql create mode 100644 part6-productsQuery.sql diff --git a/part1-productsQuery.sql b/part1-productsQuery.sql new file mode 100644 index 0000000..5bda86e --- /dev/null +++ b/part1-productsQuery.sql @@ -0,0 +1,5 @@ +/* My MariaDB assignment on query*/ + + +SELECT productName, productLine, buyPrice +FROM products; \ No newline at end of file diff --git a/part2-customersQuery.sql b/part2-customersQuery.sql new file mode 100644 index 0000000..522d264 --- /dev/null +++ b/part2-customersQuery.sql @@ -0,0 +1,5 @@ +/* My MairaDB queries for Part 2 */ + +SELECT contactFirstName, contactLastName, city +FROM customers +WHERE country = 'Germany'; \ No newline at end of file diff --git a/part3-ordersQuery.sql b/part3-ordersQuery.sql new file mode 100644 index 0000000..9271179 --- /dev/null +++ b/part3-ordersQuery.sql @@ -0,0 +1,6 @@ +/* Part three of the assignmment. */ + + +SELECT DISTINCT STATUS +FROM orders +ORDER BY STATUS ASC; diff --git a/part4-paymentQuery.sql b/part4-paymentQuery.sql new file mode 100644 index 0000000..7d53fbd --- /dev/null +++ b/part4-paymentQuery.sql @@ -0,0 +1,4 @@ +/* Assignment question part 4 */ + +SELECT * FROM payments +WHERE paymentDate > '2005/01/01'; \ No newline at end of file diff --git a/part5-employeeQuery.sql b/part5-employeeQuery.sql new file mode 100644 index 0000000..3f29759 --- /dev/null +++ b/part5-employeeQuery.sql @@ -0,0 +1,7 @@ +/* Part 5 answer on employee queries */ + +SELECT lastName, firstName, email, jobTitle +FROM employees, offices + WHERE employees.officeCode = offices.officeCode + AND offices.city = ('San Francisco') + ORDER BY lastName asc; \ No newline at end of file diff --git a/part6-productsQuery.sql b/part6-productsQuery.sql new file mode 100644 index 0000000..475c814 --- /dev/null +++ b/part6-productsQuery.sql @@ -0,0 +1,8 @@ +/* Final question on the assignment on car products */ + +SELECT productName, productLine, productScale, productVendor +FROM products +WHERE productLine = 'Vintage Cars' +or productLine = 'Classic Cars' +ORDER BY productName ASC; +