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 orders with customers on customer_id.
SELECT orders.id, customers.name FROM orders [1] customers ON orders.customer_id = customers.id;INNER JOIN returns only orders that have a matching customer.
Fix the error in the INNER JOIN syntax to correctly join products and categories.
SELECT products.name, categories.name FROM products [1] categories ON products.category_id = categories.id;The INNER JOIN must be followed by ON to specify the join condition.
Fill both blanks to join sales and stores on store_id and select sale amount and store name.
SELECT sales.amount, stores.[1] FROM sales [2] stores ON sales.store_id = stores.id;
We select the name column from stores and use INNER JOIN to combine matching rows.
Fill all three blanks to join employees and salaries on employee_id and select employee name, salary, and department.
SELECT employees.[1], salaries.[2], employees.[3] FROM employees INNER JOIN salaries ON employees.id = salaries.employee_id;
We select name and department from employees, salary from salaries, and use INNER JOIN to combine matching rows.