Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1ON orders.customer_id = customers.customer_id | AFROM orders JOIN customers ON orders.customer_id = customers.customer_id | |
| 2orders.customer_id = customers.customer_id | BON orders.customer_id = customers.customer_id | |
| 3The foreign key is in the orders table, so it is written on one side of the = and the primary key from customers goes on the other. | CSQL uses a single = to compare values in an ON condition. A double == is not valid SQL, so it must be ON orders.customer_id = customers.customer_id. | |
| 4A complete join names both tables and then links them by comparing the foreign key with the primary key. | DMatches each order row to the customer row whose customer_id is the same, linking the foreign key to the primary key. | |
| 5ON orders.order_id = customers.customer_id | EThis compares the orders primary key with the customers primary key. It should compare the foreign key orders.customer_id with customers.customer_id. | |
| 6ON orders.customer_id == customers.customer_id | FThe = sign compares the two values to check if they are equal. It does not store or assign a value. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
ON orders.customer_id = customers.customer_id — The join condition: it matches the foreign key in one table to the primary key in the other. The = sign compares the two values to find matching rows. It does not assign a value.SELECT * FROM orders JOIN customers
ON orders.customer_id =
customers.customer_idSELECT * FROM orders JOIN customers
ON orders.customer_id =
customers.customer_idSELECT * FROM orders JOIN customers
ON orders.customer_id =
customers.customer_idSELECT * FROM results JOIN students
ON results.studentId =
students.studentIdSELECT * FROM customers JOIN orders
ON customers.customer_id =
orders.customer_id