MidTerm Exam

Started: Oct 14 at 6:38pm

Quiz Instructions

Please note that the last question (Question 10) consists of 5 sub-questions, so allocate enough time for that.

 

Note: this is a timed quiz. You may check the remaining time you have at any point while taking the quiz by pressing the keyboard combination SHIFT, ALT, and T... Again: SHIFT, ALT, and T...
 
Flag question: Question 1
Question 1 5 pts
0 multiple_answers_question    
What property describes a database? Select all the property(ies) that apply.
Group of answer choices
 
Flag question: Question 2
Question 2 10 pts
0 matching_question    
Basic Terminology: Match the word with a definition.  
Group of answer choices





 
Flag question: Question 3
Question 3 10 pts
0 matching_question    
Match the definition of the constraint and its definition
Group of answer choices




 
Flag question: Question 4
Question 4 10 pts
0 multiple_answers_question    

Which of the following set of columns could be used for super keys for the following table. Select all possible choices.

question4.png 

Group of answer choices
 
Flag question: Question 5
Question 5 10 pts
0 essay_question    

What would you choose as foreign keys in the following schema. Specify your answers in the form:

TableName(ColumnName) references TableName(ColumnName)

flights.png

p
 
Flag question: Question 6
Question 6 10 pts
0 essay_question    

Write the SQL DDL commands to create the tables with all necessary constraints for the following equestrian school database:

The database contains a Horse table, with columns:

  • ID
  • RegisteredName

The database contains a Student table, with columns:

  • ID
  • FirstName
  • LastName
  • PhoneNumber

The database contains an Instructor table,table with columns:

  • ID
  • FirstName
  • LastName
  • PhoneNumber

and a  LessonSchedule table, with columns:

  • HorseID
  • StudentID
  • InstructorID
  • LessonDateTime

 

p
 
Flag question: Question 7
Question 7 10 pts
0 multiple_choice_question    

Given the following employee table

employee table

Which employee_id's will appear in the output of 

SELECT employee_id FROM employee WHERE dept <> 'Research' AND Salary  >= 128000;

Group of answer choices
 
Flag question: Question 8
Question 8 5 pts
0 multiple_choice_question    

If the following query is executed against the table in question 7

SELECT dept, MAX(Salary) FROM employee 
GROUP BY dept
HAVING COUNT(name)>2

How many rows will be displayed

Group of answer choices
 
Flag question: Question 9
Question 9 5 pts
0 multiple_choice_question    

How many rows will be impacted if the following update statement is executed against the employee table of  question 7

UPDATE employee 
SET salary = 1.05*salary
WHERE dept NOT IN ('Research', 'Legal')

Group of answer choices
 
Flag question: Question 10
Question 10 25 pts
0 essay_question   2836955

Given The following schema for a movie database

moviedb.png

 

Formulate SQL statement to output the following:

  1.  List the title of movies released in the year 2023 with the total number of actors featured in that movie, sorted alphabetically by the title of the movie
  2. For each category name list the number of movies released in the year 2023 and the total revenue generated by those movies, sorted alphabetically by category name
  3. List all the actors that acted in movies released in 2022 that featured the actor Tom Cruise
  4. List all the movies that were filmed in more than 3 locations between the years 2010 and 2020.
  5. List all the movies released in 2023 that had a revenue less than the cost, including the amount of loss, sorted by loss largest to smallest. 
p1
Saving...
You have been logged out of canvas.
To continue please log in