To clear a data internship SQL screening, you need to write correct queries under time pressure for filtering, grouping, joins, subqueries and window functions. The eight graded tasks below use one small schema, and the scoring sheet shows which skill to fix first. Work through them in order, write each answer by hand or in a plain editor before checking, and score yourself honestly.
What a data internship SQL screening usually tests
Screenings differ by company, so treat this as a typical pattern rather than a rule. Most short tests give you two or three tables and ask for five to ten queries in 30 to 60 minutes. The questions climb from simple retrieval to joins and ranking. Interviewers also care whether you can explain why a query is correct, not only whether it returns rows.
| Skill band | What the screener checks | Tasks below |
|---|---|---|
| Retrieval | SELECT, WHERE, ORDER BY, LIMIT, DISTINCT | 1, 2 |
| Summarising | COUNT, SUM, AVG, GROUP BY, HAVING | 3, 4 |
| Combining tables | INNER JOIN, LEFT JOIN, handling missing matches | 5, 6 |
| Multi-step logic | Subqueries, CTEs, comparing against an aggregate | 7 |
| Analytics functions | ROW_NUMBER, RANK, partitions, running totals | 8 |
The sample schema used for all eight SQL tasks
The schema is a tiny online stationery shop. The names and values are invented for practice. Syntax below follows standard SQL that works in PostgreSQL and MySQL 8 or later; if your test uses SQLite or SQL Server, check small differences such as date functions and LIMIT versus TOP.
customers(customer_id, name, city, signup_date)
products(product_id, product_name, category, unit_price)
orders(order_id, customer_id, order_date, status)
order_items(order_id, product_id, quantity)
Sample rows (illustrative) you can type into any practice database:
| Table | Rows |
|---|---|
| customers | (1, Aarav, Bhopal, 2025-12-10); (2, Meera, Indore, 2026-01-03); (3, Kabir, Bhopal, 2026-01-15); (4, Isha, Bhopal, 2026-02-01) |
| products | (1, Notebook, Stationery, 50); (2, Backpack, Accessories, 800); (3, Pen Set, Stationery, 120) |
| orders | (1, 1, 2026-01-05, delivered); (2, 1, 2026-02-10, delivered); (3, 2, 2026-01-20, cancelled); (4, 3, 2026-02-02, delivered) |
| order_items | (1, 1, 2); (2, 2, 1); (3, 1, 1); (4, 3, 3) |
Free 2-Week CareerSwami Internship
Online, 14 days, with a free offer letter and a free completion certificate once you finish the work. Check with your college that it fits your requirement before you enrol.
Graded SQL question bank: eight tasks from SELECT to window functions
Level 1: retrieval (tasks 1 and 2)
- Task 1. List the name and city of every customer from Bhopal who signed up on or after 2026-01-01.
- Task 2. Return the distinct cities in the customers table, then separately the two most expensive products with their prices.
Level 2: summarising (tasks 3 and 4)
- Task 3. Count orders for each status value.
- Task 4. Find customer_ids that have more than one delivered order.
Level 3: joins (tasks 5 and 6)
- Task 5. For each delivered order, show order_id and order value (quantity multiplied by unit_price, summed across items).
- Task 6. List customers who have never placed any order.
Level 4: multi-step and analytic (tasks 7 and 8)
- Task 7. Find customers whose total delivered spend is above the average delivered spend per customer.
- Task 8. Within each product category, rank products by total quantity sold, highest first, showing the rank next to each product.
Model answers to check against (illustrative, not executed)
Try each task first. These are reference approaches written for this article; they have not been run against a live database, so paste them into your practice setup and compare the output with your own reasoning.
-- Task 1
SELECT name, city FROM customers
WHERE city = 'Bhopal' AND signup_date >= '2026-01-01';
-- Task 2
SELECT DISTINCT city FROM customers;
SELECT product_name, unit_price FROM products
ORDER BY unit_price DESC LIMIT 2;
-- Task 3
SELECT status, COUNT(*) AS order_count
FROM orders GROUP BY status;
-- Task 4
SELECT customer_id FROM orders
WHERE status = 'delivered'
GROUP BY customer_id
HAVING COUNT(*) > 1;
-- Task 5
SELECT o.order_id, SUM(oi.quantity * p.unit_price) AS order_value
FROM orders o
JOIN order_items oi ON oi.order_id = o.order_id
JOIN products p ON p.product_id = oi.product_id
WHERE o.status = 'delivered'
GROUP BY o.order_id;
-- Task 6
SELECT c.customer_id, c.name
FROM customers c
LEFT JOIN orders o ON o.customer_id = c.customer_id
WHERE o.order_id IS NULL;
-- Task 7
WITH spend AS (
SELECT o.customer_id, SUM(oi.quantity * p.unit_price) AS total_spend
FROM orders o
JOIN order_items oi ON oi.order_id = o.order_id
JOIN products p ON p.product_id = oi.product_id
WHERE o.status = 'delivered'
GROUP BY o.customer_id
)
SELECT customer_id, total_spend
FROM spend
WHERE total_spend > (SELECT AVG(total_spend) FROM spend);
-- Task 8
SELECT p.category, p.product_name,
SUM(oi.quantity) AS units_sold,
RANK() OVER (PARTITION BY p.category
ORDER BY SUM(oi.quantity) DESC) AS rank_in_category
FROM products p
JOIN order_items oi ON oi.product_id = p.product_id
GROUP BY p.category, p.product_name;
Worked example: finding customers with no orders, step by step
This is an illustrative walk-through of Task 6 using the sample rows, reasoned by hand.
- Start from the table you want to keep whole. You need every customer, so customers goes on the left of a LEFT JOIN.
- Match on the key. Aarav (1) matches orders 1 and 2, Meera (2) matches order 3, Kabir (3) matches order 4. Isha (4) matches nothing, so the order columns for her row are NULL.
- Filter on the missing side.
WHERE o.order_id IS NULLkeeps only rows where no match was found. The expected result is one row: Isha. - Sanity check. Four customers, three have at least one order, so one customer should remain. The count agrees.
Note that Meera’s only order is cancelled. Task 6 asks for customers with no order at all, so she is correctly excluded. If the question said “no delivered order”, the status filter would have to move into the join condition (AND o.status = 'delivered'), not the WHERE clause, otherwise the LEFT JOIN quietly behaves like an inner join. Reading the wording closely is itself a screening skill.
Self-scoring sheet for the eight SQL tasks
Score each task from 0 to 5 using the criteria below, then total out of 40. Attempt tasks without looking at the model answers, and time yourself at about six minutes per task.
| Task | 5 points means | Deduct for | My score |
|---|---|---|---|
| 1. Filter | Correct columns, both conditions, correct date comparison | SELECT *, wrong AND/OR, text-date mistakes | __ / 5 |
| 2. Sort and distinct | Both parts correct, sort direction right | Missing DESC, DISTINCT on wrong column | __ / 5 |
| 3. Group count | One row per status with a clear alias | Selecting a non-grouped column | __ / 5 |
| 4. HAVING | Filter before grouping, count condition after | COUNT inside WHERE | __ / 5 |
| 5. Join and sum | Correct join keys, delivered-only, one row per order | Missing ON clause, duplicated rows, unfiltered status | __ / 5 |
| 6. Anti-join | LEFT JOIN with IS NULL, or NOT EXISTS | Using = NULL, inner join | __ / 5 |
| 7. CTE or subquery | Per-customer total, then comparison with the average of those totals | Averaging line items instead of customer totals | __ / 5 |
| 8. Window function | PARTITION BY category, correct ordering, rank column visible | Missing PARTITION BY, wrong rank function for ties | __ / 5 |
Reading your total
- 32 to 40: ready for a timed mock. Practise explaining each query aloud in two sentences.
- 22 to 31: solid basics. Re-do your lowest two tasks on a different schema you invent.
- Below 22: go back to tasks 1 to 5 and repeat until you can write them without hints, then return to 6 to 8.
Common SQL mistakes that cost marks in screenings
- Using WHERE where HAVING is needed. Aggregates like
COUNT(*) > 1cannot sit in WHERE because rows are filtered before groups exist. - Comparing to NULL with =. Use
IS NULLandIS NOT NULL. Also be wary ofNOT INagainst a column containing NULLs, which can return nothing;NOT EXISTSor a LEFT JOIN is safer. - Join fan-out. Joining orders to order_items repeats order-level values once per item. Summing an order-level column after such a join inflates totals.
- Filtering the right table in WHERE after a LEFT JOIN. This turns it into an inner join. Put the condition in the ON clause when you want to keep unmatched rows.
- Average of averages. Task 7 needs the average of per-customer totals, not the average of individual item values.
- Wrong ranking function. ROW_NUMBER gives unique numbers even for ties, RANK leaves gaps after ties, DENSE_RANK does not. State which one you chose and why.
- Selecting columns not in GROUP BY. Some engines reject this; others return arbitrary values. Either way it signals unclear thinking.
- Not checking the result. Count rows by hand on tiny data, as in the worked example, before trusting the output.
A 14-day plan for SQL practice alongside an online internship
A short internship leaves little room for slow revision, so schedule SQL in 45 to 60 minute blocks. The free two-week online internship from CareerSwami runs 14 days across 26 tracks and includes a free offer letter and a completion certificate after successful completion. Whatever programme you choose, this plan fits next to it.
| Days | Focus | Output |
|---|---|---|
| 1-2 | Set up the sample schema; tasks 1 and 2 | Working database, two answers |
| 3-4 | Tasks 3 and 4; GROUP BY and HAVING drills | Ten extra self-written variations |
| 5-7 | Tasks 5 and 6; joins and NULL handling | Notes on fan-out and anti-joins |
| 8-9 | Task 7; rewrite as subquery and CTE both ways | Two versions of one query |
| 10-11 | Task 8; ranking, running totals | Tie-handling comparison of three rank functions |
| 12 | Full timed run of all eight tasks | Score on the sheet above |
| 13 | Fix the two weakest tasks; invent a new schema | Four fresh questions answered |
| 14 | Second timed run; practise explaining aloud | Final score and a short portfolio note |
Bhabha University students: turning SQL practice into screening-ready proof
The university describes itself as chartered under the Madhya Pradesh State Private University Act, with a campus on NH-12, Narmadapuram Road, Bhopal. Its home page lists 16 faculties and departments on one campus, so internship and project requirements may differ between programmes, and your own department is the place to confirm them.
For SQL-focused preparation, two pages are relevant. The Computer Applications faculty page lists BCA, MCA and PhD programmes and mentions project work in cloud computing, full-stack web and machine learning, plus industrial internships; it does not publish scheme details. The Management faculty page mentions industry internships and compulsory corporate summer internships in the MBA, and lists Information Technology among its specialisation options, which can matter if you are targeting analytics roles. It gives no duration, credits or evaluation format.
The Training & Placement Cell page states objectives such as recruitment readiness and campus and off-campus drives, and lists mock interviews, aptitude training and “In-plant Training & Industrial Internships”. It does not say how an external online internship is treated. The Academic Calendar page says the Academic Council approved the 2026-27 session calendar and offers it as a PDF; check that document for exam and break dates before you fix your 14 days.
None of this tells you whether your department accepts an online internship for any requirement. Treat that as unconfirmed until you have it in writing.
Verification steps before you plan your screening prep
- Download the 2026-27 academic calendar PDF from the Academic Calendar page and mark exam weeks and breaks, then choose a 14-day window that avoids them.
- Ask your programme coordinator in writing whether the department has an internship or project regulation, and request the current scheme and syllabus for your batch.
- Ask the same person whether a voluntary online internship can be listed in your records, and what document (offer letter, certificate, report) they would want.
- Visit or email the Training & Placement Cell and ask whether SQL or data-skills mock tests are part of their mock interview rounds, and which sessions you can join.
- Check whether your syllabus already includes a database course, so you can align this practice with what your faculty will assess.
- Open the Recent Placement List linked on the T&P page yourself and check which roles and companies are listed before drawing conclusions about data roles.
How to present your SQL practice in an internship application
Screeners respond to evidence. Keep a short file with your schema, the eight queries, one sentence per query on what it does, and your self-score before and after practice. If a form asks for a link, a plain public repository or document is enough. Do not describe results you have not produced, and never copy solutions without understanding them, since follow-up questions expose this quickly.
Frequently Asked Questions
How many SQL questions should I practise before a data internship screening?
Quality matters more than count. Doing these eight tasks, then writing three variations of each on a schema you invent, gives roughly thirty queries and exposes the usual traps. Stop adding questions once you can solve every band without hints inside the time limit.
Which SQL topics appear most in internship screenings?
Joins, GROUP BY with HAVING, and NULL handling appear most often. Window functions such as ROW_NUMBER and RANK show up in stronger screenings. Confirm the format by asking the recruiter or reading the invitation, since tests vary.
Should I use a subquery or a CTE in Task 7?
Either is acceptable if it is correct. A CTE is usually easier to read and explain because it names the intermediate result. Write both versions once so you can switch if the test environment limits one.
What is the difference between RANK, DENSE_RANK and ROW_NUMBER?
ROW_NUMBER assigns a unique number to each row even when values tie. RANK gives tied rows the same number and then skips ahead. DENSE_RANK gives ties the same number without gaps. Choose based on what the question wants when two products sell equally.
Can I practise SQL without installing anything?
Yes. A browser-based SQL playground or a lightweight local database such as SQLite is enough for these tasks. Check that your tool supports window functions and CTEs, since very old versions may not.
Why does my LEFT JOIN return fewer rows than expected?
Most often a condition on the right table sits in WHERE, which removes the NULL rows. Move that condition into the ON clause, or add an explicit IS NULL check if you want unmatched rows.
How should a Bhabha University student find out whether an online internship will be recognised by the department?
Ask your programme coordinator by email, quoting the internship duration and what documents you will receive, and request the answer in writing. The university pages for Computer Applications and Management do not state internship rules, so the department’s reply is the safest reference.
How long should I spend on each question in a timed test?
Aim for about six minutes on simple tasks and up to ten on tasks 7 and 8. If you are stuck, write the join or grouping skeleton, note your intent in a comment, and move on; partial structure often earns marks.
Related Data Science guides
- CHARUSAT Students: Documenting a Data Science Internship Project on GitHub
- Rishihood University Students: Pitching Yourself to a Startup for a Data Science Internship
- MSCB University Students: Exploratory Data Analysis Steps for Your First Internship Task
- All Data Science internship guides
Ready to put this into practice?
Join the free two-week CareerSwami online internship in Data Science. The internship, the offer letter and the completion certificate are free.














