Complete the code to join two tables where the employee's salary is greater than the department's budget.
SELECT e.name, d.department_name FROM employees e JOIN departments d ON e.salary [1] d.budget;The query joins employees and departments where the employee's salary is greater than the department's budget, so the operator should be >.
Complete the code to join orders and shipments where the shipment date is on or after the order date.
SELECT o.order_id, s.shipment_date FROM orders o JOIN shipments s ON s.shipment_date [1] o.order_date;The join condition requires shipment dates to be on or after order dates, so the operator should be >=.
Fix the error in the join condition to correctly join products and discounts where the discount start date is before the product release date.
SELECT p.product_name, d.discount_rate FROM products p JOIN discounts d ON d.start_date [1] p.release_date;The discount start date should be before the product release date, so the operator should be <.
Fill both blanks to join employees and projects where the employee's experience is between the project's minimum and maximum experience requirements.
SELECT e.name, p.project_name FROM employees e JOIN projects p ON e.experience [1] p.min_experience AND e.experience [2] p.max_experience;
The employee's experience should be greater than or equal to the minimum and less than or equal to the maximum experience required by the project.
Fill all three blanks to join sales and targets where the sale amount is greater than the target minimum, less than the target maximum, and the sale date is on or after the target start date.
SELECT s.sale_id, t.target_name FROM sales s JOIN targets t ON s.amount [1] t.min_amount AND s.amount [2] t.max_amount AND s.sale_date [3] t.start_date;
The sale amount should be greater than the minimum and less than the maximum target amounts, and the sale date should be on or after the target start date.