SQL Aggregates, Grouping and Joins Class 12 PYQs 2024–2026 with Solutions | CBSE Informatics Practices Skip to content
Smart Notes for Every Exam · instant PDF download after payment +91 92520 37565
Class 12 · Informatics Practices · Chapter 6

SQL Aggregates, Grouping and Joins: Class 12 PYQs 2024–2026 with solutions

All 12 CBSE board questions asked from SQL Aggregates, Grouping and Joins in 3 board papers, with the year, set and marks of each. 8 are solved free below. The Class 12 Informatics Practices PYQ Book: Solved Board Papers 2024-2026 (CBSE) has every solution, all chapters and 3 full board papers.

Cover of Class 12 Informatics Practices PYQ Book: Solved Board Papers 2024-2026 (CBSE)
Class 12 Informatics Practices PYQ book: every chapter + 3 board papers, all solved
₹99₹14934% off
Free sample

SQL Aggregates, Grouping and Joins: board weightage

Board weightage 2024–2026

Year202420252026
Questions354
Marks10138

Most asked topics

Aggregate functions11
Joins1

12 questions from 3 papers. Repeated questions are shown once with every year they were asked.

Jump to: 1 mark2 marks3 marks4 marks5 marks

1 mark: MCQ and Assertion–Reason

Q1 · CBSE 2026 · 90 · Q61 mark

True/False: In SQL, an aggregate function returns multiple values for each column on which it is applied.

Solution

False: it returns a single value for a group of rows.

Q2 · CBSE 2026 · 90 · Q211 mark

A–R. (A): SELECT COUNT(name) FROM students; will differ from SELECT COUNT(*) FROM students; if there are NULL values in name. (R): COUNT(column_name) counts non-NULL values in that column, whereas COUNT(*) returns the number of records.

Solution

(A) Both true and R correctly explains A.

Q3 · CBSE 2025 · 90 · Q41 mark

Which is not an aggregate function in SQL? (A) COUNT(*) (B) MIN() (C) LEFT() (D) AVG()

Full step-by-step solution is in the PYQ book (₹99).
Q4 · CBSE 2024 · 90 · Q51 mark

Which is not an aggregate function in MySQL? (i) AVG() (ii) MAX() (iii) LCASE() (iv) MIN()

Full step-by-step solution is in the PYQ book (₹99).

2 marks: very short answer

Q5 · CBSE 2025 · 90 · Q37(A)(i)2 marks

37(a)(i) Sum of all values of Score from STUDENTS; (iv) lowest Score from GRADES.

Solution

SELECT SUM(Score) FROM STUDENTS;   SELECT MIN(Score) FROM GRADES;

3 marks: short answer

Q6 · CBSE 2026 · 90 · Q32(A)3 marks

TEACHER (TID, TName, Experience, City): 1 Kartik 5 Bhopal; 2 Shahnaz 6 Nagpur; 3 Rajendra 7 Delhi; 4 Tanvi 4 Bhopal; 5 Alam 9 Delhi. SUBJECT (SID, SubName, TID): 101 Physics 1; 102 Chemistry 2; 103 Mathematics 3; 104 Informatics Practices 4; 105 Computer Science 5. (I) Delete the subject whose TID is 4. (II) Names of teachers with more than 5 years' experience who stay in Nagpur. (III) Subject names with their teacher names.

Solution

DELETE FROM SUBJECT WHERE TID = 4;
SELECT TName FROM TEACHER
WHERE Experience > 5 AND City = 'Nagpur'; -- Shahnaz
SELECT SubName, TName FROM SUBJECT NATURAL JOIN TEACHER;
-- or FROM SUBJECT S, TEACHER T WHERE S.TID = T.TID
-- or FROM SUBJECT S JOIN TEACHER T ON S.TID = T.TID
(III) Physics Kartik, Chemistry Shahnaz, Mathematics Rajendra, (Informatics Practices Tanvi, if (I) not run), Computer Science Alam.

Q7 · CBSE 2026 · 90 · Q37(A)(V)3 marks

37 (a) V. Average salary from Employees; (b) III. maximum Bill_Amount from Bill; V. total salary from tot_sal of Employees.

Solution

SELECT AVG(Salary) FROM Employees;   -- or SUM(Salary)/COUNT(Salary)
SELECT MAX(Bill_Amount) FROM Bill;
SELECT SUM(tot_sal) FROM Employees;

Q8 · CBSE 2025 · 90 · Q32(A)3 marks

STUDENTS (S_ID, NAME, AGE, CITY): 1 Rahul 20 Delhi; 2 Priya 22 Mumbai; 3 David 21 Delhi; 4 Neha 23 Bengaluru; 5 Khurshid 22 Delhi. GRADES (S_ID, SUBJECT, GRADE): 1 Math A; 2 English B; 3 Math C; 4 English A; 5 Math B. (i) Number of students from each city; (ii) average age of all students; (iii) names of students and their grades.

Full step-by-step solution is in the PYQ book (₹99).
Q9 · CBSE 2025 · 90 · Q32(B)3 marks

OR: PRODUCTS (PID, PName, Category): 201 Laptop Electronics; 202 Chair Furniture; 203 Desk Furniture; 204 Smartphone NULL; 205 Tablet Electronics. SALES (SaleID, PID, UnitsSold): 301 201 50; 302 202 100; 303 203 60; 304 204 80; 305 205 70. (i) Delete records from SALES with UnitsSold < 80; (ii) names of products whose category is not known; (iii) product names with units sold.

Full step-by-step solution is in the PYQ book (₹99).

4 marks: SQL / case-based

Q10 · CBSE 2025 · 90 · Q34(A)4 marks

COURSE (C_ID, C_NAME, INSTRUCTOR, DURATION): C101 Data Structures Dr. Alok 40; C102 Machine Learning Prof. Sunita 60; C103 Web Development Ms. Sakshi 45; C104 Database Management Mr. Suresh 45; C105 Python Programming Dr. Pawan 35. (i) Add record C106, Introduction to AI, Ms. Preeti, 55; (ii) longest duration; (iii) total number of courses; (iv) instructors' names in lower case.

Solution

INSERT INTO COURSE VALUES ('C106', 'Introduction to AI', 'Ms. Preeti', 55);
SELECT MAX(DURATION) FROM COURSE; -- 60
SELECT COUNT(*) FROM COURSE; -- or COUNT(DISTINCT C_NAME)
SELECT LOWER(INSTRUCTOR) FROM COURSE;

Q11 · CBSE 2024 · 90 · Q314 marks

Table NOBEL (Winner_id, YEAR, SUBJECT, WINNER, COUNTRY, CATEGORY). Queries: (i) names of winners in Literature for 1970; (ii) subject and category of winners whose country is not known; (iii) details of winners who were Scientists; (iv) count winners whose subject is Literature.

Solution

SELECT WINNER FROM NOBEL WHERE SUBJECT = 'Literature' AND YEAR = 1970;
SELECT SUBJECT, CATEGORY FROM NOBEL WHERE COUNTRY IS NULL;
SELECT * FROM NOBEL WHERE CATEGORY = 'Scientist';
SELECT COUNT(*) FROM NOBEL WHERE SUBJECT = 'Literature';
Note IS NULL, never = NULL.

5 marks: programs and case studies

Q12 · CBSE 2024 · 90 · Q335 marks

Employee (Employee_id, First_name, Last_name, Salary, Joining_date, Department): E101 Monika Das 100000 2019-01-20 Finance; E102 Mehek Verma 600000 2019-01-15 IT; E103 Manan Pant 890000 2019-02-05 Banking; E104 Shivam Agarwal 200000 2019-02-25 Insurance; E105 Alisha Singh 220000 2019-02-28 Finance; E106 Poonam Sharma 400000 2019-05-10 IT; E107 Anshuman Mishra 123000 2019-06-20 Banking. Reward (Employee_id, Date_reward, Amount): E101 2019-05-11 1000; E102 2019-02-15 5000; E103 2019-04-22 2000; E106 2019-06-20 8000.
(i) Change Shivam's department to IT. (ii) Remove Alisha's record. (iii) Add column Experience (integer). (iv) First name, last name and reward amount for all employees. (v) First name and salary of employees whose amount is less than 2000.
OR OR: (i) Year of joining of all employees. (ii) Each department and its average salary. (iii) First name and date of reward of employees who joined on Monday. (iv) Sum of salary of employees whose reward amount > 3000. (v) Remove the table Reward. 5

Solution

UPDATE Employee SET Department = 'IT' WHERE First_name = 'Shivam';
DELETE FROM Employee WHERE First_name = 'Alisha';
ALTER TABLE Employee ADD Experience INT;
SELECT First_name, Last_name, Amount
FROM Employee E, Reward R WHERE E.Employee_id = R.Employee_id;
SELECT First_name, Salary FROM Employee E, Reward R
WHERE E.Employee_id = R.Employee_id AND Amount < 2000;
(iv) Monika Das 1000, Mehek Verma 5000, Manan Pant 2000, Poonam Sharma 8000. (v) Monika 100000. NATURAL JOIN is also accepted.
OR
SELECT YEAR(Joining_date) FROM Employee;
SELECT Department, AVG(Salary) FROM Employee GROUP BY Department;
SELECT First_name, Date_reward FROM Employee E, Reward R
WHERE E.Employee_id = R.Employee_id
AND DAYNAME(Joining_date) = 'Monday';
SELECT SUM(Salary) FROM Employee E, Reward R
WHERE E.Employee_id = R.Employee_id AND Amount > 3000;
DROP TABLE Reward;

(ii) Banking 506500, Finance 160000, Insurance 200000, IT 500000. (iii) Only Shivam joined on a Monday (2019-02-25) and he has no reward row, so the query returns no rows. (iv) Mehek 600000 + Poonam 400000 = 1000000.

Get every solution for all chapters

  • Every board question of every chapter, each fully solved the way the board gives marks
  • 3 complete board papers, each followed by its solutions
  • Weightage and most-asked topics for every chapter
  • Instant PDF download, colour and black & white print copies
See real pages (free sample)

Revising the chapter first? Complete Informatics Practices Notes for Class 12 (CBSE 065, 2026-27) →

What you get in the pack

All chapters in this pack

  1. PYQ Ch 1 Pandas Series
  2. PYQ Ch 2 DataFrame: Creation and Attributes
  3. PYQ Ch 3 DataFrame Operations and CSV Files
  4. PYQ Ch 4 Data Visualisation with Matplotlib
  5. PYQ Ch 5 SQL Revision and Single-row Functions
  6. PYQ Ch 6 SQL Aggregates, Grouping and Joins
  7. PYQ Ch 7 Computer Networks
  8. PYQ Ch 8 Introduction to the Internet and Web
  9. PYQ Ch 9 Societal Impacts
  10. Board Paper 2026 Set 90 with Solutions
  11. Board Paper 2025 Set 90 with Solutions
  12. Board Paper 2024 Set 90 with Solutions
← PYQ Ch 5 SQL Revision and Single-row Functions PYQ Ch 7 Computer Networks →

Prices shown in Indian rupees. Show prices in: ₹ INR · US$ USD