
DDD Implementation
Presentation
•
Computers
•
12th Grade
•
Practice Problem
•
Hard
J Murray
FREE Resource
34 Slides • 28 Questions
1
2
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?
To ensure data is organized, secure, and easily accessible
To make the database look visually appealing
To reduce the cost of hardware
To avoid using programming languages
5
6
Multiple Choice
Which SQL operator is commonly used with wildcard characters to perform search operations in a WHERE clause?
LIKE
IN
BETWEEN
ORDER BY
7
8
Fill in the Blanks
9
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?
WHERE surname LIKE '_h%'
WHERE surname LIKE 'h_%'
WHERE surname LIKE '%h_'
WHERE surname LIKE '%_h'
11
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
14
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'?
hotelName, swimmingPool, resortName, resortType
hotelRef, resortID, bookingNo, customer#
hotelName, starRating, resortType, trainStation
customer#, surname, address, town
17
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?
WHERE surname LIKE '?h*'
WHERE surname = 'h*'
WHERE surname LIKE 'h*'
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
21
22
Multiple Choice
What is the purpose of an equi-join in SQL?
To combine tables based on matching values in specified columns
To remove duplicate rows from a table
To sort the results in ascending order
To count the number of rows in a table
23
24
25
Fill in the Blanks
Type answer...
26
Multiple Select
Which of the following are aggregate functions in SQL?
AVG()
COUNT()
MAX()
SELECT()
27
28
Multiple Choice
Which aggregate functions can be applied to both numeric and character data types?
MIN() and MAX()
SUM() and AVG()
COUNT() and SUM()
AVG() and MAX()
29
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?
You can mix aggregate and non-aggregate expressions in a SELECT statement without restrictions.
A SELECT statement must contain either all non-aggregate expressions or all aggregate expressions.
You cannot use more than one aggregate expression in a SELECT statement.
Aggregate functions can only be used with the GROUP BY clause.
32
33
34
Multiple Choice
Design a query to display the average number of nights booked. What aggregate function would you use and on which table?
SUM(numberNights) on Booking
AVG(numberNights) on Booking
COUNT(numberNights) on Hotel
MAX(numberNights) on Resort
35
36
Multiple Choice
Which of the following queries would correctly display the number of resorts in each resort type?
SELECT resortType, COUNT(*) FROM Resort GROUP BY resortType;
SELECT COUNT(resortType) FROM Resort;
SELECT resortType, SUM(*) FROM Resort;
SELECT COUNT(*) FROM Resort GROUP BY resortType;
37
38
Fill in the Blanks
39
40
Open Ended
Describe how an alias can improve the readability of a SQL query result and how it is implemented.
41
42
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?
To make column headings more readable
To speed up query execution
To join multiple tables
To filter records
45
46
Multiple Select
Which of the following are benefits of using the GROUP BY clause in SQL?
It allows grouping of records with identical data in specified columns.
It ensures one result is returned for each set of grouped records when used with aggregate functions.
It allows mixing of non-aggregate and aggregate expressions for grouping columns.
It sorts the records automatically.
47
48
Fill in the Blanks
Type answer...
49
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?
SELECT Hotel.mealPlan, Count(*) FROM Hotel, Booking GROUP BY Hotel.mealPlan ORDER BY Count(*) ASC;
SELECT mealPlan, SUM(bookings) FROM Hotel GROUP BY mealPlan;
SELECT mealPlan, COUNT(*) FROM Booking GROUP BY mealPlan ORDER BY mealPlan;
SELECT COUNT(mealPlan) FROM Booking ORDER BY mealPlan;
51
52
Fill in the Blanks
Type answer...
53
54
55
56
57
58
59
60
61
Multiple Choice
Which of the following is NOT typically included in the design of an SQL query?
The field(s) used to sort the data
The color scheme of the database interface
Any search criteria to be applied
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.
Show answer
Auto Play
Slide 1 / 62
SLIDE
Similar Resources on Wayground
57 questions
Empower C1 - 5A (part 1)
Presentation
•
12th Grade
54 questions
Trigo 2:Chain Rule
Presentation
•
12th Grade
56 questions
Microscope and Microscopy
Presentation
•
11th - 12th Grade
56 questions
SPANISH TELLING TIME
Presentation
•
12th Grade
56 questions
Untitled Presentation
Presentation
•
KG - University
57 questions
Step 7: Save/Collect Evidence
Presentation
•
12th Grade
58 questions
SPA 1.1-1.4 REVIEW
Presentation
•
KG
55 questions
Metric System Lesson
Presentation
•
12th Grade
Popular Resources on Wayground
20 questions
STAAR Review Quiz #3
Quiz
•
8th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
6 questions
Marshmallow Farm Quiz
Quiz
•
2nd - 5th Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
20 questions
Inferences
Quiz
•
4th Grade
19 questions
Classifying Quadrilaterals
Quiz
•
3rd Grade
12 questions
What makes Nebraska's government unique?
Quiz
•
4th - 5th Grade
Discover more resources for Computers
20 questions
Grammar
Quiz
•
9th - 12th Grade
31 questions
Easter Trivia
Quiz
•
KG - 12th Grade
16 questions
Circles - Equations, Central & Inscribed Angles
Quiz
•
9th - 12th Grade
46 questions
Unit 4 Geosphere Test Review
Quiz
•
9th - 12th Grade
30 questions
TSI Writing/Revising and Editing Practice Test
Quiz
•
12th Grade
10 questions
Climate Change and Its Impact
Interactive video
•
9th - 12th Grade
35 questions
Venn Diagrams, Theoretical, & Experimental Review
Quiz
•
9th - 12th Grade
20 questions
Food Chains and Food Webs
Quiz
•
7th - 12th Grade