Search Header Logo
DDD Implementation

DDD Implementation

Assessment

Presentation

Computers

12th Grade

Practice Problem

Hard

Created by

J Murray

FREE Resource

34 Slides • 28 Questions

1

media

2

media

3

Open Ended

What are some key considerations when designing an SQL query for a database?

4

Multiple Choice

Why is it important to carefully design and implement a database in computing science?

1

To ensure data is organized, secure, and easily accessible

2

To make the database look visually appealing

3

To reduce the cost of hardware

4

To avoid using programming languages

5

media

6

Multiple Choice

Which SQL operator is commonly used with wildcard characters to perform search operations in a WHERE clause?

1

LIKE

2

IN

3

BETWEEN

4

ORDER BY

7

media

8

Fill in the Blanks

9

media

10

Multiple Choice

Based on the examples provided, which of the following WHERE clauses would find any values in the surname field that have 'h' as the second character?

1

WHERE surname LIKE '_h%'

2

WHERE surname LIKE 'h_%'

3

WHERE surname LIKE '%h_'

4

WHERE surname LIKE '%_h'

11

media

12

Open Ended

Compare the wildcard syntax used in the two tables shown in images 3 and 4. What is the main difference between them?

13

media

14

media

15

Open Ended

Design a SQL WHERE clause to find all resorts whose names end with the letter 'n'.

16

Multiple Choice

Which fields would you need to include in a query to display the name, swimming pool details, resort, and resort type of any hotel in a coastal resort that starts with the letter 'A'?

1

hotelName, swimmingPool, resortName, resortType

2

hotelRef, resortID, bookingNo, customer#

3

hotelName, starRating, resortType, trainStation

4

customer#, surname, address, town

17

media

18

Multiple Choice

Which SQL clause would you use to filter results so that only customers whose surname has 'h' as the second letter are shown?

1

WHERE surname LIKE '?h*'

2

WHERE surname = 'h*'

3

WHERE surname LIKE 'h*'

4

WHERE surname = '?h*'

19

Open Ended

Design a query to display a customer’s full name, booking number, start date, hotel name, and resort name for all customers who have an ‘h’ as the second letter of their surname. List these details in alphabetical order of surname; listing customers with the same surname in order of the earliest holiday first.

20

media

21

media

22

Multiple Choice

What is the purpose of an equi-join in SQL?

1

To combine tables based on matching values in specified columns

2

To remove duplicate rows from a table

3

To sort the results in ascending order

4

To count the number of rows in a table

23

media

24

media

25

Fill in the Blanks

Type answer...

26

Multiple Select

Which of the following are aggregate functions in SQL?

1

AVG()

2

COUNT()

3

MAX()

4

SELECT()

27

media

28

Multiple Choice

Which aggregate functions can be applied to both numeric and character data types?

1

MIN() and MAX()

2

SUM() and AVG()

3

COUNT() and SUM()

4

AVG() and MAX()

29

media

30

Open Ended

Explain why the following SQL query is considered illegal: SELECT productName, MAX(price) FROM Product;

31

Multiple Choice

Which of the following statements about aggregate functions in SQL is correct?

1

You can mix aggregate and non-aggregate expressions in a SELECT statement without restrictions.

2

A SELECT statement must contain either all non-aggregate expressions or all aggregate expressions.

3

You cannot use more than one aggregate expression in a SELECT statement.

4

Aggregate functions can only be used with the GROUP BY clause.

32

media

33

media

34

Multiple Choice

Design a query to display the average number of nights booked. What aggregate function would you use and on which table?

1

SUM(numberNights) on Booking

2

AVG(numberNights) on Booking

3

COUNT(numberNights) on Hotel

4

MAX(numberNights) on Resort

35

media

36

Multiple Choice

Which of the following queries would correctly display the number of resorts in each resort type?

1

SELECT resortType, COUNT(*) FROM Resort GROUP BY resortType;

2

SELECT COUNT(resortType) FROM Resort;

3

SELECT resortType, SUM(*) FROM Resort;

4

SELECT COUNT(*) FROM Resort GROUP BY resortType;

37

media

38

Fill in the Blanks

39

media

40

Open Ended

Describe how an alias can improve the readability of a SQL query result and how it is implemented.

41

media

42

media

43

Open Ended

Explain how the use of aliases in SQL queries can improve the readability of the resulting tables. Provide an example based on the images.

44

Multiple Choice

What is the main purpose of using an alias in an SQL SELECT statement, as shown in the examples?

1

To make column headings more readable

2

To speed up query execution

3

To join multiple tables

4

To filter records

45

media

46

Multiple Select

Which of the following are benefits of using the GROUP BY clause in SQL?

1

It allows grouping of records with identical data in specified columns.

2

It ensures one result is returned for each set of grouped records when used with aggregate functions.

3

It allows mixing of non-aggregate and aggregate expressions for grouping columns.

4

It sorts the records automatically.

47

media

48

Fill in the Blanks

Type answer...

49

media

50

Multiple Choice

Which SQL query would you use to display the number of bookings for each meal plan, sorted from least to most popular?

1

SELECT Hotel.mealPlan, Count(*) FROM Hotel, Booking GROUP BY Hotel.mealPlan ORDER BY Count(*) ASC;

2

SELECT mealPlan, SUM(bookings) FROM Hotel GROUP BY mealPlan;

3

SELECT mealPlan, COUNT(*) FROM Booking GROUP BY mealPlan ORDER BY mealPlan;

4

SELECT COUNT(mealPlan) FROM Booking ORDER BY mealPlan;

51

media

52

Fill in the Blanks

Type answer...

53

media

54

media

55

media

56

media

57

media

58

media

59

media

60

media

61

Multiple Choice

Which of the following is NOT typically included in the design of an SQL query?

1

The field(s) used to sort the data

2

The color scheme of the database interface

3

Any search criteria to be applied

4

Any field(s) or computed values required

62

Open Ended

Summarize the key considerations when designing an SQL query as discussed in today's lesson.

media

Show answer

Auto Play

Slide 1 / 62

SLIDE