Anvil Career
Back to Blog
SKILLS BENCHMARKING

SQL Is the Most Tested and Least Practiced Placement Skill in India. Here Is Exactly What You Need to Know to Pass Every Technical Screening.

13 min read

There is a question that appears in approximately 70% of technical interviews for backend and full-stack roles at Indian startups and product companies. The interviewer opens a shared editor, types a simple schema — a students table, a courses table, and an enrollments table — and says: "Write a query to find the names of students enrolled in more than three courses." This question has filtered out more tier-3 candidates than every LeetCode hard problem combined. It requires a JOIN, a GROUP BY, a HAVING clause, and an understanding of aggregate functions. It is not a difficult query. It is a query that any developer who has built a real application with a relational database has written dozens of times. And yet, in placement season mock interviews across our partner colleges, fewer than 25% of candidates can write it correctly on the first attempt.

WHY SQL IS THE ULTIMATE TECHNICAL FILTER

SQL sits at the intersection of two evaluation criteria that interviewers care about deeply: does the candidate understand data modeling (the schema they query against reflects how they think about data relationships), and can the candidate translate a business question into a correct technical answer (the query is the proof that they can take "find students with more than three enrollments" and produce the right rows)? A candidate who cannot write JOINs and GROUP BYs has demonstrated, in 90 seconds, that they have never worked with a production database. No amount of React knowledge or LeetCode proficiency compensates for this gap because the gap reveals a structural absence in their technical preparation, not a specific knowledge deficiency.

The SQL Proficiency Levels: Where You Are vs. Where You Need to Be

Interviewers categorize SQL skills into four levels, and they make the categorization decision within the first two queries you write. Understanding where the bar is set for your target role determines how much SQL preparation you need.

Level 0: No SQL. "I have only used MongoDB / Firebase." This is an automatic rejection for any role that lists SQL or relational databases in the job description. There is no way to talk your way past this. If you have zero SQL experience, stop reading this article and spend the next three days completing a basic SQL tutorial (SQLZoo, Mode Analytics SQL tutorial, or PostgreSQL's official tutorial) before you apply to another job.

Level 1: Basic CRUD. You can write SELECT, INSERT, UPDATE, DELETE. You can use WHERE clauses. This is the level of someone who completed a tutorial but has not built a real application. This level fails most technical screenings because interviewers ask for JOINs and aggregation, not single-table SELECTs.

Level 2: JOINs and Aggregation. You can write INNER JOIN, LEFT JOIN, GROUP BY, HAVING, ORDER BY, and LIMIT. You understand the difference between WHERE (filters rows before aggregation) and HAVING (filters groups after aggregation). This is the minimum level to pass the SQL portion of most entry-level technical interviews. If you can write the "students with more than three enrollments" query from memory, you are at Level 2.

Level 3: Window Functions and Subqueries. You can write ROW_NUMBER(), RANK(), LAG(), LEAD(), and PARTITION BY. You can write correlated subqueries and CTEs (WITH clauses). This level is tested at product companies and for roles that involve analytics or reporting. It is also the level that separates candidates who get offers from candidates who get "we will let you know."

Level 4: Query Optimization. You can read an EXPLAIN plan. You understand when an index will be used and when a sequential scan will occur. You can identify N+1 query problems and rewrite queries to eliminate them. This level is not expected of entry-level candidates, but demonstrating it — even partially — is a strong signal that gets noticed.

SQL Proficiency Levels and What They Enable in Technical Interviews SQL PROFICIENCY LEVELS — WHAT EACH LEVEL ENABLES IN INTERVIEWS LEVEL 0: No SQL — Auto-reject for any role listing SQL/relational DB. Fix this before applying anywhere. Time to fix: 3 days (SQLZoo tutorial + basic exercises). LEVEL 1: Basic CRUD — Fails most technical screenings. Interviewers do not test single-table SELECTs. Time to reach Level 2: 1 week (daily JOIN + GROUP BY practice on real database). LEVEL 2: JOINs + Aggregation — MINIMUM TO PASS entry-level technical screenings. This is where most service company SQL questions stop. Practice: INNER/LEFT JOIN, GROUP BY, HAVING, COUNT/SUM/AVG. LEVEL 3: Window Functions + CTEs — SEPARATES OFFERS FROM REJECTIONS at product companies. ROW_NUMBER, RANK, LAG, LEAD, PARTITION BY, WITH clauses. 2 weeks of focused practice. LEVEL 4: Query Optimization — Bonus signal. Not expected of entry-level, but strongly noticed. EXPLAIN ANALYZE, index strategy, N+1 detection. Learn after you have a deployed project with real data.

The 10 SQL Queries You Must Be Able to Write From Memory

These ten query patterns cover the SQL that is tested in entry-level technical interviews. If you can write all ten from memory without looking up syntax, you will pass the SQL portion of any service company or startup technical screening. Practice them on a real database, not on paper. Install PostgreSQL, create the tables, insert sample data, and run each query until it returns the correct results.

Query 1: SELECT with WHERE, ORDER BY, and LIMIT. Query 2: INNER JOIN across two tables. Query 3: LEFT JOIN to include rows with no match. Query 4: GROUP BY with COUNT and HAVING (the "more than three" pattern). Query 5: GROUP BY with multiple aggregate functions (COUNT, AVG, MAX, MIN) on the same group. Query 6: Subquery in WHERE clause (find rows where a value is greater than the average). Query 7: ROW_NUMBER() with PARTITION BY (rank items within each category). Query 8: LAG() or LEAD() to compare a row with the previous or next row. Query 9: CTE (WITH clause) that defines a temporary result set and queries it. Query 10: Multi-table JOIN (three or more tables) with filtering and aggregation.

THE EXACT SQL QUESTIONS INTERVIEWERS ASK — PATTERN BY PATTERN

INTERVIEWER'S QUESTION WHAT THEY ARE TESTING THE QUERY PATTERN
"Find students enrolled in more than 3 courses." JOIN + GROUP BY + HAVING. The most common filter question. SELECT s.name, COUNT(e.course_id) FROM students s JOIN enrollments e ON s.id = e.student_id GROUP BY s.id, s.name HAVING COUNT(e.course_id) > 3;
"Find the second highest salary in each department." Window functions (ROW_NUMBER or RANK). Tests Level 3 proficiency. SELECT * FROM (SELECT *, ROW_NUMBER() OVER (PARTITION BY dept_id ORDER BY salary DESC) as rn FROM employees) WHERE rn = 2;
"Compare each month's revenue with the previous month." LAG window function. Tests awareness of time-series patterns. SELECT month, revenue, LAG(revenue) OVER (ORDER BY month) as prev_month_revenue FROM monthly_sales;
THE SQL SHORTCUT THAT WORKS

Install PostgreSQL on your machine right now. Create three tables that model a real domain (students, courses, enrollments — or users, orders, products — or employees, departments, salaries). Insert at least 50 rows of sample data into each table. Write the 10 queries above against your own data. The difference between "I studied SQL from a tutorial" and "I can write SQL queries against a real database" is exactly this exercise. It takes three hours. It is the highest-ROI three hours you can spend on placement preparation because SQL is tested in every backend, data, and full-stack interview, and most candidates prepare for it by reading syntax rather than writing queries. Be the candidate who wrote the queries.