AmbifulWorksheets
Practice that never repeats
CBSE · Class 11 · Informatics Practices

Introduction to Structured Query Language (SQL)

Standard difficulty · 20 questions · 40 marks · Time: 40 minutes

Name: Date: Score: ____ / 40

Show your working for Sections B and C. Answers are on the last page — try every question first!

Section A — Choose the correct answer8 × 1 = 8 marks
1.
CREATE, ALTER and DROP are:
  1. DQL commands
  2. functions
  3. DML commands
  4. DDL commands
2.
Table: STUDENT
RollNo | Name | Gender | Section | Marks | DOB
20 | Pooja | F | A | 49 | 2009-02-15
21 | Manav | M | A | 97 | 2010-06-07
22 | Rahul | M | B | 67 | 2009-06-26
23 | Zoya | F | B | 44 | 2010-06-03
24 | Naina | F | C | 72 | 2009-08-05
25 | Uday | M | C | 74 | 2008-12-12
26 | Meera | F | B | 94 | 2009-02-13
27 | Harsh | M | C | 98 | 2008-07-17
28 | Aarav | M | C | 97 | 2009-09-09
SELECT * FROM STUDENT WHERE Section IN ('C', 'A') AND Marks BETWEEN 72 AND 97;
How many rows does this query return?
  1. 4
  2. 5
  3. 3
  4. 9
3.
Table: ITEM
ItemCode | IName | Category | Price | Qty
I201 | Gel Pen | Stationery | 15 | 50
I203 | Glue Stick | Office | 35 | 35
I213 | Stapler | Office | 160 | 35
I218 | Water Bottle | Daily Use | 205 | 15
I219 | Torch | Daily Use | 180 | 55
I226 | School Bag | Daily Use | 1020 | 35
I228 | Paper Clips | Office | 40 | 60
I254 | File Folder | Office | 60 | 60
I257 | Umbrella | Daily Use | 285 | 40
SELECT IName FROM ITEM WHERE Category IN ('Office', 'Daily Use') ORDER BY Price;
Which name is in the first row of the output?
  1. Umbrella
  2. File Folder
  3. Glue Stick
  4. Paper Clips
4.
Which name is selected by the condition Name LIKE '_a%'?
  1. Deepa
  2. Naina
  3. Nikhil
  4. Bhavna
5.
To which category of SQL commands does this statement belong?
INSERT INTO STUDENT VALUES (18, 'Chetan', 'M', 'C', 87, '2009-03-17');
  1. DDL (Data Definition Language)
  2. DML (Data Manipulation Language)
  3. DCL (Data Control Language)
  4. DQL (Data Query Language)
6.
Table: EMPLOYEE
EmpId | Ename | Dept | City | Salary | Bonus
E102 | Kabir | Admin | Nagpur | 68000 | 2000
E103 | Meera | Admin | Kochi | 42000 | 5000
E104 | Ritu | Stores | Bhopal | 42000 | 3500
E112 | Harsh | Admin | Patna | 47000 | 4000
E113 | Sana | Sales | Surat | 29000 | 4500
E129 | Bhavna | Stores | Bhopal | 51000 | 3000
E131 | Pooja | Accounts | Nagpur | 32000 | NULL
E135 | Lakshmi | Accounts | Surat | 59000 | 5000
E140 | Asha | Admin | Agra | 40000 | 3500
UPDATE EMPLOYEE SET Salary = Salary + 1000 WHERE City NOT IN ('Bhopal', 'Nagpur', 'Shimla');
After this, what does SELECT Salary FROM EMPLOYEE WHERE EmpId = 'E131'; show?
  1. 31000
  2. 34000
  3. 32000
  4. 33000
7.
Table: EMPLOYEE
EmpId | Ename | Dept | City | Salary | Bonus
E101 | Zoya | Stores | Agra | 21000 | NULL
E105 | Farhan | Accounts | Patna | 25000 | NULL
E111 | Sahil | Transport | Pune | 38000 | 5500
E117 | Uday | Transport | Agra | 43000 | 2500
E119 | Chetan | Transport | Surat | 45000 | 1500
E121 | Nikhil | Sales | Patna | 42000 | 3500
E127 | Kabir | Accounts | Shimla | 74000 | NULL
E136 | Ishaan | Sales | Patna | 64000 | 1500
E137 | Bhavna | Sales | Shimla | 38000 | 1000
DELETE FROM EMPLOYEE WHERE Ename LIKE '%n';
How many rows are left in EMPLOYEE?
  1. 3
  2. 9
  3. 7
  4. 6
8.
Which MySQL data type suits best a column that stores the date of an exam?
  1. VARCHAR(30)
  2. VARCHAR(40)
  3. CHAR(6)
  4. DATE
Section B — Short answer8 × 2 = 16 marks
9.
Give two advantages of SQL.
10.
Table: EMPLOYEE
EmpId | Ename | Dept | City | Salary | Bonus
E102 | Lakshmi | Accounts | Agra | 35000 | 4000
E110 | Zoya | Sales | Pune | 26000 | 5500
E115 | Harsh | Accounts | Kochi | 53000 | NULL
E117 | Manav | Transport | Patna | 39000 | 3500
E126 | Sana | Accounts | Agra | 58000 | 4500
E135 | Uday | Accounts | Nagpur | 61000 | 2000
E136 | Deepa | Stores | Pune | 68000 | NULL
E140 | Farhan | Sales | Pune | 73000 | NULL
SELECT Ename FROM EMPLOYEE WHERE Bonus >= 3500 ORDER BY Salary;
Write the output, names separated by commas, in order.
11.
Table: STUDENT
RollNo | Name | Gender | Section | Marks | DOB
13 | Pooja | F | B | 55 | 2010-02-03
14 | Gauri | F | A | 84 | 2009-09-09
15 | Tanvi | F | B | 40 | 2010-10-22
16 | Rahul | M | A | 55 | 2009-05-18
17 | Jaya | F | B | 80 | 2008-07-07
18 | Uday | M | C | 36 | 2010-11-16
19 | Asha | F | B | 80 | 2010-03-24
SELECT DISTINCT Section FROM STUDENT WHERE Section <> 'C' ORDER BY Section;
Write the output, values separated by commas, in order.
12.
Table: ITEM
ItemCode | IName | Category | Price | Qty
I207 | Water Bottle | Daily Use | 110 | 30
I209 | Umbrella | Daily Use | 230 | 45
I210 | Pencil | Stationery | 10 | 50
I216 | Marker | Stationery | 25 | 25
I221 | Eraser | Stationery | 10 | 35
I232 | Lunch Box | Daily Use | 155 | 40
I239 | Gel Pen | Stationery | 30 | 15
I240 | Ruler | Stationery | 20 | 50
I255 | Glue Stick | Office | 45 | 35
SELECT IName FROM ITEM WHERE Category IN ('Daily Use') ORDER BY IName;
Write the output, names separated by commas, in order.
13.
Table: STUDENT
RollNo | Name | Gender | Section | Marks | DOB
18 | Ishaan | M | B | 76 | 2010-11-28
19 | Varun | M | B | 86 | 2009-03-07
20 | Sana | F | B | 63 | 2010-06-25
21 | Harsh | M | B | 87 | 2010-07-07
22 | Farhan | M | A | 91 | 2010-10-22
23 | Kabir | M | C | 51 | 2009-05-11
24 | Manav | M | A | 75 | 2009-08-09
25 | Nikhil | M | A | 69 | 2008-06-05
SELECT * FROM STUDENT WHERE DOB BETWEEN '2008-01-01' AND '2008-12-31';
How many rows does this query return?
14.
Table: EMPLOYEE
EmpId | Ename | Dept | City | Salary | Bonus
E107 | Rahul | Sales | Pune | 21000 | 2000
E114 | Meera | Accounts | Patna | 53000 | 2000
E122 | Sahil | Sales | Shimla | 71000 | 4500
E127 | Lakshmi | Stores | Pune | 18000 | NULL
E128 | Tanvi | Admin | Bhopal | 60000 | 3000
E132 | Aarav | Sales | Agra | 67000 | NULL
E134 | Pooja | Stores | Patna | 57000 | 1500
E135 | Kabir | Transport | Nagpur | 52000 | 1500
SELECT * FROM EMPLOYEE WHERE Bonus NOT BETWEEN 3000 AND 4500;
For the output, what are (a) its degree (b) its cardinality?
15.
Table: STUDENT
RollNo | Name | Gender | Section | Marks | DOB
9 | Manav | M | B | 40 | 2008-09-24
10 | Tanvi | F | C | 64 | 2009-11-22
11 | Nikhil | M | B | 78 | 2009-06-20
12 | Sana | F | B | 67 | 2009-06-27
13 | Rahul | M | B | 39 | 2010-08-05
14 | Pooja | F | A | 96 | 2009-05-27
15 | Deepa | F | B | 60 | 2009-05-17
16 | Chetan | M | C | 86 | 2009-04-19
17 | Aarav | M | A | NULL | 2008-12-24
How many rows does each query return?
(a) SELECT * FROM STUDENT WHERE Marks IS NULL;
(b) SELECT * FROM STUDENT WHERE Marks IS NOT NULL;
(c) SELECT * FROM STUDENT WHERE Marks = NULL;
16.
Table: EMPLOYEE
EmpId | Ename | Dept | City | Salary | Bonus
E105 | Ritu | Accounts | Nagpur | 19000 | 2500
E112 | Bhavna | Stores | Kochi | 50000 | NULL
E117 | Nikhil | Sales | Surat | 26000 | 3500
E122 | Uday | Sales | Shimla | 52000 | 5000
E124 | Zoya | Admin | Kochi | 56000 | 2000
E125 | Kabir | Admin | Kochi | 69000 | 6000
E136 | Naina | Transport | Agra | 69000 | 1000
E138 | Sahil | Sales | Patna | 70000 | NULL
UPDATE EMPLOYEE SET Salary = Salary + 5000 WHERE Ename LIKE '%l';
(a) How many rows does this change? (b) What is the new Salary of Nikhil?
Section C — Word problems4 × 4 = 16 marks
17.
Write SQL statements to create a table STUDENT with RollNo (primary key), Name, Section, Marks and DOB, and insert one row.
18.
Table: STUDENT
RollNo | Name | Gender | Section | Marks | DOB
12 | Sahil | M | C | 46 | 2009-11-24
13 | Ritu | F | B | 54 | 2009-03-23
14 | Naina | F | C | 40 | 2009-01-02
15 | Pooja | F | A | 80 | 2010-12-23
16 | Aarav | M | B | 77 | 2008-03-17
17 | Jaya | F | A | 46 | 2009-11-14
18 | Harsh | M | A | 56 | 2008-04-22
19 | Nikhil | M | B | 62 | 2009-03-18
(a) How many rows does SELECT * FROM STUDENT WHERE Gender = 'F' AND Section NOT IN ('A', 'C'); return?
(b) What is the output of SELECT Name FROM STUDENT WHERE Marks >= 62 ORDER BY Marks DESC; Write the names in order.
(c) How many rows does SELECT DISTINCT Gender FROM STUDENT; return?
19.
Table: ITEM
ItemCode | IName | Category | Price | Qty
I204 | Torch | Daily Use | 310 | 40
I223 | Gel Pen | Stationery | 20 | 60
I225 | Marker | Stationery | 40 | 50
I230 | File Folder | Office | 30 | 35
I238 | Notebook | Stationery | 65 | 25
I239 | Eraser | Stationery | 5 | 20
I241 | Water Bottle | Daily Use | 180 | 0
I245 | Ruler | Stationery | 10 | 45
Write SQL queries to: (a) display all the columns of the rows where Price is more than 40 (b) display IName and Price where Price is from 10 to 180 (both included), the largest Price first (c) display the IName of every row whose IName starts with R.
20.
Table: ITEM
ItemCode | IName | Category | Price | Qty
I202 | Stapler | Office | 140 | 5
I207 | Umbrella | Daily Use | 200 | 40
I209 | Water Bottle | Daily Use | 170 | 0
I210 | Paper Clips | Office | 20 | 55
I221 | File Folder | Office | 30 | 60
I235 | Lunch Box | Daily Use | 310 | 40
I259 | School Bag | Daily Use | 550 | 55
These statements run one after the other:
UPDATE ITEM SET Price = Price + 15 WHERE Category = 'Daily Use';
DELETE FROM ITEM WHERE Qty BETWEEN 55 AND 60;
SELECT IName FROM ITEM WHERE Price > 185 ORDER BY Price;
(a) How many rows does the UPDATE change? (b) How many rows are left after the DELETE? (c) Write the output of the SELECT, names separated by commas, in order.
AmbifulWorksheets
Practice that never repeats
CBSE · Class 11 · Informatics Practices

Answer key

Introduction to Structured Query Language (SQL) · AW-11IP-SQL-2026-V1 · For parents — fold back or tear off before handing the sheet to your child.

QAnswerWorking
1(d) DDL commands—
2(a) 4check the WHERE condition on every row; a NULL never satisfies a comparison
3(c) Glue Stickascending: smallest first, NULL first; order: Glue Stick, Paper Clips, File Folder, Stapler, Torch, Water Bottle, Umbrella, School Bag
4(b) Naina% stands for any run of characters and _ for exactly one; the pattern means the name has a as its second letter
5(b) DML (Data Manipulation Language)CREATE, ALTER and DROP define structure; INSERT, UPDATE and DELETE change data; SELECT queries it
6(c) 32000the row does not match the WHERE condition, so it is unchanged
7(d) 63 rows match the condition and go; 9 − 3
8(d) DATEDATE holds values like '2009-04-12'
9It is easy to learn with English-like commands, and it works with almost every relational DBMS to create, change and query data.—
10Zoya, Lakshmi, Manav, Sanakept rows sorted by Salary from smallest
11A, BDISTINCT shows each value once; ORDER BY sorts them
12Lunch Box, Umbrella, Water BottleIN keeps a row whose value is any one in the list; ORDER BY Name sorts alphabetically
131BETWEEN includes both end values
14(a) 6; (b) 4degree = columns shown; cardinality = rows kept
15(a) 1; (b) 8; (c) 0= NULL is never TRUE, so (c) returns no rows
16(a) 2; (b) 31000rows matching: Nikhil, Sahil
17CREATE TABLE STUDENT (RollNo INT PRIMARY KEY, Name VARCHAR(20) NOT NULL, Section CHAR(1), Marks INT, DOB DATE); INSERT INTO STUDENT VALUES (1, "Asha", "A", 78, "2009-04-12");—
18(a) 1; (b) Pooja, Aarav, Nikhil; (c) 2(c) distinct values: M, F
19(a) SELECT * FROM ITEM WHERE Price > 40; (b) SELECT IName, Price FROM ITEM WHERE Price BETWEEN 10 AND 180 ORDER BY Price DESC; (c) SELECT IName FROM ITEM WHERE IName LIKE 'R%';they return 3, 6 and 1 rows
20(a) 4; (b) 4; (c) Umbrella, Lunch Boxthe DELETE checks the updated values; 3 rows removed