Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Lesson Lab – Aggregate Functions

Questions

1. Using the Employees table, find the total number of employees. Alias the column as Total
Employees.

2. Display the category and average list price for the products in the Products table. Group by
category, then sort by list price in ascending order.

3. Find the least expensive product, and total number of products in the Products table.

4. Find the total shipping costs for each customer in the Orders table.

5. Using the Order Details table, find the total for each order with a sum over $1500.

Microsoft Access: SQL for Non-Programmers | Udemy.com


IsaBel Harrison
Answers

1.

SELECT COUNT(*) AS [Total Employees]

FROM Employees

2.

SELECT Category, AVG([List Price])

FROM Products

GROUP BY Category

ORDER BY AVG([List Price])

3.

SELECT MIN([List Price]) AS [Least Expensive], COUNT(*) AS [Total Products]

FROM Products

4.

SELECT [Customer ID], SUM([Shipping Fee]) AS [Total Shipping]

FROM Orders

GROUP BY [Customer ID]

5.

SELECT [Order ID], SUM([Unit Price]*Quantity) AS [Order Total]

FROM [Order Details]

GROUP BY [Order ID]

HAVING SUM([Unit Price] * Quantity) > 1500

Microsoft Access: SQL for Non-Programmers | Udemy.com


IsaBel Harrison

You might also like