From abe0d0100b50c3f71511175e465af88a8053b1fc Mon Sep 17 00:00:00 2001 From: Ghassan Nasr Date: Wed, 8 Jul 2020 22:18:33 -0400 Subject: [PATCH] completed all 6 sql queries for the assignment --- Part1.sql | 3 +++ Part2.sql | 4 ++++ Part3.sql | 3 +++ Part4.sql | 4 ++++ Part5.sql | 5 +++++ Part6.sql | 5 +++++ 6 files changed, 24 insertions(+) create mode 100644 Part1.sql create mode 100644 Part2.sql create mode 100644 Part3.sql create mode 100644 Part4.sql create mode 100644 Part5.sql create mode 100644 Part6.sql diff --git a/Part1.sql b/Part1.sql new file mode 100644 index 0000000..f08202f --- /dev/null +++ b/Part1.sql @@ -0,0 +1,3 @@ +SELECT productName, productLine, buyPrice +FROM products +ORDER BY buyPrice DESC \ No newline at end of file diff --git a/Part2.sql b/Part2.sql new file mode 100644 index 0000000..b7fa11e --- /dev/null +++ b/Part2.sql @@ -0,0 +1,4 @@ +SELECT contactFirstName, contactLastName, city +FROM customers +WHERE country = 'Germany' +ORDER BY contactLastName ASC diff --git a/Part3.sql b/Part3.sql new file mode 100644 index 0000000..cdab989 --- /dev/null +++ b/Part3.sql @@ -0,0 +1,3 @@ +SELECT DISTINCT status +FROM orders +ORDER BY status ASC diff --git a/Part4.sql b/Part4.sql new file mode 100644 index 0000000..60c2fa5 --- /dev/null +++ b/Part4.sql @@ -0,0 +1,4 @@ +SELECT * +FROM payments +WHERE paymentDate >= '2005-01-01' +ORDER BY paymentDate ASC diff --git a/Part5.sql b/Part5.sql new file mode 100644 index 0000000..b515f1b --- /dev/null +++ b/Part5.sql @@ -0,0 +1,5 @@ +SELECT lastName, firstName, email, jobTitle +FROM employees emps INNER JOIN offices ofs + ON emps.officeCode = ofs.officeCode + WHERE ofs.city = 'San Francisco' +ORDER BY emps.lastName ASC \ No newline at end of file diff --git a/Part6.sql b/Part6.sql new file mode 100644 index 0000000..c3629ee --- /dev/null +++ b/Part6.sql @@ -0,0 +1,5 @@ +SELECT productName, productLine, productScale, productVendor +FROM products +WHERE productLine = 'Classic Cars' OR productLine = 'Vintage Cars' +ORDER BY productLine DESC, productName ASC +