Create a SQL interview preparation set for a [JUNIOR / MID / SENIOR] data role.
Database: [POSTGRESQL / MYSQL / SQL SERVER]
Provide 20 questions in increasing difficulty:
**Easy (5 questions)**: Basic SELECT, WHERE, JOIN, GROUP BY, ORDER BY
**Medium (8 questions)**: Subqueries, window functions, CASE statements, CTEs, self-joins
**Hard (5 questions)**: Complex aggregations, recursive CTEs, pivoting, performance optimization
**Brain Teasers (2 questions)**: Tricky logic problems solved with SQL
For each question:
- Business scenario and question
- Sample table structure with data
- Expected output
- Complete SQL solution with explanation
- Common mistakes candidates make
- Follow-up question the interviewer might ask
Create a SQL interview preparation set for a [JUNIOR / MID / SENIOR] data role.
Database: [POSTGRESQL / MYSQL / SQL SERVER]
Provide 20 questions in increasing difficulty:
**Easy (5 questions)**: Basic SELECT, WHERE, JOIN, GROUP BY, ORDER BY
**Medium (8 questions)**: Subqueries, window functions, CASE statements, CTEs, self-joins
**Hard (5 questions)**: Complex aggregations, recursive CTEs, pivoting, performance optimization
**Brain Teasers (2 questions)**: Tricky logic problems solved with SQL
For each question:
- Business scenario and question
- Sample table structure with data
- Expected output
- Complete SQL solution with explanation
- Common mistakes candidates make
- Follow-up question the interviewer might ask
How to use this prompt
Copy the prompt above and paste it into ChatGPT, Claude, Gemini, or any AI assistant. Replace the bracketed placeholders with your specific details.
Leave a Review
Tried this prompt? Let us know how it worked — your reviews help other users find the best prompts.