diff --git a/Day1 Simple Queries/part1.sql b/Day1 Simple Queries/part1.sql new file mode 100644 index 0000000..7489df6 --- /dev/null +++ b/Day1 Simple Queries/part1.sql @@ -0,0 +1 @@ +SELECT productName, productLine, buyPrice FROM products; \ No newline at end of file diff --git a/Day1 Simple Queries/part2.sql b/Day1 Simple Queries/part2.sql new file mode 100644 index 0000000..ec5cb55 --- /dev/null +++ b/Day1 Simple Queries/part2.sql @@ -0,0 +1 @@ +SELECT contactFirstName, contactLastName, city From customers WHERE(country = 'Germany'); \ No newline at end of file diff --git a/Day1 Simple Queries/part3.sql b/Day1 Simple Queries/part3.sql new file mode 100644 index 0000000..eed3aaa --- /dev/null +++ b/Day1 Simple Queries/part3.sql @@ -0,0 +1 @@ +SELECT DISTINCT status FROM orders; diff --git a/Day1 Simple Queries/part4.sql b/Day1 Simple Queries/part4.sql new file mode 100644 index 0000000..8aab658 --- /dev/null +++ b/Day1 Simple Queries/part4.sql @@ -0,0 +1,3 @@ +/*Select all fields from the payments table for payments made on or after January 1, 2005.*/ +SELECT * FROM payments WHERE paymentDate BETWEEN '2005-01-01' AND '2020-07-08' + ORDER BY paymentDate ASC; \ No newline at end of file diff --git a/Day1 Simple Queries/part5.sql b/Day1 Simple Queries/part5.sql new file mode 100644 index 0000000..85d72fe --- /dev/null +++ b/Day1 Simple Queries/part5.sql @@ -0,0 +1,3 @@ +/*Write a query to display all Last Name, First Name, Email and Job Title of all employees working out +of the San Francisco office.*/ +SELECT * FROM employees WHERE officeCode =1 ORDER BY lastName; \ No newline at end of file diff --git a/Day1 Simple Queries/part6.sql b/Day1 Simple Queries/part6.sql new file mode 100644 index 0000000..d63cf65 --- /dev/null +++ b/Day1 Simple Queries/part6.sql @@ -0,0 +1,4 @@ +/*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).*/ +SELECT * FROM products WHERE productLine IN ('Classic Cars', 'Vintage Cars') order by productLine DESC; \ No newline at end of file