Dies ist eine alte Version des Dokuments!


LU04.A04 - SQL-DQL: Selects with Aggregate Functions

  • Work type: individual
  • Timeframe: 20 Minutes
  • Means of aid:
  • Expected result: Semantically and syntactically correct SQL statements according to the requirements of the case studies.

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

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

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

SELECT max(price)
FROM Products;

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

SELECT max(price) 
FROM Products
WHERE SupplierID = 12;

What is the average price for products of supplier 3?

SELECT AVG(price) 
FROM Products
WHERE SupplierID = 3;

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

SELECT count(customerID)
FROM Orders
where customerID = 5;
English German

Volkan Demir

  • modul/m290/learningunits/lu04/aufgaben/a04.1725455765.txt.gz
  • Zuletzt geändert: 2024/09/04 15:16
  • von vdemir