-
Notifications
You must be signed in to change notification settings - Fork 108
/
EXERCISE_NOTES
82 lines (57 loc) · 1.55 KB
/
EXERCISE_NOTES
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
--RETRIEVING DATA---
1. Selecting columns
- Orders query: Id,CustomerId,EmployeeId,ShipCity,ShipCountry
- Customers query: Id,ContactName,CompanyName
- Suppliers query: Id,ContactName,CompanyName
- Employees query: Id,FirstName,LastName,Region,HireDate,Title
2. Filtering Via WHERE clauses
- Products query: Discontinued, Needs Reorder
- Customers query: Filter by ContactName, CustomerName using LIKE
3. Sorting and Paging
- Pagination for orders (limit, offset)
- Sorting for orders
- Pagination for customer orders
- Sorting for customer orders
--QUERYING ACROSS TABLES--
4. Join
- Order list
- Product list
- Order Details
5. Aggregate Functions and GROUP BY
- Order total
- Supplier product list
- Count of orders per employee
- Count of orders per customer
--MANIPULATING DATA---
6. Creating and Destroying Records
- Create an order
- Delete an order
7. Transactions
- Order items
8. Updating Records
- Update an existing order
--THE SCHEMA EVOLVES--
9. Migrations & Indices
- Order Indices: Customer, Employee
- Order Detail Indices: Order, Product
- Product Indices: Suppliers
- Employee Indices: ReportsTo
10. Constraints
- Product Indices: UNIQUE[ProductId, OrderId]
- Foreign Keys
- NOT NULL
--ADVANCED--
11. Triggers
- Set order.OrderDate on Transaction insert
12. Views
- Supplier List
13. Prepared Statements
- Get Order
--MySQL/POSTGRES--
14. PG/MySQL: JSON and Array column types
15. PG/MySQL: Materialized Views
16. PG/MySQL: Full Text Search
17. PG/MySQL: Pub-Sub
--DB Administration--
19. Command Line & Backup
19. Performance & Optimization