Use desktop for interactive SQL sandbox

Welcome to SQLBook [>_]

Your personal SQL playground—connect, query, and master databases on your terms.

SQLBook lets you practice SQL against your own MySQL, PostgreSQL, MariaDB, or Oracle instances. No sample databases, no artificial constraints—just real queries on real data.


Your challenge

Given this table

DROP TABLE IF EXISTS employees;
CREATE TABLE employees (
  id INT PRIMARY KEY,
  name VARCHAR(100),
  salary DECIMAL(10,2)
);
INSERT INTO employees VALUES
(1, 'Alice', 95000),
(2, 'Bob', 87000),
(3, 'Carol', 95000),
(4, 'Dave', 73000),
(5, 'Eve', 81000);


Find the second highest salary from employees table without using LIMIT or OFFSET.

Head over to SQL Editor to try it out.


Spoiler!!!

Solution is available here

SQL Output

Getting Started
1Switch to a SQL tab and select a database
2Write or paste your SQL in the editor
3Press Alt+Enter to run
Tip:Select text in the editor to run only that portion
SQL Challenge - The Second Highest Salary Updated 12/26/25, 4:23 AM
Notes SQL Tab-3
Alt+Enter to run