Complete the code to select all columns from two tables using INNER JOIN.
SELECT * FROM employees [1] departments ON employees.department_id = departments.id;The INNER JOIN keyword selects records that have matching values in both tables.
Complete the code to join tables employees and salaries on employee_id.
SELECT employees.name, salaries.amount FROM employees [1] salaries ON employees.id = salaries.employee_id;Use INNER JOIN to get matching employee names and their salaries by joining on employee ID.
Fix the error in the INNER JOIN syntax to correctly join customers and orders on customer_id.
SELECT customers.name, orders.order_date FROM customers [1] orders ON customers.id = orders.customer_id;The correct syntax requires INNER JOIN followed by the table and ON for the join condition.
Fill both blanks to join products and categories on category_id and select product name and category name.
SELECT products.name, categories.[1] FROM products [2] categories ON products.category_id = categories.id;
We select category_name from categories and use INNER JOIN to join on category_id.
Fill all three blanks to join orders, customers, and payments to select order id, customer name, and payment amount.
SELECT orders.id, customers.[1], payments.[2] FROM orders [3] customers ON orders.customer_id = customers.id INNER JOIN payments ON orders.id = payments.order_id;
Select customer name and payment amount. Use INNER JOIN to join orders and customers.