Complete the code to select all columns from the employees table.
SELECT [1] FROM employees;The asterisk (*) selects all columns from the table.
Complete the code to join the orders table with customers on customer_id.
SELECT orders.order_id, customers.name FROM orders JOIN customers ON orders.[1] = customers.customer_id;We join on the customer_id column which links orders to customers.
Fix the error in the join condition to correctly link products and categories.
SELECT products.name, categories.name FROM products JOIN categories ON products.[1] = categories.id;The products table has a category_id column that links to categories.id.
Fill both blanks to create a query that finds all orders with their customer's name.
SELECT orders.order_id, customers.[1] FROM orders JOIN customers ON orders.[2] = customers.customer_id;
We select customers.name and join on orders.customer_id = customers.customer_id.
Fill all three blanks to select product names and their category names where category id is greater than 5.
SELECT products.[1], categories.[2] FROM products JOIN categories ON products.[3] = categories.id WHERE categories.id > 5;
We select products.name and categories.name, joining on products.category_id = categories.id.