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