CORRECT ANSWERS
1. What SQL function is used to count the number of movies in the query
provided?
MAX()
1. What SQL function is used to count the number of movies in the query
provided?
MAX()
COUNT()
SUM()
AVG()
2. Describe the purpose of creating an index on the Year column of the
Movie table.
Creating an index on the Year column changes the data type of
the column.
Creating an index on the Year column improves the speed of
queries that filter or sort by the Year.
Creating an index on the Year column decreases the speed of
data retrieval.
Creating an index on the Year column is used to delete records
from the table.
3. Describe the data type used for the Budget column in the Movie table
and its significance.
The Budget column uses the FLOAT data type for approximate
numeric values.
The Budget column uses the DECIMAL data type to represent
,costs accurately, allowing for two decimal places for cents.
The Budget column uses the INTEGER data type to represent
whole numbers only.
, The Budget column uses the VARCHAR data type to allow for
variable-length strings.
4. If you wanted to modify the SQL query to also include the Genre of each
movie alongside the Title, what would the updated query look like?
SELECT Title, RatingCode FROM Movie ORDER BY Title ASC;
SELECT Title, Genre FROM Movie ORDER BY Title ASC;
SELECT Genre, Title FROM Movie ORDER BY Genre DESC;
SELECT Title FROM Movie ORDER BY Genre ASC;
5. Describe the purpose of the foreign key constraints in the
LessonSchedule table.
The foreign key constraints allow for duplicate entries in the
LessonSchedule table.
The foreign key constraints ensure referential integrity by
linking HorseID to the Horse table and StudentID to the Student
table.
The foreign key constraints prevent any entries in the
LessonSchedule table.
The foreign key constraints automatically delete records from the
LessonSchedule table.
6. What is the correct syntax for updating a column named "age" in a table
named "students" to make all values 21?
MODIFY students SET age = 21;
ALTER students UPDATE age = 21;
SET students.age = 21;
UPDATE students SET age = 21;