All Tools
SQL Practicev1.0 • Client-side SQLite
GOOD MORNING● Client-side WebAssembly

Practice SQL, build your skills.

Solve real-world queries, understand relational joins, and get better — one question at a time.

Question 1 of 15Basic Queries
easy

Show first name, last name, and gender of patients whose gender is 'M'.

SELECT first_name, last_name, gender
FROM patients
WHERE gender = 'M';
Result
Click Run Query or press Ctrl+Enter to execute and view results.
Comprehensive SQL Learning Guide

Master Relational Databases with Hands-On Practice

SQL (Structured Query Language) is the backbone of modern backend engineering, data science, and product analytics. While reading tutorials explains concepts, writing queries against real-world schemas is what builds intuition for interviews and production systems.

City General Hospital

Healthcare schema with patients, doctors, admissions, and provinces. Ideal for practicing date filters, multi-table joins, and patient frequency aggregations.

ShopStream E-Commerce

Retail schema modeling customers, products, categories, and order_items. Perfect for revenue calculations, customer retention tiers, and top-N product analysis.

Tech Valley University

Academic records with professors, students, courses, and enrollments. Focuses on GPAs, major groupings, credits summation, and grade filtering.

GlobalTech Corp HR

Enterprise staffing schema with employees, departments, projects, and assignments. Classic for self-joins (manager vs employee) and department budget tiers.

BeatWave Music

Audio streaming data with artists, albums, tracks, and playlists. Great for stream count ranking, playlist inclusion, and duration formatting.

Master Freestyle Sandbox

Cross-database sandbox combining all 25 tables. Write arbitrary SQL queries, inspect table structures, run complex joins across industries, and export results directly.

Key SQL Concepts Covered in the Exercises

1. Basic Selection & Filters

Writing clean SELECT column lists, filtering with WHERE, pattern matching with LIKE, range queries with BETWEEN, and handling missing data with IS NULL.

2. Sorting & Pagination

Ordering results using ORDER BY ... ASC/DESC, limiting outputs with LIMIT, and selecting unique values via DISTINCT.

3. Aggregation & Grouping

Computing totals and metrics with COUNT(*), SUM(), AVG(), MAX(), and MIN() grouped by dimensions via GROUP BY and filtered with HAVING.

4. Multi-Table Relational Joins

Connecting data across tables using INNER JOIN and LEFT JOIN, chaining 3+ tables together, and performing self-joins to resolve organizational hierarchies.

5. Subqueries & Nested Queries

Writing scalar subqueries, list subqueries with IN and NOT IN, existence checks with EXISTS, and correlated subqueries referencing parent rows.

6. Conditional Logic (CASE WHEN)

Categorizing data dynamically using CASE WHEN ... THEN ... ELSE ... END to create VIP tiers, health categories, or custom rankings directly in query projections.

Frequently Asked Questions

How does the in-browser execution work?

This tool runs SQLite compiled to WebAssembly (WASM) via sql.js. When you load a database, the tables and seed records are instantiated directly in your browser memory. Queries execute in milliseconds with zero server latency.

Is this good preparation for technical SQL interviews?

Yes. The 75+ challenges were specifically designed around real questions asked in software engineering, data engineering, and business analyst technical screens (e.g. at FAANG, startups, and consulting firms). Each question tests precise relational thinking without boilerplate.

What if my query produces the right answer with a different syntax?

The engine evaluates the result set (rows and columns) rather than strict string matching. As long as your query produces the requested column names, correct row counts, and matching data values, it will be marked correct regardless of whether you used uppercase or lowercase keywords.

Built by Vishal Kumar. Free for engineers & students worldwide.