Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions part1.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SELECT productName as 'Name', productLine AS 'Product Line', buyPrice AS 'Buy Price' FROM products ORDER BY buyPrice DESC;
1 change: 1 addition & 0 deletions part2.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SELECT contactFirstName AS 'First Name', contactLastName AS 'Last Name', city AS 'City' FROM customers WHERE country='Germany' ORDER BY contactLastName ASC;
1 change: 1 addition & 0 deletions part3.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SELECT DISTINCT status FROM orders ORDER BY status;
1 change: 1 addition & 0 deletions part4.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SELECT * FROM payments WHERE paymentDate>='2005-01-01' ORDER BY amount;
7 changes: 7 additions & 0 deletions part5.sql
Original file line number Diff line number Diff line change
@@ -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.
9 changes: 9 additions & 0 deletions part6.sql
Original file line number Diff line number Diff line change
@@ -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).