Class 12 Computer Science Structured Query Language (SQL) PYQ, free to download as a 101-page PDF with 77 solved questions: 39 from the 2022 to 2026 board papers and 38 from CBSE's official sample papers. SQL sits in Unit 3, Database Management, which carries 20 of the 70 theory marks.
The questions keep returning to aggregate functions (21 questions), GROUP BY and HAVING (15), joins and the Cartesian product (13), NULL handling (13), the CHAR and VARCHAR data types (10) and DDL against DML commands (6).
On this page you get:
- 77 questions with a worked solution each: 30 MCQs and fill-in items, 28 short answers and 19 programs or case studies
- An Answer Key that lists all 24 MCQs with options at a glance
- Question counts by topic, so you know whether to start with aggregates, joins or the DDL and DML commands
- A marks-wise table of questions (1, 2, 3, 4 and 5 mark)
- The common mistakes students make, such as writing HAVING before GROUP BY, and a short FAQ
|
Table of Contents |
Structured Query Language (SQL) Weightage in the Class 12 Computer Science Paper
CBSE does not print a mark figure for SQL alone. In the Class 12 Computer Science (083) syllabus, Unit 3 Database Management carries 20 of the 70 theory marks, and it covers database concepts, SQL and Python-MySQL connectivity together. That is a unit-level figure, so check the current curriculum on cbseacademic.nic.in. In practice SQL supplies several one-mark MCQs, a 2-mark and 3-mark command or output question and the 4-mark case study that asks for four queries. The unit marks are as reported by prep sites and the published syllabus summaries, and we could not confirm them on a CBSE document, so treat them as unofficial.
The question bank carries a marks heading for each group, so the table below shows how many questions the set holds at each mark value.
| Marks per Question | Questions in the Set |
|---|---|
| 1 mark | 30 |
| 2 marks | 19 |
| 3 marks | 9 |
| 4 marks (case study) | 17 |
| 5 marks | 2 |
Structured Query Language (SQL) Questions by Topic
The set splits into questions you answer from memory and questions you answer by reading a table. 17 questions ask for the output of a query on a given table, such as WORKER, FURNITURE or ORDERS, and 12 ask you to write the queries yourself. The 4-mark case studies mostly give a table like STOCK, CUSTOMERS and LOANS or PRODUCT and BRAND, then ask for four queries or four outputs.
Aggregate functions are the biggest single topic: 21 questions use COUNT, SUM, AVG, MAX or MIN, and 15 use GROUP BY or HAVING with them. Joins come next, with 13 questions on the Cartesian product, equi-join and natural join. One asks how many rows and columns the natural join of LOAN and BORROWER gives, and another asks for the product of a 6-row, 3-column table with a 5-row, 2-column one.
Command questions are short. 22 questions touch CREATE, ALTER or DROP, and 6 ask you to sort commands into DDL and DML. 10 questions involve CHAR and VARCHAR, including a board item on how many characters "Keshav" and "Meenakshi" occupy. 13 involve NULL, 8 use LIKE patterns and 4 use ORDER BY. 5 questions ask for a Python program that connects to MySQL.
Counts come from keyword matches over the question text, so a question that names two topics is counted under both.
Source: Magnet Brains
How to Approach the Set
Start with the 30 one-mark items, since 24 of them are options-based and the Answer Key lets you check them in seconds. Then take the output questions. Trace the query row by row against the table, apply WHERE first, then GROUP BY, then HAVING, and only then ORDER BY. For the case studies, write each query on paper before you open the solution, and run it in MySQL if you can. Keep one worked pattern ready for each of these: a GROUP BY with HAVING, a join on a common column, an ALTER TABLE that adds or drops a column and a short Python program using cursor.execute().
Common Mistakes in Structured Query Language (SQL) Questions
- Writing HAVING before GROUP BY. One board question gives exactly this query on the employees table and asks for the correction.
- Using = to test for NULL. Use IS NULL or IS NOT NULL, because a comparison with NULL never matches.
- Saying VARCHAR(20) stores 20 characters. It stores only what you give it, so "Keshav" takes 6, while CHAR(20) pads "Meenakshi" to 20.
- Counting the join columns twice. A natural join shows the common column once, so LOAN and BORROWER give 2 rows and 4 columns.
- Calling UPDATE a DDL command. It changes data, so it is DML; CREATE, ALTER and DROP are DDL.
- Confusing degree and cardinality. ALTER TABLE changes the degree (columns), while COUNT(*) gives the cardinality (rows).
- Using DELETE when the question says remove a column.
Using the Answer Key and Solutions
The PDF is 101 pages and free to download. Each section is sorted newest year first, the Answer Key lists every MCQ at a glance, and each question links to its worked solution and back. Each question carries a tag such as [2024] or [Sample Paper 2025-26], so you can tell a board question from a sample-paper one. Attempt a section first, check the key, then read the solution. The solutions are written by Collegedunia's Computer Science experts and are not official CBSE marking schemes.
Class 12 Computer Science PYQs by Chapter
Structured Query Language (SQL) Class 12 Computer Science PYQ FAQs
Ques. How many questions are in the Structured Query Language (SQL) Class 12 PYQ PDF?
Ans. The PDF has 77 questions: 39 from the 2022 to 2026 CBSE board papers and 38 from CBSE's official sample papers. 30 are one-mark MCQs and fill-in items, 28 are short answers and 19 are programs or case studies.
Ques. Does this PYQ PDF include solutions, or only the questions?
Ans. All 77 questions have a worked solution in the PDF, and the 24 MCQs with options also have an Answer Key before the solutions.
Ques. Are the solutions official?
Ans. No. They are written by Collegedunia's Computer Science experts, and the queries and programs are run and checked against CBSE's marking schemes where CBSE has published them (the 2023, 2024 and 2025 board papers and the sample papers). The 2022 and 2026 board papers have no published scheme, so those answers were worked out and run by hand. They are not an official CBSE marking scheme.
Ques. How many marks does SQL carry in the Class 12 Computer Science paper?
Ans. CBSE publishes marks for each unit, not each chapter. SQL belongs to Unit 3, Database Management, which carries 20 of the 70 theory marks in the 2026-27 syllabus. Check cbseacademic.nic.in for the current curriculum.
Ques. Which topics are asked most from SQL?
Ans. Aggregate functions appear in 21 questions, date handling in 25, GROUP BY or HAVING in 15, joins and the Cartesian product in 13 and NULL in 13.
Ques. Do the questions include Python and MySQL connectivity?
Ans. Yes. 5 questions ask for a Python program that connects to a MySQL database to display, update or delete records.
Ques. Why does HAVING before GROUP BY give an error?
Ans. A HAVING clause filters groups that GROUP BY has already formed, so GROUP BY must come first. One board question gives a query with the two reversed and asks for the correction.








Comments