Professional Documents
Culture Documents
6 - SQL Queries - Part 1 - Cont
6 - SQL Queries - Part 1 - Cont
PART 1
(cont.)
The SQL Computed Field (Column)
6
The SQL Computed Field (Column)
8
The SQL Computed Field (Column)
10
The SQL Functions
14
Using the COUNT Function
16
Using the COUNT and SUM
Functions
18
Using the AVG, Max and
Min Functions
Example 21: Find the total
balances of the Premiere
Products customer, as well as
the average balance, minimum
and maximum value of their
balances.
SQL Code and Result
20
Using the AVG, Max and
Min Functions
Example 22: What is the average
and total credit limit of all
customers of sales rep 65?
Also, get the largest and smallest
credit limit of the customers.
SQL Code and Result
22
The SQL GROUP BY
25
Using Group By
Example 24: For each parts, list
the warehouse and the total units
on hand in each warehouse.
Group the record by warehouse
and order the record by
warehouse in descending order.
SQL Code and Result
27
To be continued next meeting . . .
28
Thank you for listening!