Free tutorials & notes in Hindi & English · Clean code examples 🧰 Free PDF & Image Tools →
🛢️ Unit 2 – Database Query using SQL (25 marks)  ·  Lesson 15

📝 Unit 2 Board Questions + Practice

What is on this page

Unit 2 of the 2026-27 syllabus carries 25 marks. Part A has 24 new practice questions with answers (click "Show answer" only after you try). Part B has all 57 questions of Unit 2 from the previous CBSE board papers (2022, 2023, 2024, 2025, 2026) in their original form – tables, code and internal choices included – each with a worked answer.

How to use for best result

1) Read the unit lessons first. 2) Solve Part A in your notebook, then check answers. 3) Attempt Part B paper-wise with a timer – about 1.5 minutes per mark. 4) Mark the questions you got wrong and revise that lesson again.

Part A – Practice questions with answers

U2-011 markImportant

Predict: SELECT POWER(3, MOD(14,4));

Show answer

9.

U2-021 markImportant

Predict: SELECT ROUND(482.376,2);

Show answer

482.38.

U2-031 markImportant

Predict: SELECT INSTR('SCHOOL DATA','XYZ');

Show answer

0.

U2-041 markImportant

A table contains 5 rows and 2 NULL entries in Email. State COUNT(*) and COUNT(Email).

Show answer

5 and 3.

U2-051 markImportant

Which clause filters grouped results using an aggregate condition: WHERE, HAVING, ORDER BY or DISTINCT?

Show answer

HAVING.

U2-061 mark

True or false: UPDATE changes the structure of a table by adding a column.

Show answer

False. ALTER TABLE adds a column; UPDATE changes stored row values.

U2-072 marksImportant

Predict both outputs: (i) SELECT SUBSTRING('DIGITAL INDIA',9,5); (ii) SELECT UPPER(RIGHT('Learning',3));

Show answer

INDIA; ING.

U2-082 marksImportant

Write queries to display (i) the month name of '2027-02-15', (ii) only the date part of '2027-02-15 09:30:00'.

Show answer
SQL
SELECT MONTHNAME('2027-02-15');
SELECT DATE('2027-02-15 09:30:00');
U2-092 marksImportant

Explain COUNT(column) versus COUNT(*) with an example that contains NULL.

Show answer

COUNT(column) counts non-NULL values; COUNT(*) counts all rows. For [10,NULL,20], counts are 2 and 3.

U2-102 marksImportant

Correct this query to display each house having more than two students.

SQL
SELECT House, COUNT(*) FROM STUDENT
WHERE COUNT(*) > 2 GROUP BY House;
Show answer
SQL
SELECT House, COUNT(*) FROM STUDENT GROUP BY House HAVING COUNT(*) > 2;
U2-112 marks

Define domain and tuple in the relational model.

Show answer

Domain: allowed set of values for an attribute. Tuple: a row/record in a relation.

U2-122 marksImportant

For STUDENT(SID, Name, Marks), write commands to (i) increase all Marks by 2, (ii) add City VARCHAR(25).

Show answer
SQL
UPDATE STUDENT SET Marks=Marks+2;
ALTER TABLE STUDENT ADD City VARCHAR(25);
Table STUDENT (used in U2-13 to U2-18)
SIDNameHouseMarksCityDOB
1AshaRed84Khurja2009-05-12
2BilalBlue76Aligarh2009-08-20
3CharuRed92Khurja2008-12-01
4DevBlueNULLDelhi2009-05-03
5EshaGreen68Aligarh2008-11-15
6FarhanRed80Khurja2009-08-14

SID is a unique, non-NULL student identifier. Each sub-part is independent and uses this original data.

U2-133 marksImportant

Write queries to display (i) Name and Marks for marks >= 80, (ii) all rows in descending Marks order, (iii) names with unknown marks.

Show answer
SQL
SELECT Name,Marks FROM STUDENT WHERE Marks>=80;
SELECT * FROM STUDENT ORDER BY Marks DESC;
SELECT Name FROM STUDENT WHERE Marks IS NULL;
U2-143 marksImportant

Write queries for (i) house-wise number of students, (ii) average Marks of Red house, (iii) houses with more than two students.

Show answer
SQL
SELECT House,COUNT(*) FROM STUDENT GROUP BY House;
SELECT AVG(Marks) FROM STUDENT WHERE House='Red';
SELECT House,COUNT(*) FROM STUDENT GROUP BY House HAVING COUNT(*)>2;
U2-153 marksImportant

Predict: (i) SELECT COUNT(*),COUNT(Marks) FROM STUDENT; (ii) SELECT MAX(Marks),MIN(Marks) FROM STUDENT; (iii) SELECT SUM(Marks) FROM STUDENT WHERE House='Red';

Show answer

(6,5); (92,68); 256.

U2-163 marksImportant

Write queries for (i) names of students born in August, (ii) names in lower case, (iii) first three letters of names of Khurja students.

Show answer
SQL
SELECT Name FROM STUDENT WHERE MONTH(DOB)=8;
SELECT LOWER(Name) FROM STUDENT;
SELECT LEFT(Name,3) FROM STUDENT WHERE City='Khurja';
U2-174 marksImportant

Write queries to (i) insert (7, Gauri, Green, 88, Delhi, 2009-06-11), (ii) change SID 2 city to Khurja, (iii) delete SID 4, (iv) display Name and birth year for all students. Treat each subpart independently.

Show answer
SQL
INSERT INTO STUDENT VALUES(7,'Gauri','Green',88,'Delhi','2009-06-11');
UPDATE STUDENT SET City='Khurja' WHERE SID=2;
DELETE FROM STUDENT WHERE SID=4;
SELECT Name,YEAR(DOB) FROM STUDENT;
U2-184 marksImportant

Write queries to display (i) each city and average marks, (ii) houses with average marks above 80, (iii) names with marks BETWEEN 75 AND 85, (iv) distinct cities alphabetically.

Show answer
SQL
SELECT City,AVG(Marks) FROM STUDENT GROUP BY City;
SELECT House,AVG(Marks) FROM STUDENT GROUP BY House HAVING AVG(Marks)>80;
SELECT Name FROM STUDENT WHERE Marks BETWEEN 75 AND 85;
SELECT DISTINCT City FROM STUDENT ORDER BY City;
Tables COURSE and ENROL (used in U2-19 and U2-20)
CIDCNameFee
C1Python4000
C2SQL3500
C3Networks3000
EIDLearnerCID
101AmanC1
102BhavnaC2
103ChiragC1
104DiyaC3
U2-193 marksImportant

Write equi-join queries to display (i) each learner with course name, (ii) learner and fee where fee >= 3500, (iii) total enrolled learners for each course name.

Show answer
SQL
SELECT E.Learner,C.CName FROM ENROL E,COURSE C WHERE E.CID=C.CID;
SELECT E.Learner,C.Fee FROM ENROL E,COURSE C WHERE E.CID=C.CID AND C.Fee>=3500;
SELECT C.CName,COUNT(*) FROM ENROL E,COURSE C WHERE E.CID=C.CID GROUP BY C.CName;
U2-203 marksImportant

Predict the result: SELECT C.CName,COUNT(*) FROM COURSE C,ENROL E WHERE C.CID=E.CID GROUP BY C.CName ORDER BY C.CName;

Show answer

Networks 1; Python 2; SQL 1.

U2-213 marksImportant

Create BOOK with BookID INT PRIMARY KEY, Title VARCHAR(40), Price DECIMAL(8,2), PurchaseDate DATE. Write another query to increase Price by 50 only when Price < 500.

Show answer
SQL
CREATE TABLE BOOK(BookID INT PRIMARY KEY, Title VARCHAR(40), Price DECIMAL(8,2), PurchaseDate DATE);
UPDATE BOOK SET Price=Price+50 WHERE Price<500;
U2-225 marksImportant

Write five queries to display (i) the square of 19, (ii) remainder of 47 divided by 6, (iii) length of 'Data Science' including the space, (iv) ' Khurja ' with both outer spaces removed, (v) current date and time.

Show answer
SQL
SELECT POWER(19,2);
SELECT MOD(47,6);
SELECT LENGTH('Data Science');
SELECT TRIM(' Khurja ');
SELECT NOW();
U2-235 marksImportant

For PAYMENT(PID, Customer, Amount, PayDate), write independent queries to display (i) highest Amount, (ii) lowest Amount, (iii) Customer without trailing spaces, (iv) Customer without leading spaces, (v) day name and day number of each PayDate.

Show answer
SQL
SELECT MAX(Amount) FROM PAYMENT;
SELECT MIN(Amount) FROM PAYMENT;
SELECT RTRIM(Customer) FROM PAYMENT;
SELECT LTRIM(Customer) FROM PAYMENT;
SELECT DAYNAME(PayDate),DAY(PayDate) FROM PAYMENT;
U2-243 marks

Explain primary, candidate and alternate keys using BOOK(BookID, ISBN, Title). Assume every BookID and ISBN is unique and non-NULL; Title may repeat. Select BookID as the primary key. Give a command to remove the BOOK table.

Show answer

Candidate keys: BookID and ISBN. Primary key: BookID. Alternate key: ISBN. Title is not a key under these assumptions. DROP TABLE BOOK;

Part B – Previous year board questions (Unit 2)

CBSE Board Paper 2026 – 12 questions

Board 2026 · Q6
CBSE 2026 Class 12 IP board question Q6, Unit 2 Database Query using SQL
Show answer

False – an aggregate function returns a single value for the whole column (or one value per group).

Board 2026 · Q9
CBSE 2026 Class 12 IP board question Q9, Unit 2 Database Query using SQL
Show answer

(C) 9 – the space is also counted.

Board 2026 · Q11
CBSE 2026 Class 12 IP board question Q11, Unit 2 Database Query using SQL
Show answer

(D) Data Manipulation Language

Board 2026 · Q17
CBSE 2026 Class 12 IP board question Q17, Unit 2 Database Query using SQL
Show answer

True

Board 2026 · Q19
CBSE 2026 Class 12 IP board question Q19, Unit 2 Database Query using SQL
Show answer

(C) 15.68

Board 2026 · Q21
CBSE 2026 Class 12 IP board question Q21, Unit 2 Database Query using SQL
Show answer

(A) – both are true and the reason correctly explains the assertion.

Board 2026 · Q24
CBSE 2026 Class 12 IP board question Q24, Unit 2 Database Query using SQL
Show answer

a. Domain: the set of all allowed values for an attribute (column), e.g. Gender can be only M or F. b. Tuple: a single row (record) of a relation (table).

Board 2026 · Q26
CBSE 2026 Class 12 IP board question Q26, Unit 2 Database Query using SQL
Show answer
SQL
SELECT MONTH('2026-01-01');    -- (I)  1
SELECT YEAR('2026-01-01');     -- (II) 2026
Board 2026 · Q31
CBSE 2026 Class 12 IP board question Q31, Unit 2 Database Query using SQL
Show answer
SQL
CREATE TABLE PRODUCTS (
    PID   INT PRIMARY KEY,
    PName VARCHAR(30),
    PCat  CHAR(15),
    Price DECIMAL(10, 2)
);                                                                  -- (i)
UPDATE PRODUCTS SET Price = Price + 100 WHERE PCat = 'Grocery';     -- (ii)
Board 2026 · Q32
CBSE 2026 Class 12 IP board question Q32, Unit 2 Database Query using SQL (part 1)CBSE 2026 Class 12 IP board question Q32, Unit 2 Database Query using SQL (part 2)
Show answer

(a)

SQL
DELETE FROM SUBJECT WHERE TID = 4;                                     -- (I)
SELECT TName FROM TEACHER WHERE Experience > 5 AND City = 'Nagpur';    -- (II)
SELECT S.SubName, T.TName FROM SUBJECT S, TEACHER T WHERE S.TID = T.TID;   -- (III)

OR (b)

(I) BookId and Title – in the given data both have unique, non-NULL values in every row, so either can identify a book. (BookId is the better choice for primary key because two different books may have the same title in future.) Genre repeats and Price has NULL, so they are not candidate keys.

SQL
INSERT INTO LIBRARY VALUES (501, 'AI for ALL', 'Technology', 589);   -- (II)
ALTER TABLE LIBRARY ADD Author CHAR(20);                            -- (III)  (VARCHAR(20) also accepted)
Board 2026 · Q34
CBSE 2026 Class 12 IP board question Q34, Unit 2 Database Query using SQL (part 1)CBSE 2026 Class 12 IP board question Q34, Unit 2 Database Query using SQL (part 2)
Show answer

(a)

SQL
SELECT UPPER(RIGHT(GuestName, 3)) FROM Guest;          -- I
SELECT GuestName, DAYNAME(CheckInDate) FROM Guest;     -- II
SELECT MOD(Charges, 1000) FROM Guest;                  -- III
SELECT MID(GuestName, 2, 3) FROM Guest;                -- IV

OR (b) Output:

I. Hemant, Neha, Keshav

II. Hemant 10, Keshav 5

III. March, January, December

IV. 101 → 1, 102 → NULL, 103 → 20, 104 → 25

Board 2026 · Q37
CBSE 2026 Class 12 IP board question Q37, Unit 2 Database Query using SQL (part 1)CBSE 2026 Class 12 IP board question Q37, Unit 2 Database Query using SQL (part 2)
Show answer

(a)

SQL
SELECT DATE('2026-01-01 10:10:10');          -- I
SELECT LOWER(Cust_Name) FROM Customer;       -- II
SELECT LEFT(City_Name, 4) FROM Location;     -- III
SELECT LTRIM(CITY) FROM EVENT;               -- IV
SELECT AVG(Salary) FROM Employees;           -- V

OR (b)

SQL
SELECT POWER(17, 2);                         -- I  (289)
SELECT DAY(Hire_Date) FROM Employee;         -- II
SELECT MAX(Bill_Amount) FROM Bill;           -- III
SELECT TRIM(Location) FROM Branch;           -- IV
SELECT SUM(tot_sal) FROM Employees;          -- V

CBSE Board Paper 2025 – 12 questions

Board 2025 · Q2
CBSE 2025 Class 12 IP board question Q2, Unit 2 Database Query using SQL
Show answer

(D) August

Board 2025 · Q4
CBSE 2025 Class 12 IP board question Q4, Unit 2 Database Query using SQL
Show answer

(C) LEFT()

Board 2025 · Q8
CBSE 2025 Class 12 IP board question Q8, Unit 2 Database Query using SQL
Show answer

False – MOD() returns the remainder, not the quotient.

Board 2025 · Q11
CBSE 2025 Class 12 IP board question Q11, Unit 2 Database Query using SQL
Show answer

(B) POWER()

Board 2025 · Q16
CBSE 2025 Class 12 IP board question Q16, Unit 2 Database Query using SQL
Show answer

(B) (i)-(b) ROUND, (ii)-(a) COUNT, (iii)-(d) YEAR, (iv)-(c) RIGHT

Board 2025 · Q21
CBSE 2025 Class 12 IP board question Q21, Unit 2 Database Query using SQL
Show answer

(C) – Assertion is true, Reason is false: ROUND() is a math (numeric) function, not a string function.

Board 2025 · Q24
CBSE 2025 Class 12 IP board question Q24, Unit 2 Database Query using SQL
Show answer
SQL
SELECT UPPER('Informatics Practices');     -- (i)  INFORMATICS PRACTICES
SELECT LENGTH('Informatics Practices');    -- (ii) 21
Board 2025 · Q26
CBSE 2025 Class 12 IP board question Q26, Unit 2 Database Query using SQL
Show answer

A DBMS is software used to create, store, manage, update and retrieve data in databases in an organised and secure way, while controlling access and reducing redundancy. Examples: MySQL, Oracle, Microsoft SQL Server, PostgreSQL.

Board 2025 · Q31
CBSE 2025 Class 12 IP board question Q31, Unit 2 Database Query using SQL
Show answer
SQL
CREATE TABLE Customer (
    CID   INT PRIMARY KEY,
    FName VARCHAR(20),
    LName VARCHAR(20),
    Age   INT
);                                                -- (i)
SELECT * FROM Customer ORDER BY LName DESC;       -- (ii)
Board 2025 · Q32
CBSE 2025 Class 12 IP board question Q32, Unit 2 Database Query using SQL (part 1)CBSE 2025 Class 12 IP board question Q32, Unit 2 Database Query using SQL (part 2)
Show answer

(a)

SQL
SELECT CITY, COUNT(*) FROM STUDENTS GROUP BY CITY;                  -- (i)
SELECT AVG(AGE) FROM STUDENTS;                                      -- (ii)
SELECT S.NAME, G.GRADE FROM STUDENTS S, GRADES G WHERE S.S_ID = G.S_ID;   -- (iii)

OR (b)

SQL
DELETE FROM SALES WHERE UnitsSold < 80;                             -- (i)
SELECT PName FROM PRODUCTS WHERE Category IS NULL;                  -- (ii)
SELECT P.PName, S.UnitsSold FROM PRODUCTS P, SALES S WHERE P.PID = S.PID;  -- (iii)
Board 2025 · Q34
CBSE 2025 Class 12 IP board question Q34, Unit 2 Database Query using SQL (part 1)CBSE 2025 Class 12 IP board question Q34, Unit 2 Database Query using SQL (part 2)
Show answer

(a)

SQL
INSERT INTO COURSE VALUES ('C106', 'Introduction to AI', 'Ms. Preeti', 55);   -- (i)
SELECT MAX(DURATION) FROM COURSE;                                             -- (ii)
SELECT COUNT(*) FROM COURSE;                                                  -- (iii)
SELECT LOWER(INSTRUCTOR) FROM COURSE;                                         -- (iv)

OR (b) Output: (i) PRIYA (ii) RAVI SHARMA (iii) ARJUN SINGH, PRIYA JAIN (iv) 4 (NULL is not counted)

Board 2025 · Q37
CBSE 2025 Class 12 IP board question Q37, Unit 2 Database Query using SQL
Show answer

(a)

SQL
SELECT SUM(Score) FROM STUDENTS;           -- (i)
SELECT LEFT(Name, 5) FROM STUDENTS;        -- (ii)
SELECT RTRIM(Name) FROM STUDENTS;          -- (iii)
SELECT MIN(Score) FROM GRADES;             -- (iv)
UPDATE STUDENTS SET FEE = FEE + 100;       -- (v)

OR (b)

SQL
SELECT POWER(15, 2);                              -- (i)   225
SELECT ROUND(456.789);                            -- (ii)  457
SELECT INSTR('mycommercial.com', 'com');          -- (iii) 3
SELECT DAYNAME('2024-11-07');                     -- (iv)  Thursday
SELECT NOW();                                     -- (v)

CBSE Board Paper 2024 – 12 questions

Board 2024 · Q4
CBSE 2024 Class 12 IP board question Q4, Unit 2 Database Query using SQL
Show answer

(iv) 4 – MOD(17,3) = 2 and POWER(2,2) = 4.

Board 2024 · Q5
CBSE 2024 Class 12 IP board question Q5, Unit 2 Database Query using SQL
Show answer

(iii) LCASE()

Board 2024 · Q8
CBSE 2024 Class 12 IP board question Q8, Unit 2 Database Query using SQL
Show answer

(iii) ALTER TABLE

Board 2024 · Q9
CBSE 2024 Class 12 IP board question Q9, Unit 2 Database Query using SQL
Show answer

(ii) 2023

Board 2024 · Q11
CBSE 2024 Class 12 IP board question Q11, Unit 2 Database Query using SQL
Show answer

(ii) INSERT INTO

Board 2024 · Q14
CBSE 2024 Class 12 IP board question Q14, Unit 2 Database Query using SQL
Show answer

(iii) MID()

Board 2024 · Q21
CBSE 2024 Class 12 IP board question Q21, Unit 2 Database Query using SQL
Show answer

(i) YAN3 (ii) 76345.46

Board 2024 · Q25
CBSE 2024 Class 12 IP board question Q25, Unit 2 Database Query using SQL
Show answer

UPDATE is a DML command – it changes the data (values) stored in rows, e.g. UPDATE STUDENT SET Marks = 90 WHERE RollNo = 3;

ALTER TABLE is a DDL command – it changes the structure of the table (add/drop/modify a column or a key), e.g. ALTER TABLE STUDENT ADD City VARCHAR(20);

Board 2024 · Q26
CBSE 2024 Class 12 IP board question Q26, Unit 2 Database Query using SQL
Show answer

(a)

SQL
SELECT Sid, SName FROM Sports WHERE MONTH(DateofPlay) = 9;     -- (i)
SELECT LOWER(SName) FROM Sports;                               -- (ii)
SELECT RIGHT(SName, 2) FROM Sports WHERE Fees < 1500;          -- (iii)  gives 'te' (Karate)

OR (b) Output: (i) BADMINTON (ii) Law, Bad (iii) S3, S4

Board 2024 · Q28
CBSE 2024 Class 12 IP board question Q28, Unit 2 Database Query using SQL
Show answer

(i) 6 tuples (ii) salesman_id (unique for every salesman)

(iii)

SQL
SELECT * FROM Salesman ORDER BY commission DESC;
Board 2024 · Q31
CBSE 2024 Class 12 IP board question Q31, Unit 2 Database Query using SQL
Show answer
SQL
SELECT WINNER FROM NOBEL WHERE SUBJECT = 'Literature' AND YEAR = 1970;   -- (i)
SELECT SUBJECT, CATEGORY FROM NOBEL WHERE COUNTRY IS NULL;               -- (ii)
SELECT * FROM NOBEL WHERE CATEGORY = 'Scientist';                        -- (iii)
SELECT COUNT(*) FROM NOBEL WHERE SUBJECT = 'Literature';                 -- (iv)
Board 2024 · Q33
CBSE 2024 Class 12 IP board question Q33, Unit 2 Database Query using SQL (part 1)CBSE 2024 Class 12 IP board question Q33, Unit 2 Database Query using SQL (part 2)
Show answer
SQL
UPDATE Employee SET Department = 'IT' WHERE First_name = 'Shivam';                 -- (i)
DELETE FROM Employee WHERE First_name = 'Alisha';                                  -- (ii)
ALTER TABLE Employee ADD Experience INT;                                           -- (iii)
SELECT E.First_name, E.Last_name, R.Amount
FROM Employee E, Reward R WHERE E.Employee_id = R.Employee_id;                     -- (iv)
SELECT E.First_name, E.Salary
FROM Employee E, Reward R WHERE E.Employee_id = R.Employee_id AND R.Amount < 2000; -- (v)

OR

SQL
SELECT YEAR(Joining_date) FROM Employee;                                           -- (i)
SELECT Department, AVG(Salary) FROM Employee GROUP BY Department;                  -- (ii)
SELECT E.First_name, R.Date_reward FROM Employee E, Reward R
WHERE E.Employee_id = R.Employee_id AND DAYNAME(E.Joining_date) = 'Monday';        -- (iii)
SELECT SUM(E.Salary) FROM Employee E, Reward R
WHERE E.Employee_id = R.Employee_id AND R.Amount > 3000;                           -- (iv)
DROP TABLE Reward;                                                                 -- (v)

CBSE Board Paper 2023 – 12 questions

Board 2023 · Q4
CBSE 2023 Class 12 IP board question Q4, Unit 2 Database Query using SQL
Show answer

(i) 7876.46

Board 2023 · Q5
CBSE 2023 Class 12 IP board question Q5, Unit 2 Database Query using SQL
Show answer

(iii) Multiple Row Functions

Board 2023 · Q7
CBSE 2023 Class 12 IP board question Q7, Unit 2 Database Query using SQL
Show answer

(iv) ORDER BY

Board 2023 · Q8
CBSE 2023 Class 12 IP board question Q8, Unit 2 Database Query using SQL
Show answer

(iii) Trim( )

Board 2023 · Q9
CBSE 2023 Class 12 IP board question Q9, Unit 2 Database Query using SQL
Show answer

(iv) 0

Board 2023 · Q14
CBSE 2023 Class 12 IP board question Q14, Unit 2 Database Query using SQL
Show answer

(iv) LEN( ) – MySQL has LENGTH() (a text function), not an aggregate LEN().

Board 2023 · Q20
CBSE 2023 Class 12 IP board question Q20, Unit 2 Database Query using SQL
Show answer

Errors: TOTAL is not an SQL function (use SUM); a condition on a column without grouping should be in WHERE (or use GROUP BY zone with HAVING).

SQL
SELECT zone, SUM(bonus) FROM employee WHERE zone = 'WEST';

or

SQL
SELECT zone, SUM(bonus) FROM employee GROUP BY zone HAVING zone = 'WEST';
Board 2023 · Q21
CBSE 2023 Class 12 IP board question Q21, Unit 2 Database Query using SQL
Show answer

COUNT(column) counts only the non-NULL values of that column; COUNT(*) counts all rows, including rows with NULL values.

Example: if table EMP has 5 rows and Bonus is NULL in 2 rows, SELECT COUNT(Bonus) FROM EMP; gives 3 and SELECT COUNT(*) FROM EMP; gives 5.

Board 2023 · Q26
CBSE 2023 Class 12 IP board question Q26, Unit 2 Database Query using SQL
Show answer
SQL
SELECT * FROM Patient WHERE MONTH(Dateofadm) = 1;                         -- (i)
SELECT COUNT(*) FROM Patient WHERE City = 'Delhi';                        -- (ii)
SELECT RIGHT(Patientid, 2) FROM Patient WHERE Department = 'Surgery';     -- (iii)
Board 2023 · Q30
CBSE 2023 Class 12 IP board question Q30, Unit 2 Database Query using SQL
Show answer

(i) 6 (ii) 34000 (1700 × 20) (iii) Foun, Nigh

OR: (i) MATE (ii) ION (iii) 8

Board 2023 · Q31
CBSE 2023 Class 12 IP board question Q31, Unit 2 Database Query using SQL (part 1)CBSE 2023 Class 12 IP board question Q31, Unit 2 Database Query using SQL (part 2)
Show answer
SQL
SELECT YEAR('2023-05-15');          -- (i)
SELECT LOWER('ABC@XYZ.com');        -- (ii)
SELECT LTRIM(' my country ');       -- (iii)
SELECT CURDATE();                   -- (iv)  or SELECT DATE(NOW());
SELECT POWER(10, 6);                -- (v)

OR

SQL
SELECT LEFT(Itemname, 3) FROM PRODUCT;                              -- (i)
SELECT Itemname FROM PRODUCT WHERE DAYNAME(Stockdate) = 'Monday';   -- (ii)
SELECT SUM(Price) FROM PRODUCT;                                     -- (iii)
SELECT MAX(Price) FROM PRODUCT;                                     -- (iv)
SELECT AVG(Price) FROM PRODUCT WHERE Company = 'Logitech';          -- (v)
Board 2023 · Q34
CBSE 2023 Class 12 IP board question Q34, Unit 2 Database Query using SQL (part 1)CBSE 2023 Class 12 IP board question Q34, Unit 2 Database Query using SQL (part 2)
Show answer
SQL
SELECT Gender, AVG(Marks) FROM Schooldata GROUP BY Gender;                 -- (i)
SELECT MIN(Marks) FROM Schooldata WHERE Grade = 10;                        -- (ii)
SELECT Club, COUNT(*) FROM Schooldata GROUP BY Club HAVING COUNT(*) > 1;   -- (iii)
SELECT Gender, MAX(Marks), MIN(Marks) FROM Schooldata GROUP BY Gender;     -- OR (iii)

CBSE Board Paper 2022 (Term-2, 35 marks) – 9 questions

Board 2022 · Q3
CBSE 2022 Class 12 IP board question Q3, Unit 2 Database Query using SQL
Show answer

(i) 7658.35 (ii) 2 – ROUND(13.9,0) = 14 and 14 MOD 3 = 2.

OR: POWER(m, n) is a single-row (math) function that returns m raised to n for each row; SUM() is an aggregate function that returns one total of a whole column/group. POWER takes two arguments, SUM takes one column.

Board 2022 · Q5
CBSE 2022 Class 12 IP board question Q5, Unit 2 Database Query using SQL
Show answer

(i) INDIA MOVEMENT (ii) 8 – 'IA' first occurs at position 8 in ARTIFICIAL.

Board 2022 · Q6
CBSE 2022 Class 12 IP board question Q6, Unit 2 Database Query using SQL
Show answer

Error: an aggregate condition cannot be written in WHERE; it must be in HAVING after GROUP BY. To count students, COUNT(*) is needed (not MAX(Marks)).

SQL
SELECT Class, COUNT(*) FROM STUDENT GROUP BY Class HAVING COUNT(*) > 3;
Board 2022 · Q7
CBSE 2022 Class 12 IP board question Q7, Unit 2 Database Query using SQL (part 1)CBSE 2022 Class 12 IP board question Q7, Unit 2 Database Query using SQL (part 2)
Show answer
SQL
SELECT LTRIM(Name) FROM SCHOOLDATA;                          -- (i)
SELECT Name FROM SCHOOLDATA WHERE DAYNAME(Dob) = 'Sunday';   -- (ii)

(For the given data no student was born on a Sunday, so (ii) returns an empty set.)

OR – Output: (i) 91 (ii)

Output
+----------------+--------------+
| LEFT(Gender,1) | Name         |
+----------------+--------------+
| F              | Swapnil Pant |
| M              | Rahil Arora  |
+----------------+--------------+
Board 2022 · Q8
CBSE 2022 Class 12 IP board question Q8, Unit 2 Database Query using SQL
Show answer

(i) ALL THE BEST (ii) 25 (iii) INDIA

OR

SQL
SELECT UPPER(Breed) FROM MYPET;      -- (i)
SELECT SUM(Price) FROM MYPET;        -- (ii)
SELECT AVG(LifeSpan) FROM MYPET;     -- (iii)  NULL is ignored: 51/4 = 12.75
Board 2022 · Q9
CBSE 2022 Class 12 IP board question Q9, Unit 2 Database Query using SQL
Show answer

(i) MONTHNAME() (ii) LOWER() / LCASE() (iii) LENGTH()

Board 2022 · Q10
CBSE 2022 Class 12 IP board question Q10, Unit 2 Database Query using SQL
Show answer

(i) 12 – MOD(5,3) = 2, 10 + 2 = 12

(ii) 52.50 and 75.30 (Eraser 10.50×5, Gel Pen 25.10×3)

(iii) ER, EN, EN, ER

Board 2022 · Q11
CBSE 2022 Class 12 IP board question Q11, Unit 2 Database Query using SQL
Show answer
SQL
SELECT * FROM ITEM ORDER BY Stockdate DESC;            -- (i)
SELECT Type, COUNT(*) FROM ITEM GROUP BY Type;         -- (ii)
SELECT MIN(Price) FROM ITEM;                           -- (iii)
SELECT Itemname, ROUND(Price, 1) FROM ITEM;            -- (iv)
Board 2022 · Q12
CBSE 2022 Class 12 IP board question Q12, Unit 2 Database Query using SQL
Show answer

(i) MAX = 280, MIN = 68 (ii) 5 (NULL is not counted) (iii) 4 and 5 (Ravi, Ankit) (iv) Ankit

OR

SQL
SELECT COUNT(*) FROM SALESMAN;                                              -- (i)
SELECT Area, MAX(Qtysold) FROM SALESMAN GROUP BY Area;                      -- (ii)
SELECT Area, AVG(Qtysold) FROM SALESMAN GROUP BY Area HAVING COUNT(*) > 1;  -- (iii)
SELECT * FROM SALESMAN ORDER BY Area;                                       -- (iv)
Next

Next: Unit 3 – Networks, Devices & Topologies.

← Class 12 Informatics Practices
🔗

Share this topic with a friend

यह topic किसी दोस्त को भेजें

Found it useful? Send it to a classmate learning the same thing.

अच्छा लगा? जो दोस्त यही सीख रहा है, उसे भेज दीजिए।

Next topicNetworks, Devices & Topologies Your progress: 15 / 29 (52%) · Lesson 16 / 29 Continue →

How was this lesson?

Your feedback helps us make the content better.

Write a review or suggestion (optional)

After approval, your name and city may appear publicly with your review. Please do not write your email or phone number.

▶ CodingEasily on YouTube

Learn with video lessons in easy Hindi

Featured video: RDBMS Part 3 – Class XI Commerce IT

▶ Subscribe – it’s free