Module 7.5.2 Quiz - Introduction to Structured Queries Answers
1. Which two SQL statements are used to create and change a database schema? (Choose two.)
- ALTER
- CREATE
- DELETE
- INSERT
- SELECT
2. Refer to the exhibit. You need to get information about customer purchases that is stored in the two tables. You would like to see data from the OrderID, CustomerName, OrderAmount, and OrderDate columns. To obtain this information, how would you complete the following partial SQL query?

SELECT Orders.OrderID, Customers.CustomerName, Orders.OrderAmount, Orders.OrderDate
FROM Orders
INNER JOIN _______ ON _____________ = _____________;
- INNER JOIN Orders ON Orders.OrderID=Orders.CustomerID;
- INNER JOIN Customers ON Customer.CustomerID=Customers.CustomerID;
- INNER JOIN Orders ON Orders.CustomerID=Customers.CustomerID;
- INNER JOIN Customers ON Orders.CustomerID=Customers.CustomerID;
3. In combination with primary and foreign keys, which SQL statement is the most common method for joining fields from multiple tables?
- BETWEEN
- LIKE
- JOIN
- WHERE
4. Refer to the exhibit. Which type of SQL JOIN operation would return all the rows from Table 1 and Table 2?

- LEFT JOIN
- RIGHT JOIN
- FULL JOIN
- INNER JOIN
5. Which JOIN clause would join the two tables Orders and Customers, using the CustomerID field in both tables as the relationship between the two tables?
SELECT *
FROM Orders
LEFT JOIN Customers ON ____________ = ______________;
- ON Customers.CustomerID=Orders.CustomerID
- ON Orders.CustomerID=Customers.CustomerID
- ON Orders.CustomerID=Orders.CustomerID
- ON Customers.CustomerID=Customers.CustomerID
6. Which type of key uniquely defines each table row in a relational database?
- foreign key
- primary key
- principal key
- JOIN key
7. What is the function of a foreign key in a relational database table?
- to define a relationship with a primary key in a different table
- to uniquely identify a row within the table
- to create a many-to-one relationship within the table
- to add additional unique columns to the data table
8. Review the columns and descriptions in each table, Movie, and Award. Data from the two tables need to be combined to extract the title and cost of movies that won awards. Can a NATURAL JOIN be used to accomplish the desired result?
Movie table:
MovieID- primary key
Title- name of the movie
Date- date the movie was released
Cost- total cost of production
Award table:
AwardID- primary key
MovieID- foreign key
Category- award category
Name- name of the award
Date: day the award was received
- Yes, because both tables have two common columns.
- Yes, because both tables have the MovieID column.
- No, because the Date column contains different data types in each table.
- No, because an OUTER JOIN should be used to extract all of the information.
9. What is the result of the query shown in the example?
UPDATE Review
SET Comment = 'This is the new comment'
WHERE MovieId = 3456 AND AuthorName = 'PuzoFan76';
- The comment made by PuzoFan76 for the movie with the ID 3456 will be modified to say, “This is a new comment.”
- A new comment will be added to the movie with the ID 3456 for the author PuzoFan76.
- All of the comments for the movie with the ID 3456 will be modified to say, “This is a new comment.”
- A new row will be added to the table Review with the MovieId= 3456 and the AuthorName =PuzoFan76.
10. What are two types of data that benefit from NoSQL data storage? (Choose two.)
- data with flexible formats that can change over time
- high volumes of unstructured data
- data easily organized in tables of columns and rows
- data that conforms to a structured schema
- form data requiring input validation
