LU06.A03 - SQL-DQL: Selects with Aggregate Functions

Requirements

Case studies / Assignments

The following ERD describes a order database for a a shop.

Assignments

The general assignment is to develop DQL commands that matches the requirements below:

A: MIN

We want to know which of our products actually the cheapest is.

B: MAX

What is the highest price for the products of the supplier with id = 12?

C: AVG

What is the average price for products of supplier 3?

D: COUNT

How many orders do we currently have in our data-base system from the customer with id = 5?

E: SUM

What is the worth of the order 10255? Please note, that there are two tables involved in this select statement.

F: GROUP BY

For our anual report we need list of the orders, and the value of each, grouped by the OrderID.

Solution

Lösung

Vocabulary

English German

Volkan Demir