Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f00c114

Browse files
author
Jonathan Chan
committed
Update Assessment.md
1 parent 9b4b6e7 commit f00c114

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

‎Assessment.md‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,52 +17,68 @@ Navigate to [W3 School's Database](https://www.w3schools.com/sql/trysql.asp?file
1717
## Basic Queries
1818

1919
1. Query all OrderDetails where order quantity is greater than 10 but less than 30
20+
2021
2. Query all Suppliers that are located in either the USA, UK, or Canada
22+
2123
3. Query all Employees with the letter "a" in either their First or Last Name (be careful for case sensitivity)
2224

2325
## Calculated Fields
2426

2527
1. Query all Employees details & concatenate FirstName & LastName columns into new calculated field, FullName
28+
2629
2. Query Customers & separate ContactName into two new calculated fields, FirstName & LastName
30+
2731
3. 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

3337
1. Query all OrderDetails and calculated the average quantity order per ProductID under new calculated field, AverageQuantity
38+
3439
2. Query all Customers details and calculate the total Customers per Country under new calculated field, TotalCustomers
40+
3541
3. 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

4147
1. Query all OrderDetails along with ProductName & Price and return (Quantity \* Price) under new calculated field, Total
48+
4249
2. Query all Orders details along with Customer Name & Employee FirstName & LastName as new calculated field, EmployeeName
50+
4351
3. Query all Shippers details and return the total number of Products shipped under new calculated field, TotalShippedProducts
4452

4553
## Union
4654

4755
1. Query the names and phone numbers across all Shippers and Suppliers
56+
4857
2. 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

5261
1. 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+
5667
2. 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+
5972
3. 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

6578
1. What is a join in SQL? What are the types of joins?
79+
6680
2. What is the difference between a UNION and a JOIN query?
81+
6782
3. What is a foreign key?
83+
6884
4. What is the difference between a database versus a table versus a field?

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /