Which top SQL coding interview questions should you practise before an internship or entry level job interview?
Start with SELECT and WHERE, then prioritise COUNT, AVG, MAX, DISTINCT, ORDER BY, LIMIT, INSERT, UPDATE, DELETE and JOIN because these top picks cover the SQL skills most likely to be tested.
At a glance
- Learn how to retrieve selected columns, narrow rows, remove duplicates and organise query results.
- Practise aggregate functions such as COUNT, AVG and MAX so you can summarise a table confidently.
- Understand how INSERT, UPDATE and DELETE change data, including the risks of missing conditions.
- Prepare JOIN queries because real interview tasks often require data from related tables.
- Explain your reasoning aloud instead of memorising queries without understanding them.
How the core SQL tasks compare
SQL interview exercises are often presented as small business problems. You might be asked to display employee names, calculate an average salary or connect employees with their departments. The table below shows what each task measures and where candidates commonly go wrong.
| SQL task | What it tests | Best suited to | Common limit or mistake |
|---|---|---|---|
| SELECT | Choosing data to retrieve | Complete beginners | Returning unnecessary columns |
| WHERE | Applying conditions | Freshers and interns | Using the wrong comparison |
| DISTINCT | Removing duplicate result values | Reporting tasks | Assuming it changes stored data |
| ORDER BY | Sorting output | Reporting and analysis roles | Confusing ascending and descending order |
| LIMIT | Restricting output size | Data exploration tasks | Using syntax unsupported by the chosen database |
| COUNT, AVG and MAX | Summarising records | Analyst and developer candidates | Handling null values incorrectly |
| INSERT, UPDATE and DELETE | Changing stored data | Application and database roles | Modifying more rows than intended |
| JOIN | Combining related tables | Most technical candidates | Using an incorrect join condition |
Retrieving and shaping query results
These foundational questions are especially important if you are preparing basic answers as a fresher. Interviewers usually care about both correct syntax and whether you understand the result that the database will return.
Choose the required columns with SELECT
What it is: SELECT retrieves data from a table. A common prompt is, “Write a query to select the employee name and salary from the employees table.”
SELECT employee_name, salary FROM employees;
This query retrieves only the requested columns. Although an asterisk can retrieve every column, naming the columns is usually clearer and can avoid transferring data the application does not need.
Who it suits: This is essential for students, freshers and anyone facing a first technical internship interview.
Pros: SELECT is easy to read, forms the basis of almost every retrieval query and can be combined with conditions, sorting, grouping and joins.
Limits: SELECT alone does not narrow the rows or guarantee any particular order. A correct query may still be incomplete if the interviewer asked for a specific group or sequence.
Narrow the result set to relevant rows
What it is: The WHERE keyword applies a condition before rows are returned. For example, an interviewer may ask you to retrieve employees who belong to a particular department.
SELECT employee_name, salary FROM employees WHERE department_name = :department_name;
The named placeholder represents a value supplied safely by the application or interview environment. You can also use comparison operators, BETWEEN, IN, LIKE, IS NULL and logical operators such as AND and OR.
Who it suits: WHERE questions suit every SQL candidate because conditions appear in retrieval, update and deletion tasks.
Pros: It lets you answer precise business questions and avoid processing irrelevant rows.
Limits: Conditions involving null values need special care. A comparison using an equality operator does not test for null. Use IS NULL or IS NOT NULL instead. Complex combinations of AND and OR may also require parentheses to make the intended logic clear.
Return unique values with DISTINCT
What it is: DISTINCT is the statement option used to retrieve unique combinations of selected values. A common task is to display the different department names found in an employees table.
SELECT DISTINCT department_name FROM employees;
If several employees have the same department name, that department appears once in the result. When multiple columns follow DISTINCT, SQL evaluates the combination of those columns.
Who it suits: It is useful for reporting, data analysis and basic database interview tasks.
Pros: DISTINCT can quickly clean duplicate values from query output and make summary lists easier to read.
Limits: It does not delete duplicates from the underlying table. It can also hide a flawed join that accidentally created duplicate rows, so candidates should understand why duplicates appeared before using it as a quick fix.
Arrange rows with ORDER BY
What it is: ORDER BY sorts the returned records. An interviewer might ask you to list employees from the highest salary to the lowest salary.
SELECT employee_name, salary FROM employees ORDER BY salary DESC;
DESC requests descending order, while ASC requests ascending order. Ascending order is commonly the default, but writing it explicitly can make your intention clearer.
Who it suits: Sorting questions are relevant to software, reporting, business intelligence and data internships.
Pros: ORDER BY makes results predictable and readable. It can sort by more than one column when values in the first column are equal.
Limits: Sorting may require additional database work for large result sets. You should also avoid assuming that rows have a stable order when ORDER BY is absent.
Keep the output manageable with LIMIT
What it is: LIMIT restricts the number of records returned by a query. A prompt could ask for the employees with the highest salaries while returning only the required number of rows.
SELECT employee_name, salary FROM employees ORDER BY salary DESC LIMIT :row_limit;
Who it suits: LIMIT is useful for candidates working with application pages, previews, rankings and exploratory analysis.
Pros: It keeps a result set manageable and works naturally with ORDER BY when you need the highest or lowest values.
Limits: LIMIT is not written in exactly the same way across every database system. Some systems use FETCH or another approach. It can also produce inconsistent selections if no ORDER BY condition defines which rows should come first.
Summarising a table with aggregate functions
Count the records in a table
What it is: COUNT calculates how many records or non null values match a query. To count every row in the employees table, you can write:
SELECT COUNT(*) AS employee_count FROM employees;
To count employees within a selected department, add an appropriate WHERE condition. An interviewer may also ask how COUNT(*) differs from COUNT(column_name). COUNT(*) counts matching rows, while COUNT(column_name) ignores null values in that column.
Who it suits: COUNT is a core question for freshers and appears frequently in analyst, developer and IT intern interview questions.
Pros: It provides a simple summary and works well with WHERE and GROUP BY.
Limits: A join can multiply rows and produce a larger count than expected. Before answering, identify what one row represents in the final result.
Calculate the average salary
What it is: AVG calculates the average of the non null numeric values in a column. A direct answer to “Write a query to find the average salary” is:
SELECT AVG(salary) AS average_salary FROM employees;
If the question asks for an average within each department, select the department column and group the rows by that column.
SELECT department_name, AVG(salary) AS average_salary FROM employees GROUP BY department_name;
Who it suits: This question is especially relevant to data, finance, operations and reporting internships, but developers should know it too.
Pros: AVG converts many records into an understandable summary and combines well with grouping.
Limits: Null salaries are generally ignored rather than treated as zero. Extreme values can also influence the result, so an average does not always describe a typical employee.
Retrieve the maximum employee salary
What it is: MAX returns the largest non null value in a column.
SELECT MAX(salary) AS maximum_salary FROM employees;
This returns the salary value, not the employee who earns it. If the interviewer asks for the employee record associated with the highest salary, you need an additional step.
SELECT employee_name, salary FROM employees WHERE salary = (SELECT MAX(salary) FROM employees);
This version can return multiple employees if they share the maximum salary, which is often the fairest interpretation of the prompt.
Who it suits: MAX questions suit freshers as well as candidates preparing for more advanced subquery and ranking tasks.
Pros: The basic query is concise, and the expanded version tests whether you can distinguish an aggregate value from its related record.
Limits: MAX alone cannot return unrelated columns from the same row. A LIMIT based answer may return only one employee when several employees share the maximum value.
Changing data without creating avoidable mistakes
Data modification questions test more than syntax. A strong candidate explains how they would verify the target rows, use a transaction where appropriate and avoid changing production data carelessly.
Add a new row with INSERT
What it is: INSERT adds new records to a table. A clear approach names the destination columns and supplies matching values.
INSERT INTO employees (employee_name, department_name, salary) VALUES (:employee_name, :department_name, :salary);
Who it suits: INSERT is relevant to software development, database administration and any internship involving application data.
Pros: Naming columns makes the query easier to understand and less dependent on the physical order of columns in the table.
Limits: The new row must satisfy data types, required fields, uniqueness rules, reference rules and other constraints. Placeholder values also need to be passed securely by the application.
Change an existing row with UPDATE
What it is: UPDATE modifies values in records that meet a condition. For example, you could change the salary of a specific employee.
UPDATE employees SET salary = :new_salary WHERE employee_id = :employee_id;
A careful interview answer should mention checking the same WHERE condition with SELECT before executing the update. This confirms which records are likely to change.
Who it suits: UPDATE questions suit application developers, support engineers and database focused interns.
Pros: It can modify one record or many records efficiently.
Limits: Omitting WHERE may update every row. The operation can also fail because of constraints, permissions or conflicting transactions.
Remove selected rows with DELETE
What it is: DELETE removes records that meet a condition.
DELETE FROM employees WHERE employee_id = :employee_id;
Who it suits: DELETE is a basic requirement for candidates who may work with persistent application data.
Pros: It provides precise record removal when the condition identifies the intended rows.
Limits: A missing WHERE condition may remove every row in the table. Related records may prevent deletion or may also be removed, depending on the database design. In a real workplace, permissions, backups, retention requirements and transaction controls matter as much as syntax.
Combining related information with JOIN
Retrieve data from multiple tables
What it is: A JOIN connects rows through related columns. Suppose employee details are stored in an employees table and department names are stored in a departments table.
SELECT e.employee_name, d.department_name FROM employees AS e INNER JOIN departments AS d ON e.department_id = d.department_id;
The aliases make the query shorter while showing which table owns each column. INNER JOIN returns rows that have a match on both sides. A LEFT JOIN can retain every row from the left table even when a matching row is unavailable on the right.
Who it suits: JOIN questions are important for software, analytics, data engineering and SQL internships. They show whether you understand relationships rather than isolated tables.
Pros: Joins answer realistic questions without duplicating all information in one table. They also reveal whether a candidate can reason about table structure.
Limits: An incorrect join condition may create duplicate or misleading results. Missing matches, null values and one to many relationships must be considered before deciding whether the output is correct.
A practical routine for choosing what to practise
The right starting point depends on the role description and your current confidence. A fresher should first be able to explain SELECT, WHERE, ORDER BY and the aggregate functions in plain language. Once those feel comfortable, move to data modification, joins, grouping and subqueries.
If the internship focuses on application development, give extra attention to INSERT, UPDATE, DELETE, safe placeholders and transactions. If it focuses on analysis, spend more time on filtering, grouping, aggregate functions and joins. Database focused roles may expect deeper discussion of constraints, indexes, null values and execution performance.
Quick preparation checklist
- Read the prompt carefully and identify the requested columns, rows and order.
- State any assumptions about table names, relationships or duplicate values.
- Write the simplest correct query before attempting a more advanced version.
- Explain what the query returns, including how it handles nulls and ties.
- Check whether a modification query has a safe and specific condition.
- Practise with at least two related tables so JOIN logic feels natural.
- Review the SQL dialect named in the job description.
- Prepare to describe your reasoning aloud while writing the query.
A real life student example
Imagine a student applying for a data internship who knows individual SQL keywords but freezes when reading a longer prompt. Instead of memorising more isolated answers, the student breaks every task into four questions: What columns are needed? Which rows qualify? Does the result need grouping? How should it be ordered?
For a request to display each department with its average salary, the student identifies the department as the grouping column and salary as the aggregated column. That process leads naturally to SELECT, AVG and GROUP BY. The approach genuinely helps because it turns an unfamiliar sentence into a small sequence of decisions.
The same student can then practise realistic tasks while browsing sql internships and comparing the skills mentioned in role descriptions. The goal is not to apply immediately to every listing, but to notice which SQL abilities employers repeatedly request and shape practice around suitable opportunities.
How SQL fits into a wider internship interview
Technical interviews rarely consist only of database syntax. Common internship interview questions may also cover your projects, teamwork, problem solving, motivation and what you learned from a difficult task. A strong preparation plan combines SQL practice with concise examples from coursework, personal projects or volunteering.
For an IT internship interview, questions may move between SQL and broader topics such as APIs, debugging, networking or programming fundamentals. REST API interview questions might ask how an application sends data to a service, while SQL questions explore how that data is stored and retrieved. Explain the connection without pretending that API design and database querying are the same skill.
React coding interview questions and React coding challenges are relevant mainly when the role includes front end development. Java coding interview questions matter when Java appears in the job description. Apache Kafka interview questions are more likely for data engineering or distributed system roles. Prepare these areas based on the actual position rather than trying to master every technical topic at once.
You should also prepare useful questions to ask in an interview for an internship. You could ask what a typical project looks like, which database system the team uses, how interns receive feedback and what knowledge would help someone contribute early. These questions show genuine interest and help you decide whether the opportunity suits your learning goals.
Your questions answered
Are these SQL questions enough for a fresher interview?
It depends. They provide a strong foundation for basic internship interview questions, but some roles may also test GROUP BY, HAVING, subqueries, window functions, constraints and indexes. Read the role description and build outward from the fundamentals covered here.
Will SQL appear in every IT internship interview?
No. SQL is common in roles involving databases, analytics, backend systems and business reporting, but a front end or design role may not test it. Use the stated responsibilities and required skills to guide your preparation.
Should I memorise SQL interview answers exactly?
No. Memorised syntax can help you start, but interviewers may change the table names, conditions or desired output. Understanding how each clause affects the result makes it easier to adapt.
Can I use LIMIT in every SQL database?
No. Database systems do not all use identical syntax for restricting results. Confirm the dialect used in the interview and mention an appropriate alternative if the interviewer asks about portability.
Do API, React or Kafka questions belong in SQL preparation?
It depends. RESTful APIs interview questions can connect naturally to database work, while React questions focus more on user interfaces and Kafka questions focus on event streaming. Study them when the internship description includes those technologies.
Should I practise a programming language as well as SQL?
Yes. Many technical internships combine SQL with a language such as Java, Python or JavaScript. SQL handles data querying, while the programming language usually controls application behaviour, validation and communication with other services.
Should I prepare questions to ask the internship interviewer?
Yes. Ask about projects, mentoring, team tools, expected learning and how success is assessed. Good questions for an internship interview help you evaluate the role and demonstrate thoughtful interest without turning the conversation into an interrogation.
Are internship exit interview questions part of recruitment preparation?
No. Intern exit interview questions are generally asked after an internship to gather feedback about the experience. Recruitment preparation should focus instead on questions asked at internship interviews, technical exercises and examples that show how you learn and contribute.
Turn SQL practice into your next application
The most effective way to prepare is to write each query yourself, predict its output and explain why it works. Begin with retrieval and conditions, continue with aggregate functions and data changes, then practise joining related tables.
When comparing internship websites for college students, look beyond the number of listings. Consider role relevance, skill requirements, location, application instructions and whether the opportunity supports your learning goals.
Different internship platforms for students may be useful at different stages of your search, so it is sensible to compare several options. The best internships for college students are not identical for everyone because your course, availability, interests and existing skills all matter.
Apply My Internship is one option for discovering opportunities after you have strengthened your SQL basics. Explore internships on Apply My Internship and use what you have practised to approach your next application with confidence.
Previous articleInternship Orientation Ideas That Build Work Readiness
Next article Crafting Your Accountant Cover Letter: A Step-by-Step Guide










