← Back to Practice Arena
● SAFE IN-MEMORY DB (ISOLATED)
RELATIONAL DATA // SCHEMA VERIFICATION
SQL Practice Sandbox
Real technical interview SQL questions. Study schemas, write queries, and verify output against expected results without risk to production databases.
ISOLATED IN-MEMORY SANDBOX // NO PRODUCTION IMPACT
Aggregations & Subquerieseasy
Find the Second Highest Salary
Write a SQL query to report the second highest distinct salary from the Employee table. If there is no second highest salary, return null.
DATABASE SCHEMAS
Employee
5 rowsid(INT)
name(VARCHAR(50))
salary(INT)
department_id(INT)
| id | name | salary | department_id |
|---|---|---|---|
| 1 | Alice | 95000 | 1 |
| 2 | Bob | 110000 | 1 |
| 3 | Charlie | 85000 | 2 |
EXPECTED RESULT TABLE
| SecondHighestSalary |
|---|
| 95000 |