Super Hard 10 - SQL Practice Online

SQL Practice
Advertisement Responsive Ad Unit (Expands to fit width)

Critical Care Readmission Analysis

The hospital wants to identify high-risk patients who were readmitted within 30 days. Find patients who had multiple admissions where the time between discharge and next admission was 30 days or less. Show: - Patient first and last name - Number of readmissions - Total admission cost across all visits - Most frequent diagnosis Order by total cost descending. Hint: Use self-joins on admissions table with date calculations.
Hard
Editor
Query Result

Run your query to see results

Entity Relationship Diagram

Database Schema Diagram

Frequently Asked Questions

Everything about SQL Practice

Is SQL Practice completely free?
Yes — 100% free. No sign-up, no credit card. Open the editor and start writing SQL instantly.
What SQL dialect does the compiler use?
SQLite for most sets (covers SELECT, JOINs, CTEs, window functions). The Hospital dataset also supports PostgreSQL.
Are these real interview questions?
Yes — curated from real interview rounds at TCS, Infosys, and Deloitte (2026). Ranges from Easy basics to Hard window functions & CTEs.
How does the auto-grader work?
Your query output is compared with the expected result. A green ✓ means correct — plus you always get the reference SQL solution.
Can I try different schemas?
Yes! Use the schema selector in the header or switch to Playground mode to explore Hospital, E-Commerce, Employees and more.
Free forever · No login required