Customers Without Orders
Find all customers who have never placed an order. Return columns: id, name, email.
Work through 90 intermediate SQL exercises in a structured sequence. Each challenge includes a clear problem, schema context and an interactive query editor.
Find all customers who have never placed an order. Return columns: id, name, email.
Show all departments and their employee count, including departments with no employees. Return columns: employee_count, department_name. Order results by: d.id.
Show each department name, employee count, and total payroll. Return columns: total_payroll, employee_count, department_name. Order results by: d.id.
Find departments where the average salary is greater than 75,000. Return columns: avg_salary, department_id. Order results by: department_id.
List each employee's full name alongside their department name. Use INNER JOIN. Return columns: last_name, first_name, department_name.
Extract the portion of each employee email before the @ symbol. Return columns: email, username. Order results by: id.
Create a full_name column by concatenating first_name and last_name with a space between them. Return columns: email, full_name.
Count how many employees were hired in each year, ordered by year ascending. Return columns: hire_year, employee_count. Order results by: hire_year ASC.
List each managed employee together with their manager's name. Return columns: manager, employee. Order results by: e.id.
Find employees whose salary is higher than the average salary of their department. Return columns: salary, last_name, first_name, department_id.
Calculate inventory value for products with fewer than 200 units. Return columns: name, price, stock, inventory_value. Order results by: inventory_value DESC.
Calculate completed-order revenue for each month. Return columns: month, revenue. Order results by: month.
Show the order count and total amount for each status. Return columns: status, order_count, total_amount. Order results by: status.
Find orders whose total amount is greater than the average order value. Return columns: id, customer_id, total_amount. Order results by: total_amount DESC.
Show every product and its revenue, using zero when it has no sales. Return columns: revenue, product_name. Order results by: p.id.
For each product, show the total quantity sold and total revenue from order_items. Include product name. Return columns: product_name, total_revenue, total_quantity. Order results by: total_revenue DESC.
Find customers who placed more than one order. Return columns: order_count, customer_name. Order results by: order_count DESC, customer_name.
Calculate total revenue (sum of total_amount) per customer, showing customer name and total revenue, sorted by revenue descending. Return columns: customer_name, total_revenue. Order results by: total_revenue DESC.
Find employees in department 1 earning at least 80000. Return columns: salary, last_name, first_name. Order results by: salary DESC, id.
Find employees in department 1 earning at least 90000. Return columns: salary, last_name, first_name. Order results by: salary DESC, id.
Find employees in department 2 earning at least 60000. Return columns: salary, last_name, first_name. Order results by: salary DESC, id.
Find employees in department 2 earning at least 70000. Return columns: salary, last_name, first_name. Order results by: salary DESC, id.
Find employees in department 3 earning at least 65000. Return columns: salary, last_name, first_name. Order results by: salary DESC, id.
Find employees in department 3 earning at least 70000. Return columns: salary, last_name, first_name. Order results by: salary DESC, id.
Find employees in department 4 earning at least 50000. Return columns: salary, last_name, first_name. Order results by: salary DESC, id.
Find employees in department 5 earning at least 90000. Return columns: salary, last_name, first_name. Order results by: salary DESC, id.
Find employees whose first name starts with A. Return columns: email, last_name, first_name. Order results by: first_name.
Find employees whose first name starts with B. Return columns: email, last_name, first_name. Order results by: first_name.
Find employees whose first name starts with C. Return columns: email, last_name, first_name. Order results by: first_name.
Find employees whose first name starts with D. Return columns: email, last_name, first_name. Order results by: first_name.
Find employees whose first name starts with E. Return columns: email, last_name, first_name. Order results by: first_name.
Find employees whose first name starts with F. Return columns: email, last_name, first_name. Order results by: first_name.
Find employees whose first name starts with G. Return columns: email, last_name, first_name. Order results by: first_name.
Find employees whose first name starts with H. Return columns: email, last_name, first_name. Order results by: first_name.
Find employee full names containing the letter a, case-insensitively. Return columns: last_name, first_name. Order results by: first_name.
Find employee full names containing the letter b, case-insensitively. Return columns: last_name, first_name. Order results by: first_name.
Find employee full names containing the letter c, case-insensitively. Return columns: last_name, first_name. Order results by: first_name.
Find employee full names containing the letter d, case-insensitively. Return columns: last_name, first_name. Order results by: first_name.
Find employee full names containing the letter e, case-insensitively. Return columns: last_name, first_name. Order results by: first_name.
Find employee full names containing the letter i, case-insensitively. Return columns: last_name, first_name. Order results by: first_name.
Find employee full names containing the letter l, case-insensitively. Return columns: last_name, first_name. Order results by: first_name.
Find employee full names containing the letter o, case-insensitively. Return columns: last_name, first_name. Order results by: first_name.
Return the 1 highest-paid employees. Return columns: salary, last_name, first_name. Order results by: salary DESC, id.
Return the 2 highest-paid employees. Return columns: salary, last_name, first_name. Order results by: salary DESC, id.
Return the 3 highest-paid employees. Return columns: salary, last_name, first_name. Order results by: salary DESC, id.
Return the 4 highest-paid employees. Return columns: salary, last_name, first_name. Order results by: salary DESC, id.
Return the 5 highest-paid employees. Return columns: salary, last_name, first_name. Order results by: salary DESC, id.
Return the 6 highest-paid employees. Return columns: salary, last_name, first_name. Order results by: salary DESC, id.
Return the 7 highest-paid employees. Return columns: salary, last_name, first_name. Order results by: salary DESC, id.
Return the 8 highest-paid employees. Return columns: salary, last_name, first_name. Order results by: salary DESC, id.
Return two employees from salary ranking page 1. Return columns: salary, last_name, first_name. Order results by: salary DESC, id.
Return two employees from salary ranking page 2. Return columns: salary, last_name, first_name. Order results by: salary DESC, id.
Return two employees from salary ranking page 3. Return columns: salary, last_name, first_name. Order results by: salary DESC, id.
Return two employees from salary ranking page 4. Return columns: salary, last_name, first_name. Order results by: salary DESC, id.
Return two employees from salary ranking page 5. Return columns: salary, last_name, first_name. Order results by: salary DESC, id.
Return two employees from salary ranking page 6. Return columns: salary, last_name, first_name. Order results by: salary DESC, id.
Return two employees from salary ranking page 7. Return columns: salary, last_name, first_name. Order results by: salary DESC, id.
Return two employees from salary ranking page 8. Return columns: salary, last_name, first_name. Order results by: salary DESC, id.
List products priced above 50, most expensive first. Return columns: name, price, category. Order results by: price DESC, id.
List products priced above 100, most expensive first. Return columns: name, price, category. Order results by: price DESC, id.
Showing the first 60 of 90 challenges in this learning path.
Browse and filter all challenges in the Practice Arena