Professional Documents
Culture Documents
2
Advanced Queries with Aggregates
3
Multiple Sources
4
Multiple Sources
5
Multiple Sources
6
Multiple Sources
7
Join Examples
● Aggregates support three types Customer
of Joins
Only With
With or Without
With Order
8
Only With
9
Only With
10
Only With
11
With or Without
● Returns all rows from the left Entity even if there is no match in the right Entity
12
With or Without
● Returns all rows from the left Entity even if there is no match in the right Entity
13
With or Without
● Returns all rows from the left Entity even if there is no match in the right Entity
14
With or Without
● Returns all rows from the left Entity even if there is no match in the right Entity
15
With
16
With
17
Aggregate Joins in SQL
18
Hiding Columns
● The attributes used outside the Aggregate determine which columns are
fetched
19
Calculated Attributes
○ Variables
20
Aggregating Records
● Group multiple rows together
○ Example: Group by Orders to find #
of Products per Order
21