From 10aa903205a705ceb0ef732f5d83c4b43e43e1fb Mon Sep 17 00:00:00 2001 From: Nkyo Lio Date: Wed, 8 Jul 2020 15:07:02 -0400 Subject: [PATCH] Last update --- part1.sql | 1 + part2.sql | 1 + part3.sql | 1 + part4.sql | 1 + part5.sql | 7 +++++++ part6.sql | 9 +++++++++ 6 files changed, 20 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..84c1ad4 --- /dev/null +++ b/part1.sql @@ -0,0 +1 @@ +SELECT productName as 'Name', productLine AS 'Product Line', buyPrice AS 'Buy Price' 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..d9478d3 --- /dev/null +++ b/part2.sql @@ -0,0 +1 @@ +SELECT contactFirstName AS 'First Name', contactLastName AS 'Last Name', city AS 'City' FROM customers WHERE country='Germany' ORDER BY contactLastName ASC; \ No newline at end of file diff --git a/part3.sql b/part3.sql new file mode 100644 index 0000000..05dcd9c --- /dev/null +++ b/part3.sql @@ -0,0 +1 @@ +SELECT DISTINCT status FROM orders ORDER BY status; \ No newline at end of file diff --git a/part4.sql b/part4.sql new file mode 100644 index 0000000..a813f22 --- /dev/null +++ b/part4.sql @@ -0,0 +1 @@ +SELECT * FROM payments WHERE paymentDate>='2005-01-01' ORDER BY amount; \ No newline at end of file diff --git a/part5.sql b/part5.sql new file mode 100644 index 0000000..3c98841 --- /dev/null +++ b/part5.sql @@ -0,0 +1,7 @@ +SELECT lastName AS 'Last Name', firstName AS 'First Name', email AS 'Email', jobTitle AS 'Job Title' +FROM employees +WHERE officeCode=(SELECT officeCode FROM offices WHERE city='San Francisco') ORDER BY lastName; + +-- Write a query to display all Last Name, First Name, Email and Job Title of all employees +-- working out of the San Francisco office. +-- Output should be sorted by last name. \ No newline at end of file diff --git a/part6.sql b/part6.sql new file mode 100644 index 0000000..a3267f3 --- /dev/null +++ b/part6.sql @@ -0,0 +1,9 @@ +SELECT productName AS 'Name', productLine AS 'Product Line', productScale AS 'Scale', productVendor AS 'Vendor' +FROM products +WHERE productLine='Classic Cars' OR productLine='Vintage Cars' ORDER BY productLine, productName; + + +-- Write a query to display the Name, Product Line, Scale, +-- and Vendor of all of the car products – both classic and vintage. +-- The output should display all vintage cars first (sorted alphabetically by name), +-- and all classic cars last (also sorted alphabetically by name). \ No newline at end of file