Free tutorials & notes in Hindi & English · Clean code examples 🧰 मुफ़्त PDF और फ़ोटो टूल्स →
🗄️ Unit 3 – Database Management (20 marks)  ·  Lesson 21

📝 Unit 3 Board Questions + Practice

इस page पर क्या है

2026-27 syllabus में Unit 3 के 20 marks हैं। Part A में 24 नए practice questions answers के साथ हैं (पहले ख़ुद हल करें, फिर "Answer देखें" दबाएँ)। Part B में पिछले CBSE board papers (2022, 2023, 2026) के Unit 3 के सभी 27 questions original रूप में हैं – tables, code और internal choice सहित, हर एक के answer के साथ। Questions board paper की तरह English में हैं।

सबसे अच्छा तरीका

1) पहले unit के lessons पढ़ें। 2) Part A notebook में हल करें, फिर answers मिलाएँ। 3) Part B को paper-wise timer लगाकर हल करें – लगभग 1.5 minute प्रति mark। 4) गलत हुए questions पर निशान लगाएँ और उस lesson को दोबारा पढ़ें।

Part A – Practice questions (answers के साथ)

U3-011 markज़रूरी

A relation has 8 rows and 5 columns. State its cardinality and degree.

Answer देखें

Cardinality 8; degree 5.

U3-021 markज़रूरी

A table has three candidate keys and one is selected as primary. How many alternate keys remain?

Answer देखें

2.

U3-031 markज़रूरी

Which command can add an attribute to an existing table?

Answer देखें

ALTER TABLE … ADD (e.g. ALTER TABLE STUDENT ADD City VARCHAR(20);)

U3-041 markज़रूरी

A table has 6 rows, with 2 NULL values in Phone. State COUNT(*) and COUNT(Phone).

Answer देखें

6 and 4.

U3-051 markज़रूरी

Which clause filters grouped results: WHERE or HAVING?

Answer देखें

HAVING.

U3-061 markज़रूरी

Under the default tuple-returning cursor, what Python structure does fetchall() return?

Answer देखें

A list of tuples.

U3-072 marksज़रूरी

Explain candidate key and foreign key using STUDENT(SID,Name,CID) and CLASS(CID,ClassName). Assume SID and CLASS.CID uniquely identify records.

Answer देखें

SID is a candidate key of STUDENT; CLASS.CID is a candidate key of CLASS. STUDENT.CID can be a foreign key referencing CLASS.CID, linking students to classes.

U3-082 marks

Differentiate CHAR(10) and VARCHAR(10). State the purpose of NOT NULL and UNIQUE.

Answer देखें

CHAR is fixed-length character data; VARCHAR is variable-length up to its declared length. NOT NULL rejects missing values; UNIQUE prevents duplicate non-NULL key values, subject to DBMS rules for NULL.

U3-092 marksज़रूरी

Write commands to create database SCHOOL, select it, show its tables and display the structure of STUDENT.

Answer देखें
SQL
CREATE DATABASE SCHOOL;
USE SCHOOL;
SHOW TABLES;
DESCRIBE STUDENT;
U3-102 marksज़रूरी

Correct the query to find departments having more than two employees.

SQL
SELECT Dept, COUNT(*) FROM EMPLOYEE
WHERE COUNT(*) > 2 GROUP BY Dept;
Answer देखें
SQL
SELECT Dept,COUNT(*) FROM EMPLOYEE GROUP BY Dept HAVING COUNT(*)>2;
Table STUDENT (used in U3-11 to U3-15 and U3-24)
SIDNameHouseMarksCity
1AshaRed84Khurja
2BilalBlue76Aligarh
3CharuRed92Khurja
4DevBlueNULLDelhi
5EshaGreen68Aligarh
6FarhanRed80Khurja
U3-113 marksज़रूरी

Write queries to display (i) Name and Marks for Marks BETWEEN 75 AND 85, (ii) records from Khurja or Delhi using IN, (iii) names ending in a.

Answer देखें
SQL
SELECT Name,Marks FROM STUDENT WHERE Marks BETWEEN 75 AND 85;
SELECT * FROM STUDENT WHERE City IN ('Khurja','Delhi');
SELECT Name FROM STUDENT WHERE Name LIKE '%a';
U3-123 marksज़रूरी

Write queries to display (i) records with missing Marks, (ii) distinct cities alphabetically, (iii) names and marks in descending Marks order.

Answer देखें
SQL
SELECT * FROM STUDENT WHERE Marks IS NULL;
SELECT DISTINCT City FROM STUDENT ORDER BY City;
SELECT Name,Marks FROM STUDENT ORDER BY Marks DESC;
U3-133 marksज़रूरी

Predict (i) COUNT(*) and COUNT(Marks), (ii) MIN(Marks) and MAX(Marks), (iii) SUM(Marks) for Red house.

Answer देखें

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

U3-143 marksज़रूरी

Write queries for (i) house-wise student counts, (ii) house-wise average Marks with alias AverageMarks, (iii) houses with average Marks > 80.

Answer देखें
SQL
SELECT House,COUNT(*) FROM STUDENT GROUP BY House;
SELECT House,AVG(Marks) AS AverageMarks FROM STUDENT GROUP BY House;
SELECT House,AVG(Marks) FROM STUDENT GROUP BY House HAVING AVG(Marks)>80;
U3-154 marksज़रूरी

Independently (i) insert (7,Gauri,Green,88,Delhi), (ii) increase Red-house marks by 2, (iii) delete SID 4, (iv) display Name and Marks+5 with alias Adjusted for non-NULL Marks.

Answer देखें
SQL
INSERT INTO STUDENT VALUES(7,'Gauri','Green',88,'Delhi');
UPDATE STUDENT SET Marks=Marks+2 WHERE House='Red';
DELETE FROM STUDENT WHERE SID=4;
SELECT Name,Marks+5 AS Adjusted FROM STUDENT WHERE Marks IS NOT NULL;
Tables COURSE and ENROL (used in U3-16 to U3-18)
CIDCNameFee
C1Python4000
C2SQL3500
C3Networks3000
EIDLearnerCID
101AmanC1
102BhavnaC2
103ChiragC1
104DiyaC3
U3-163 marksज़रूरी

Write equi-join queries to show (i) each learner and course name, (ii) learner and Fee where Fee >= 3500, (iii) learner count for each course.

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;
U3-172 marksज़रूरी

How many rows and columns result from (i) COURSE CROSS JOIN ENROL, (ii) COURSE NATURAL JOIN ENROL? CID is their only common column.

Answer देखें

Cross join: 12 rows, 6 columns. Natural join: 4 rows, 5 columns.

U3-183 marksज़रूरी

Predict this result, then explain why CID must be the intended common joining attribute.

SQL
SELECT Learner,CName FROM COURSE NATURAL JOIN ENROL
ORDER BY Learner;
Answer देखें

Aman Python; Bhavna SQL; Chirag Python; Diya Networks. NATURAL JOIN joins on all identically named columns; here CID is the only common name and represents the course identifier.

U3-194 marksज़रूरी

Create BOOK(BookID INT,Title VARCHAR(40),Price FLOAT,PurchaseDate DATE), making BookID the primary key and Title NOT NULL. Then write commands to add Shelf CHAR(5), remove Shelf, and drop BOOK. Treat the final three operations sequentially.

Answer देखें
SQL
CREATE TABLE BOOK(BookID INT PRIMARY KEY, Title VARCHAR(40) NOT NULL, Price FLOAT, PurchaseDate DATE);
ALTER TABLE BOOK ADD Shelf CHAR(5);
ALTER TABLE BOOK DROP COLUMN Shelf;
DROP TABLE BOOK;
U3-203 marks

For an existing ITEM table whose ItemID values are unique and non-NULL, add a primary key on ItemID, then remove that primary key. Give commands to show all databases and drop a practice database named TEMPDB.

Answer देखें
SQL
ALTER TABLE ITEM ADD PRIMARY KEY(ItemID);
ALTER TABLE ITEM DROP PRIMARY KEY;
SHOW DATABASES;
DROP DATABASE TEMPDB;

Use these as written exercises on a practice database only.

U3-214 marksज़रूरी

Write a complete Python program to connect to a local MySQL database SCHOOL using practice credentials user="student", password="practice" and display STUDENT rows with Marks >= 80. Use execute(), fetchall() and close the cursor and connection.

Answer देखें

Assumes mysql.connector and the stated local practice database/account are available:

Python
import mysql.connector as mysql
con = mysql.connect(host='localhost',user='student',
                    password='practice',database='SCHOOL')
cur = con.cursor()
cur.execute('SELECT * FROM STUDENT WHERE Marks >= %s',(80,))
for row in cur.fetchall():
    print(row)
cur.close()
con.close()
U3-224 marksज़रूरी

Using an established connection con and cursor cur, accept SID and new Marks, update the matching student using parameter placeholders, commit, and print the affected-row count.

Answer देखें

One valid solution:

Python
sid = int(input('SID: '))
marks = int(input('New marks: '))
cur.execute('UPDATE STUDENT SET Marks=%s WHERE SID=%s',
            (marks,sid))
con.commit()
print(cur.rowcount)
U3-234 marksज़रूरी

Using con and cur, insert (7,Gauri,Green,88,Delhi) with a parameterized query and commit. Then delete SID 7 with a parameterized query and commit. Explain the purpose of commit().

Answer देखें

commit() finalizes the transaction changes in this transactional example.

Python
cur.execute('INSERT INTO STUDENT VALUES(%s,%s,%s,%s,%s)',
            (7,'Gauri','Green',88,'Delhi'))
con.commit()
cur.execute('DELETE FROM STUDENT WHERE SID=%s',(7,))
con.commit()
U3-243 marksज़रूरी

With the original STUDENT data from U3-11, predict each print using the default cursor. Explain what fetchone() returns after exhaustion.

Python
cur.execute('SELECT SID,Name FROM STUDENT ORDER BY SID')
print(cur.fetchone())
print(cur.fetchone())
rest = cur.fetchall()
print(len(rest))
print(cur.fetchone())
Answer देखें

(1, 'Asha'); (2, 'Bilal'); 4; None. fetchone() returns None when no rows remain.

Part B – पिछले वर्षों के board questions (Unit 3)

CBSE Board Paper 2026 – 10 questions

Board 2026 · Q12
CBSE 2026 Class 12 CS board question Q12, Unit 3 Database Management
Answer देखें

(B) 1

Board 2026 · Q13
CBSE 2026 Class 12 CS board question Q13, Unit 3 Database Management
Answer देखें

(B) ALTER TABLE

Board 2026 · Q14
CBSE 2026 Class 12 CS board question Q14, Unit 3 Database Management
Answer देखें

(D) ID and name of machines with quantity less than or equal to 100 from INVENTORY table.

Board 2026 · Q15
CBSE 2026 Class 12 CS board question Q15, Unit 3 Database Management
Answer देखें

(C) 6 – cardinality is the number of tuples: 2 + 4 = 6 (deleting attributes changes only the degree).

Board 2026 · Q16
CBSE 2026 Class 12 CS board question Q16, Unit 3 Database Management
Answer देखें

(A) MIN()

Board 2026 · Q21
CBSE 2026 Class 12 CS board question Q21, Unit 3 Database Management
Answer देखें

(C) – Assertion is true, Reason is false: a primary key is chosen from the candidate keys.

Board 2026 · Q27
CBSE 2026 Class 12 CS board question Q27, Unit 3 Database Management
Answer देखें

(i) (a)

SQL
CREATE TABLE W_STOCK (
    W_Code        CHAR(5) PRIMARY KEY,
    W_Description VARCHAR(20),
    B_Qty         INT,
    U_Price       FLOAT
);

OR (b) No. Different items can have the same unit price, so U_Price is not unique and cannot identify each record.

(ii) (a)

SQL
ALTER TABLE W_STOCK ADD E_Date DATE;

OR (b)

SQL
ALTER TABLE W_STOCK DROP COLUMN B_Qty;
Board 2026 · Q32
CBSE 2026 Class 12 CS board question Q32, Unit 3 Database Management (part 1)CBSE 2026 Class 12 CS board question Q32, Unit 3 Database Management (part 2)
Answer देखें

(a)

SQL
SELECT Type, MAX(Price) FROM STOCK GROUP BY Type;            -- (i)
UPDATE STOCK SET Price = Price + 0.5 WHERE Type = 'F';       -- (ii)
SELECT SUM(Qty * Price) FROM STOCK;                          -- (iii)
SELECT * FROM STOCK WHERE Code LIKE 'A%';                    -- (iv)

OR (b)

(i) 0.5 300 38.00; 0.5 250 36.50; 1.0 50 52.00

(ii) AF0.5 300; MF0.5 250; PT0.5 78

(iii) F, T, D

(iv) 0.5 → 3; 1.0 → 3

Board 2026 · Q34
CBSE 2026 Class 12 CS board question Q34, Unit 3 Database Management (part 1)CBSE 2026 Class 12 CS board question Q34, Unit 3 Database Management (part 2)
Answer देखें
SQL
SELECT COUNT(*) FROM LOANS WHERE RoI > 7.0;                                  -- (i)
SELECT C.C_Name FROM CUSTOMERS C, LOANS L
WHERE C.C_ID = L.C_ID AND L.L_Amt > 1000000;                                 -- (ii)
SELECT C.C_ID, C.C_Name, L.Terms FROM CUSTOMERS C, LOANS L
WHERE C.C_ID = L.C_ID AND L.L_Date > '2024-12-31';                           -- (iii)
SELECT * FROM LOANS ORDER BY RoI DESC;                                       -- (iv)(a)
SELECT C_ID, AVG(Terms) FROM LOANS GROUP BY C_ID;                            -- OR (iv)(b)
Board 2026 · Q35
CBSE 2026 Class 12 CS board question Q35, Unit 3 Database Management
Answer देखें
Python
import mysql.connector as mysql

con = mysql.connect(host="localhost", user="admin", password="root", database="SCHOOL")
cur = con.cursor()
cur.execute("SELECT * FROM Account WHERE Fees < %s", (5000,))
for row in cur.fetchall():
    print(row)
cur.close()
con.close()

CBSE Board Paper 2023 – 9 questions

Board 2023 · Q10
CBSE 2023 Class 12 CS board question Q10, Unit 3 Database Management
Answer देखें

(d) Cardinality

Board 2023 · Q12
CBSE 2023 Class 12 CS board question Q12, Unit 3 Database Management
Answer देखें

(b) ORDER BY

Board 2023 · Q16
CBSE 2023 Class 12 CS board question Q16, Unit 3 Database Management
Answer देखें

(b) List of tuples

Board 2023 · Q22
CBSE 2023 Class 12 CS board question Q22, Unit 3 Database Management
Answer देखें

Candidate keys that are not chosen as the primary key are called alternate keys. Example: in STUDENT(AdmNo, RollNo, AadhaarNo, Name), AdmNo and AadhaarNo are both unique (candidate keys). If AdmNo is made the primary key, AadhaarNo becomes an alternate key.

Board 2023 · Q25
CBSE 2023 Class 12 CS board question Q25, Unit 3 Database Management
Answer देखें

(a) CHAR(n) is fixed-length: it always uses n characters, padding with spaces (CHAR(10) storing 'Ram' uses 10 characters). VARCHAR(n) is variable-length: it uses only the space needed up to n (VARCHAR(10) storing 'Ram' uses 3 characters). CHAR suits fixed codes (e.g. PIN, gender); VARCHAR suits names/addresses.

OR (b) DDL: CREATE, ALTER (also DROP). DML: INSERT, UPDATE (also DELETE, SELECT).

Board 2023 · Q26
CBSE 2023 Class 12 CS board question Q26, Unit 3 Database Management (part 1)CBSE 2023 Class 12 CS board question Q26, Unit 3 Database Management (part 2)
Answer देखें

(a) Natural join on LOAN_NO gives 2 rows (L-170 RAVYA, L-230 KRISH) and 4 columns (LOAN_NO, B_NAME, AMOUNT, CUST_NAME).

(b)

(i) STATE in descending order: SAHIL KANPUR, VEDA KANPUR, SAMEER ROOP NAGAR, MAHIR SONIPAT, MARY DELHI, ATHARVA DELHI (rows of the same state may appear in any order)

(ii) KANPUR, ROOP NAGAR, DELHI, SONIPAT

(iii) SAHIL UTTAR PRADESH; MAHIR HARYANA; VEDA UTTAR PRADESH (second and third letters 'HA': KHAN, SHARMA)

(iv) KANPUR 2; ROOP NAGAR 1; DELHI 2; SONIPAT 1

Board 2023 · Q28
CBSE 2023 Class 12 CS board question Q28, Unit 3 Database Management
Answer देखें

(a)

(i) MIN = 200, MAX = 4300

(ii) LOGITECH 2; CANON 2

(iii) KEYBOARD 2; MOUSE 3; JOYSTICK 2

(iv) LASER PRINTER CANON 1; KEYBOARD LOGITECH 2; MOUSE LOGITECH 2; JOYSTICK IBALL 1

(b)

SQL
SHOW DATABASES;
Board 2023 · Q32(b)
CBSE 2023 Class 12 CS board question Q32(b), Unit 3 Database Management (part 1)CBSE 2023 Class 12 CS board question Q32(b), Unit 3 Database Management (part 2)CBSE 2023 Class 12 CS board question Q32(b), Unit 3 Database Management (part 3)
Answer देखें

Delete version:

Python
import mysql.connector as mysql                                  # Statement 1
mycursor.execute("DELETE FROM employee WHERE E_code = 'E101'")   # Statement 2
mydb.commit()                                                    # Statement 3

OR – Display version:

Python
import mysql.connector as mysql                                  # Statement 1
mycursor.execute("SELECT * FROM employee WHERE City = 'Delhi'")  # Statement 2
details = mycursor.fetchall()                                    # Statement 3
Board 2023 · Q34
CBSE 2023 Class 12 CS board question Q34, Unit 3 Database Management
Answer देखें

(i) LABNO and LAB_NAME (both unique for every lab).

(ii) Degree = 5, Cardinality = 5

(iii)

SQL
INSERT INTO LAB VALUES ('L006', 'PHYSICS', 'Ravi', 25, 'II');        -- (a)
UPDATE LAB SET CAPACITY = CAPACITY + 10 WHERE FLOOR = 'I';            -- (b)

OR (iii)

SQL
ALTER TABLE LAB ADD PRIMARY KEY (LABNO);     -- (a)
DROP TABLE LAB;                              -- (b)

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

Board 2022 · Q3
CBSE 2022 Class 12 CS board question Q3, Unit 3 Database Management
Answer देखें

An attribute is a column (field) of a relation, e.g. Name in STUDENT. A domain is the set of all allowed values that an attribute can take, e.g. the domain of Gender is {M, F}. Every attribute takes its values from its domain.

Board 2022 · Q4
CBSE 2022 Class 12 CS board question Q4, Unit 3 Database Management
Answer देखें

The first fetchone() reads M1001 (not printed); the loop then fetches and prints the next two GYM rows:

Output
M1002#Pratik
M1004#Rakesh
Board 2022 · Q5
CBSE 2022 Class 12 CS board question Q5, Unit 3 Database Management
Answer देखें

(a) Harjot 55; Srikanth 43

(b) Delhi 2; Kolkata 1; Mumbai 2

(c) Delhi, Mumbai, Kolkata

(d) MAX(Dose1) = 2022-01-01, MIN(Dose2) = 2021-07-20

Board 2022 · Q6
CBSE 2022 Class 12 CS board question Q6, Unit 3 Database Management (part 1)CBSE 2022 Class 12 CS board question Q6, Unit 3 Database Management (part 2)
Answer देखें

(a) Natural join on DNO (P3 has NULL, so it is left out):

AMITABH NOOR; ANIKET ANNIE; AMITABH HARMEET

(b) NOOR 2021-12-25 1500; HARMEET 2019-12-20 1500

Board 2022 · Q7
CBSE 2022 Class 12 CS board question Q7, Unit 3 Database Management (part 1)CBSE 2022 Class 12 CS board question Q7, Unit 3 Database Management (part 2)
Answer देखें

A candidate key is any attribute (or set of attributes) that can uniquely identify each tuple of a relation; a table may have several. The primary key is the one candidate key chosen by the designer to identify the tuples; it cannot be NULL. The remaining candidate keys are alternate keys.

OR (a) PNO (b) Degree is the number of attributes (columns) of a relation. Degree of PLAYER = 3.

Board 2022 · Q9
CBSE 2022 Class 12 CS board question Q9, Unit 3 Database Management
Answer देखें

(i)

SQL
ALTER TABLE ITEMS DROP COLUMN DISCOUNT;

(ii) DDL: CREATE, DROP. DML: UPDATE, INSERT.

Board 2022 · Q10
CBSE 2022 Class 12 CS board question Q10, Unit 3 Database Management
Answer देखें
SQL
USE LIBRARY;        -- (a)
SHOW TABLES;        -- (b)
DESCRIBE BOOKS;     -- (c)
Board 2022 · Q11
CBSE 2022 Class 12 CS board question Q11, Unit 3 Database Management (part 1)CBSE 2022 Class 12 CS board question Q11, Unit 3 Database Management (part 2)
Answer देखें
SQL
UPDATE FLIGHT SET FARE = 6000 WHERE FNO = 'F104';                        -- (a)
SELECT GENDER, COUNT(*) FROM PASSENGER GROUP BY GENDER;                  -- (b)
SELECT P.NAME, F.FARE, F.F_DATE FROM PASSENGER P, FLIGHT F
WHERE P.FNO = F.FNO AND F.START = 'DELHI';                               -- (c)
DELETE FROM FLIGHT WHERE END = 'MUMBAI';                                 -- (d)
आगे

आगे: अपनी Practical File तैयार करें और Project चुनें।

← Class 12 Computer Science
🔗

Share this topic with a friend

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

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

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

अगला topicPractical File 2026-27 (Programs + SQL) आपकी प्रगति: 21 / 24 (88%) · Lesson 22 / 24 आगे बढ़ें →

यह lesson कैसा लगा?

आपकी राय से हम content और बेहतर बनाते हैं।

अपना review और सुझाव लिखें (वैकल्पिक)

Review approve होने के बाद आपका नाम और शहर इसके साथ public दिख सकते हैं। Email या phone न लिखें।

▶ CodingEasily on YouTube

Video से सीखें – आसान Hindi में

चुनी हुई video: RDBMS भाग 3 – Class XI Commerce IT

▶ Channel subscribe करें