Search Header Logo
Higher DDD - Aggregate Functions, GROUP BY

Higher DDD - Aggregate Functions, GROUP BY

Assessment

Presentation

Computers

9th Grade

Practice Problem

Medium

Created by

G Alexander-Doyle

Used 4+ times

FREE Resource

10 Slides • 6 Questions

1

media

2

  • We are learning how to implement SELECT FROM, UPDATE, DELETE FROM and INSERT INTO queries.  

  • We are learning how to use aggregate functions to return a value from a row in a database entity.  

  • We are learning how the GROUP BY clause to group records together in a set of query results.  

  • We are learning how to implement sub-queries   

Aims

3

  • I can design a SQL query making use of the AVG, SUM, COUNT, MIN and MAX aggregate functions.  

  • I can design a SQL query making use of the GROUP BY clause to combine records as a summary.  

Achievements (theory)

4

  • I can implement SELECT FROM, UPDATE, DELETE FROM and INSERT INTO queries.  

  • I can implement a SQL query making use of the AVG, SUM, COUNT, MIN and MAX aggregate functions.  

  • I can implement a SQL query making use of the GROUP BY clause to combine records as a summary.  

  • I can implement sub-queries in a database.  

Achievements (practical)

5

media

6

media

7

media

8

Multiple Choice

Question image

In the following database which aggregate function would you use to find the employee with the longest service?

1

AVERAGE

2

SUM

3

COUNT

4

MAX

5

MIN

9

Multiple Choice

Question image

In the following database which aggregate function would you use to calculate the total number of years served by all employees?

1

AVERAGE

2

SUM

3

COUNT

4

MAX

5

MIN

10

Multiple Choice

Question image

In the following database which aggregate function would you use to find the number of employees who work in building 1e?

1

AVERAGE

2

SUM

3

COUNT

4

MAX

5

MIN

11

Multiple Choice

Question image

In the following database which aggregate function would you use to find the employee with the shortest service?

1

AVERAGE

2

SUM

3

COUNT

4

MAX

5

MIN

12

Fill in the Blank

Question image

Perfect Eyes is an optician that has branches throughout Scotland. It uses a relational database consisting of three linked tables to store data about customers, opticians and specialist referrals. Extracts from the three tables are shown below. 

Average Points

38.4

(2 marks)

(
)
[
]

13

media

14

Multiple Select

Question image

Which of the fields in this database could be used in a GROUP BY clause. Select all that apply.

1

employeeID

2

jobTitle

3

employeeName

4

building

5

yearsEmployed

15

media

16

media
media

Show answer

Auto Play

Slide 1 / 16

SLIDE