Saturday Questions: SQL from Zero Level
Today’s Saturday Questions are focused on SQL, the language used to ask clear questions from data stored in tables.
This edition starts from the absolute basics and moves step by step through selecting columns, filtering rows, sorting results, counting records, grouping data, joining tables, and writing a small subquery.
What you will learn
- SELECT and column selection
- WHERE filtering
- ORDER BY sorting
- COUNT and AVG aggregate functions
- GROUP BY, HAVING, JOIN, and subquery
Difficulty path
- Very simple: SELECT rows and columns
- Simple: WHERE and ORDER BY
- Medium: COUNT, AVG, GROUP BY, HAVING
- Hiring level: JOIN, LEFT JOIN, and subquery
Main idea
SQL is not just syntax. It is the skill of asking clear questions from structured data.
The basic SQL pattern
Most beginner SQL queries can be understood through this pattern:
SELECT column1, column2
FROM table_name
WHERE condition
ORDER BY column_name;
Questions included in this edition
- Show all students
- Show only names and cities
- Find students from Varanasi
- Find students scoring more than 80
- Sort students by marks
- Count total students
- Find average marks
- Count students city wise
- Find cities with more than one student
- Show student names with course names
- Show all students and their courses
- Find the topper using a subquery
Practice area
Use the embedded practice viewer below. First run the setup SQL inside each question, then write your final query and compare it with the reply.
How to attempt the challenge
- Read the table structure before writing the query.
- Start with
SELECT * FROM table_name;to see the data. - Add one clause at a time:
WHERE,ORDER BY,GROUP BY, orJOIN. - Use clear aliases for calculated columns.
- Check whether the question asks for rows, groups, or connected tables.
Why SQL matters in hiring
SQL questions are common in hiring tests because almost every business stores data in tables. A candidate who can filter, group, join, and summarize data can solve many real workplace problems.
These questions are designed to build confidence from the first query and slowly move toward practical interview-style SQL.