@@ -17,52 +17,68 @@ Navigate to [W3 School's Database](https://www.w3schools.com/sql/trysql.asp?file
1717## Basic Queries
1818
19191 . Query all OrderDetails where order quantity is greater than 10 but less than 30
20+ 20212 . Query all Suppliers that are located in either the USA, UK, or Canada
22+ 21233 . Query all Employees with the letter "a" in either their First or Last Name (be careful for case sensitivity)
2224
2325## Calculated Fields
2426
25271 . Query all Employees details & concatenate FirstName & LastName columns into new calculated field, FullName
28+ 26292 . Query Customers & separate ContactName into two new calculated fields, FirstName & LastName
30+ 27313 . Query Products to return two new calculated fields:
2832 1 . The price divided by 2 under new calculated field, HalfOff
2933 2 . The price plus 8% tax under new calculated field, NetPrice
3034
3135## Grouping Data
3236
33371 . Query all OrderDetails and calculated the average quantity order per ProductID under new calculated field, AverageQuantity
38+ 34392 . Query all Customers details and calculate the total Customers per Country under new calculated field, TotalCustomers
40+ 35413 . Query all Products to return two new calculated fields:
3642 1 . The minimum price under new calculated field, MinPrice
3743 2 . The maximum price under new calculated field, MaxPrice
3844
3945## Join Queries
4046
41471 . Query all OrderDetails along with ProductName & Price and return (Quantity \* Price) under new calculated field, Total
48+ 42492 . Query all Orders details along with Customer Name & Employee FirstName & LastName as new calculated field, EmployeeName
50+ 43513 . Query all Shippers details and return the total number of Products shipped under new calculated field, TotalShippedProducts
4452
4553## Union
4654
47551 . Query the names and phone numbers across all Shippers and Suppliers
56+ 48572 . Query the fullnames of all customer and employee with the letter "a" is in their First or Last Name (be careful for case sensitivity)
4958
5059## Case Statements
5160
52611 . Query all Products details and return new calculated field, PriceRange with the following conditions
62+ 5363 1 . If the product price is below or equal to 15, return "Low"
5464 2 . If the product price is above 15 and below/ equal to 30, return "Med"
5565 3 . If the product price is above 30, return "High"
66+ 56672 . Query all OrderDetails and return new calculated field, EvenOdd with the following conditions
68+ 5769 1 . If the order quantity is even (e.g. 2, 4, 6), return "Even"
5870 2 . If the order quantity is odd (e.g. 1, 3, 5), return "Odd"
71+ 59723 . Query all Customers details and return new calculated field, Location with the following conditions
6073 1 . If the customer's country is located in the USA, return "Domestic"
6174 2 . If the customer's country is not located in the USA, return "International"
6275
6376## Concepts Short Answer Questions
6477
65781 . What is a join in SQL? What are the types of joins?
79+ 66802 . What is the difference between a UNION and a JOIN query?
81+ 67823 . What is a foreign key?
83+ 68844 . What is the difference between a database versus a table versus a field?
0 commit comments