SQL practice
Three SELECTs against a four-row employees table.
Table employees has id, name, dept, salary. Asha and Meera are Engineering. Meera has the highest salary.
What this tool does
SQL practice uses one table, employees, with four rows: Asha, Engineering, 900000; Rohan, Sales, 600000; Meera, Engineering, 1200000; Kabir, Finance, 700000. You write a single SELECT. The parser accepts SELECT columns FROM employees, then an optional WHERE with one comparison, an optional ORDER BY on one column with ASC or DESC, and an optional LIMIT. Columns are id, name, dept, and salary. Strings in WHERE use quotes, as in dept = 'Engineering'. There is no JOIN, no GROUP BY, and no subquery. A statement that does not match that shape returns the error that asks for that shape, rather than a guessed result.
How to use it
Pick a task, write the SELECT, and run it. The checker compares the name column, in order, with the expected list. Extra columns are fine if name is selected and the row order matches. SELECT * still has name. A right filter in the wrong order fails the task that asks for an order. The table does not change between tasks.
Worked example
Engineering names: SELECT name FROM employees WHERE dept = 'Engineering' returns Asha, Meera. Highest salary first: SELECT name FROM employees ORDER BY salary DESC returns Meera, Asha, Kabir, Rohan. Salary greater than 800000: SELECT name FROM employees WHERE salary > 800000 returns Asha, Meera. Meera is 1200000 and Asha is 900000, so both pass that filter. Rohan at 600000 and Kabir at 700000 do not. ORDER BY name instead of salary returns a different list, so the highest-first task fails even when every name is present. The jobs link on this page searches HiringBuddy for published roles matching “software”. An empty list means nothing published matched. It is not a comment on the wider market. A signed-in candidate can save the attempt on their profile. Saving is not an application, and it does not show the attempt to an employer. Employers see people who apply to their own jobs.
Questions
- Can I use JOIN or GROUP BY?
- No. The checker accepts one SELECT with an optional WHERE, ORDER BY, and LIMIT.
- Why did a correct filter fail?
- The ordered task cares about sequence. DESC on salary is required for highest first.
- Are these real salaries?
- No. They are four practice rows. They are not a market survey.