★★★★★
"The one step solution for my son. Modern Age Coders make learning coding so simple that kids love it. The teachers explain complex concepts clearly with practical exercises and interactive content."
Ria Mukherjee
Parent
CBSE Class 11 · Informatics Practices 065 · Session 2026-27
Here is a whole Class 11 IP practical file in two halves. The Python half follows the 17 programs CBSE suggests and adds one on NumPy. The SQL half builds a single student table and takes it from CREATE DATABASE to DROP. Each entry has its aim, the code, the screen we got when we ran it, and a line on why it works.
Live online · Python 3.14 and MySQL 26.10 runs · viva with answers · you choose the days · first class free
Start here
The first course teaches 065 itself, so the file fills up as chapters are taught. The other two are for a student who wants more of one half.

065 / Class 11 and 12
Python, NumPy, MySQL and theory for Class 11, then pandas and charts for Class 12, with practical file and viva work in both years.
Open the course →
Python half / Teens
For a student who can run the 18 programs here and would like to build games, web apps and a capstone next.
Open the course →
SQL half / Teens
Starts with the first SELECT and goes on to joins and small database apps, which is where Class 12 IP leads.
Open the course →Ans. The short version
A Class 11 IP practical file for CBSE Informatics Practices (065) needs a minimum of 14 Python programs and 14 SQL queries in 2026-27, and it carries 7 of the 30 practical marks. The rest are Python problem solving 11, MySQL 7 and viva 5. Each entry normally has an aim, the code and the output. This page gives 18 Python programs, including NumPy, and 20 SQL entries that cover the full official list, all actually run. In live one to one classes a student builds their own file with a teacher; a priority demo lets you try one full class first.
How much is enough?
Fourteen Python programs and fourteen SQL queries is the minimum in the CBSE Class XI document for 2026-27. Going a little over is safer: if your teacher strikes out one entry, you are still above the line.
| Part of the practical | Marks | What you are asked to do |
|---|---|---|
| Problem solving in Python | 11 | Write and run programs in the lab |
| Creating a database in MySQL and performing queries | 7 | Make a table, fill it, ask it questions |
| Practical file | 7 | 14 Python programs and 14 SQL queries or more |
| Viva voce | 5 | Answer aloud about your file and the syllabus |
| Total | 30 | With 70 marks of theory, 100 in all |
There is no project in Class 11 IP: the table above already adds to 30. CBSE suggests 17 Python programs and 6 SQL tasks. So the Python side can be met from the official list alone, but the SQL side cannot, and the extra queries have to come from the commands in Unit 3. That is why entries 7 to 20 of the SQL half exist.
Two limits kept this file honest. Class 11 IP does not list user-defined functions, data files or exception handling, so no program uses them. Its SELECT topics are WHERE with relational operators, BETWEEN, logical operators and the two NULL tests, so you will not find LIKE, GROUP BY or joins either. If your school teaches extra clauses, add them at the end.
What does it look like?
A cover, a certificate, an acknowledgement and an index come first, then the Python part, then the SQL part. CBSE prints no fixed design, so use your school’s if you were given one.
School name and year 2026-27 at the top. Practical File, Informatics Practices (065) in the middle. Your name, Class XI, section, roll number and your teacher’s name below.
“This file contains the Python programs and SQL queries that [name], Class XI [section], roll number [number], wrote and ran in the school laboratory in 2026-27 for Informatics Practices (065).” Leave three blanks: date, internal examiner, principal.
Three lines will do: thank the teacher who explained the lab work, the lab assistant who kept the computers running, and anyone at home who listened to you explain a program. Sign and date it.
| No. | Program | Source |
|---|---|---|
| 1 | Average and grade | CBSE list, 1 |
| 2 | Sale price after discount | List, 2 |
| 3 | Perimeter and area of shapes | List, 3 |
| 4 | Simple and compound interest | List, 4 |
| 5 | Profit or loss | List, 5 |
| 6 | EMI of a loan | List, 6 |
| 7 | Income tax by slabs | List, 7 |
| 8 | Largest and smallest in a list | List, 8 |
| 9 | Third largest and third smallest | List, 9 |
| 10 | Sum of squares of 1 to 100 | List, 10 |
| 11 | First n multiples | List, 11 |
| 12 | Vowels in a string | List, 12 |
| 13 | Words starting with a letter | List, 13 |
| 14 | A letter counted in each string | List, 14 |
| 15 | States and capitals | List, 15 |
| 16 | Marks in five subjects | List, 16 |
| 17 | Highest and lowest in a dictionary | List, 17 |
| 18 | NumPy arrays from lists | Unit 2 topic |
| No. | Query | Source |
|---|---|---|
| 1 | Create a database | CBSE list, 1 |
| 2 | Create the student table | List, 2 |
| 3 | Insert ten students | List, 3 |
| 4 | Display the whole table | List, 4 |
| 5 | Marks more than 50 | List, 5 |
| 6 | Born in a given year | List, 6 |
| 7 | Not equal to | Relational operator |
| 8 | Two conditions with AND | Logical operator |
| 9 | Either condition with OR | Logical operator |
| 10 | Why brackets matter | Logical operators |
| 11 | NOT with BETWEEN | Logical operator |
| 12 | NULL tests | IS NULL, IS NOT NULL |
| 13 | Add a column | ALTER |
| 14 | Fill the column | UPDATE |
| 15 | Raise some marks | UPDATE |
| 16 | Change a data type | ALTER |
| 17 | A repeated primary key | INSERT and keys |
| 18 | Delete a row | DELETE |
| 19 | Drop a column, add a key | ALTER |
| 20 | Drop a table and a database | DROP |
In your copy, put Date and Signature in place of the third column. Students who take 083 instead need a Python-only file: that one is on the Class 11 CS practical file page.
Part A, entries 1 to 7
The first seven need only input, arithmetic, if-elif-else and one loop. On the screens, the text after each prompt was typed by us; an empty line separates two runs.
Aim: To find the average and the grade for given marks.
# Program 1: average and grade
subjects = ["English", "IP", "Maths"]
marks = []
for name in subjects:
marks.append(float(input(name + ": ")))
average = sum(marks) / len(marks)
if min(marks) < 33:
grade = "E, one subject is below 33"
elif average >= 85:
grade = "A"
elif average >= 70:
grade = "B"
else:
grade = "C"
print("Average:", round(average, 2))
print("Grade :", grade)
English: 84 IP: 91 Maths: 83 Average: 86.0 Grade : A English: 72 IP: 95 Maths: 30 Average: 65.67 Grade : E, one subject is below 33
Why it works: the subjects sit in a list, so a fourth subject means editing one line. The test on min(marks) comes first: a low mark in one subject must not be hidden by a good average. The bands are ours, so use your school’s.
Aim: To find the sale price of an item from its cost and discount per cent.
# Program 2: sale price after discount
cost = float(input("Cost on the tag: "))
percent = float(input("Discount in % : "))
if percent < 0 or percent > 100:
print("Discount must be 0 to 100")
else:
sale = cost * (100 - percent) / 100
print("Sale price :", sale)
print("You save :", cost - sale)
# the same percent given in two halves
half = percent / 2
twice = cost * (100 - half) / 100
twice = twice * (100 - half) / 100
print("In 2 halves :", round(twice, 2))
Cost on the tag: 1850 Discount in % : 30 Sale price : 1295.0 You save : 555.0 In 2 halves : 1336.62 Cost on the tag: 640 Discount in % : 130 Discount must be 0 to 100
Why it works: paying 70 out of every 100 is the same as multiplying by (100 - 30) / 100. The last line answers a shop question: 15% and then 15% again is less than 30%, because the second cut is on a smaller price.
Aim: To calculate the perimeter or circumference and the area of a triangle, rectangle, square or circle.
# Program 3: perimeter and area of shapes
print("1 Triangle 2 Rectangle")
print("3 Square 4 Circle")
choice = int(input("Your choice: "))
if choice == 1:
a = float(input("First side : "))
b = float(input("Second side: "))
c = float(input("Third side : "))
longest = max([a, b, c])
if 2 * longest >= a + b + c:
print("Not a triangle")
else:
s = (a + b + c) / 2
area = (s*(s-a)*(s-b)*(s-c)) ** 0.5
print("Perimeter:", a + b + c)
print("Area :", round(area, 2))
elif choice == 2:
length = float(input("Length : "))
width = float(input("Breadth: "))
print("Perimeter:", 2*(length + width))
print("Area :", length * width)
elif choice == 3:
side = float(input("Side: "))
print("Perimeter:", 4 * side)
print("Area :", side ** 2)
elif choice == 4:
radius = float(input("Radius: "))
pi = 3.14159
around = 2 * pi * radius
area = pi * radius ** 2
print("Around :", round(around, 2))
print("Area :", round(area, 2))
else:
print("Choose a number from 1 to 4")
1 Triangle 2 Rectangle 3 Square 4 Circle Your choice: 1 First side : 9 Second side: 10 Third side : 17 Perimeter: 36.0 Area : 36.0 1 Triangle 2 Rectangle 3 Square 4 Circle Your choice: 4 Radius: 2.8 Around : 17.59 Area : 24.63 1 Triangle 2 Rectangle 3 Square 4 Circle Your choice: 1 First side : 3 Second side: 4 Third side : 8 Not a triangle
Why it works: for a triangle the longest side must be shorter than the other two together, which the first test checks. Heron’s formula then uses half the perimeter, and ** 0.5 is a square root without importing anything.
Aim: To calculate simple interest and compound interest, yearly.
# Program 4: simple and compound interest
principal = float(input("Principal : "))
rate = float(input("Rate % a year: "))
years = int(input("Years : "))
simple = principal * rate * years / 100
balance = principal
for year in range(1, years + 1):
interest = balance * rate / 100
balance = balance + interest
print("Year", year, round(interest, 2))
print("Simple interest :", simple)
compound = round(balance - principal, 2)
print("Compound interest:", compound)
Principal : 24000 Rate % a year: 7.5 Years : 4 Year 1 1800.0 Year 2 1935.0 Year 3 2080.12 Year 4 2236.13 Simple interest : 7200.0 Compound interest: 8051.26
Why it works: the loop adds each year’s interest to the balance, so the next year earns on more. Year 1 equals the simple interest of one year, and the gap opens from year 2.
Aim: To calculate profit or loss from cost price and selling price.
# Program 5: profit or loss on a stock
quantity = int(input("Boxes bought : "))
cost = float(input("Cost of a box : "))
price = float(input("Sold a box for: "))
difference = (price - cost) * quantity
if cost <= 0:
print("Cost must be more than zero")
elif difference == 0:
print("Neither profit nor loss")
else:
word = "Profit"
if difference < 0:
word = "Loss"
difference = -difference
spent = cost * quantity
percent = difference / spent * 100
print(word, "of", difference, "in all")
print(word, "%:", round(percent, 1))
Boxes bought : 25 Cost of a box : 160 Sold a box for: 184 Profit of 600.0 in all Profit %: 15.0 Boxes bought : 12 Cost of a box : 75 Sold a box for: 69 Loss of 72.0 in all Loss %: 8.0
Why it works: one variable keeps the word and another the size, so the printing lines are written once. Turning a negative difference positive avoids “Loss of -72”.
Aim: To calculate the equated monthly instalment for an amount, period and rate of interest.
# Program 6: EMI and the first 3 months
amount = float(input("Loan amount : "))
years = int(input("Period in years: "))
yearly = float(input("Interest % year: "))
months = years * 12
rate = yearly / 12 / 100
growth = (1 + rate) ** months
emi = amount * rate * growth / (growth - 1)
print("EMI:", round(emi, 2), "x", months)
balance = amount
for month in range(1, 4):
interest = balance * rate
balance = balance - (emi - interest)
print("Month", month, round(interest,2))
print("Still to pay:", round(balance, 2))
Loan amount : 90000 Period in years: 2 Interest % year: 12 EMI: 4236.61 x 24 Month 1 900.0 Month 2 866.63 Month 3 832.93 Still to pay: 79889.73
Why it works: the yearly rate is divided by 12 and by 100 because the formula wants a monthly fraction. The loop shows how interest shrinks each month while the instalment stays the same.
Aim: To calculate income tax when different slabs have different rates.
# Program 7: income tax on practice slabs
# width of each slab, and its rate in %
widths = [300000, 400000, 300000]
rates = [0, 5, 10]
top_rate = 20
income = float(input("Taxable income: "))
left = income
tax = 0
for i in range(len(widths)):
part = min(left, widths[i])
tax += part * rates[i] / 100
left = left - part
tax = tax + left * top_rate / 100
print("Income tax :", tax)
print("After tax :", income - tax)
Taxable income: 880000 Income tax : 38000.0 After tax : 842000.0 Taxable income: 1250000 Income tax : 100000.0 After tax : 1150000.0 Taxable income: 240000 Income tax : 0.0 After tax : 240000.0
Why it works: min(left, width) takes only the part of the income that falls inside a slab. For 880000 the parts are 300000, 400000 and 180000, taxed at 0, 5 and 10 per cent: 0 + 20000 + 18000. The slabs are for practice and are not the real tax table.
Part A, entries 8 to 14
These seven are about walking through something one item at a time: a list, a run of numbers or the characters of a string.
Aim: To find the largest and the smallest number in a list.
# Program 8: largest and smallest in a list
units = []
flats = int(input("How many flats? "))
for i in range(flats):
used = int(input("Units used: "))
units.append(used)
largest = smallest = units[0]
for u in units:
if u > largest:
largest = u
if u < smallest:
smallest = u
print(units)
print("Largest :", largest)
print("Smallest:", smallest)
print("Check :", max(units), min(units))
How many flats? 5 Units used: 212 Units used: 187 Units used: 340 Units used: 95 Units used: 340 [212, 187, 340, 95, 340] Largest : 340 Smallest: 95 Check : 340 95
Why it works: both answers start as the first item, not as 0; a list of negative numbers would otherwise report 0. The last line confirms the loop with max() and min(). At least one flat is needed.
Aim: To find the third largest and the third smallest number in a list.
# Program 9: third largest and smallest
times = [58, 41, 73, 62, 66, 41, 80, 80]
# work on copies, so times is not changed
high = list(times)
low = list(times)
for turn in range(2):
biggest = max(high)
while high.count(biggest) > 0:
high.remove(biggest)
least = min(low)
while low.count(least) > 0:
low.remove(least)
print("All :", times)
print("Left:", high)
print("Third largest :", max(high))
print("Third smallest:", min(low))
All : [58, 41, 73, 62, 66, 41, 80, 80] Left: [58, 41, 62, 66, 41] Third largest : 66 Third smallest: 62
Why it works: 80 occurs twice, so it must be removed as many times as it appears before 73 becomes the top. Copies made with list() protect the original. The list needs at least three different numbers.
Aim: To find the sum of squares of the first 100 natural numbers.
# Program 10: 1*1 + 2*2 + ... + 100*100
total = 0
number = 1
while number <= 100:
total += number * number
if number % 25 == 0:
print("1 to", number, "is", total)
number += 1
print("Answer:", total)
1 to 25 is 5525 1 to 50 is 42925 1 to 75 is 143450 1 to 100 is 338350 Answer: 338350
Why it works: the while loop prints a progress line at every multiple of 25. The four lines let you check the first one by hand with a calculator before trusting the last.
Aim: To print the first n multiples of a given number.
# Program 11: first n multiples in a list
number = int(input("Multiples of: "))
n = int(input("How many : "))
multiples = []
value = number
while len(multiples) < n:
multiples.append(value)
value += number
print(multiples)
print("Backwards:", multiples[::-1])
print("Total :", sum(multiples))
Multiples of: 13 How many : 6 [13, 26, 39, 52, 65, 78] Backwards: [78, 65, 52, 39, 26, 13] Total : 273
Why it works: there is no multiplication: adding 13 again and again gives the same list. The loop stops on the length of the list, so it makes exactly n items.
Aim: To count the vowels in a string entered by the user.
# Program 12: vowels in a string
text = input("Enter a line: ")
vowels = {"a": 0, "e": 0, "i": 0,
"o": 0, "u": 0}
for ch in text.lower():
if ch in vowels:
vowels[ch] += 1
print("Vowels:", sum(vowels.values()))
for v in vowels:
if vowels[v] > 0:
print(v, "x", vowels[v])
Enter a line: Our Garden Grows Okra Vowels: 7 a x 2 e x 1 o x 3 u x 1 Enter a line: Rhythm Vowels: 0
Why it works: the dictionary does two jobs, as it decides what counts as a vowel and keeps the score. in looks at keys. Rhythm scores 0, since y is not a key.
Aim: To print the words of a sentence that start with a given letter.
# Program 13: words starting with a letter
line = input("Sentence: ") + " "
letter = input("Letter : ").lower()
word = ""
found = 0
for ch in line:
if ch != " ":
word = word + ch # inside a word
else:
if word != "":
if word[0].lower() == letter:
print(word)
found += 1
word = "" # start afresh
if found == 0:
print("No word starts with", letter)
Sentence: Sita sells six shells in Surat Letter : s Sita sells six shells Surat Sentence: Rain fell all night Letter : z No word starts with z
Why it works: a space added at the end makes sure the last word is also closed. The double space in the first run creates an empty word, which the test word != "" skips.
Aim: To print how many times a given letter occurs in each of several strings.
# Program 14: a letter in each string
rivers = ["Narmada", "Godavari",
"Teesta", "Chambal"]
letter = input("Letter to look for: ")
grand = 0
for river in rivers:
times = 0
for ch in river.lower():
if ch == letter:
times += 1
print(river, "*" * times, times)
grand += times
print("In all the strings:", grand)
Letter to look for: a Narmada *** 3 Godavari ** 2 Teesta * 1 Chambal ** 2 In all the strings: 8
Why it works: the counter times is set to 0 inside the outer loop, so every river starts fresh, while grand is set outside and survives. Type the letter in lower case.
For a second way to solve the same aims, so that two friends do not hand in one program, see Python programs for Class 11 on the blog.
Part A, entries 15 to 18
Three dictionary programs end the CBSE list. The fourth entry covers the NumPy line of the syllabus, which the suggested list leaves out.
Aim: To create a dictionary of states and capitals.
# Program 15: states and their capitals
capital = {"Assam": "Dispur",
"Manipur": "Imphal"}
capital.update({"Sikkim": "Gangtok",
"Goa": "Panaji"})
capital["Mizoram"] = "Aizawl" # new pair
state = input("State: ")
if state in capital:
print("Capital:", capital[state])
else:
capital[state] = input("Its capital: ")
del capital["Goa"]
print(len(capital), "states now")
for state, city in capital.items():
print(state, "->", city)
State: Sikkim Capital: Gangtok 4 states now Assam -> Dispur Manipur -> Imphal Sikkim -> Gangtok Mizoram -> Aizawl State: Bihar Its capital: Patna 5 states now Assam -> Dispur Manipur -> Imphal Sikkim -> Gangtok Mizoram -> Aizawl Bihar -> Patna
Why it works: update() adds two pairs, square brackets add one, and del removes Goa. A state that is missing is added with the same square brackets that read it.
Aim: To store names and marks in five subjects for n students in a dictionary.
# Program 16: marks in five subjects
subjects = ["Eng", "IP", "Acc",
"BSt", "Eco"]
record = {}
n = int(input("Students: "))
for i in range(n):
name = input("Name: ")
marks = []
for s in subjects:
marks.append(int(input(s + ": ")))
record[name] = marks
for name in record:
print(name, record[name])
for k in range(5): # subject by subject
total = 0
for name in record:
total += record[name][k]
print(subjects[k], total / n)
Students: 2 Name: Yusra Eng: 71 IP: 88 Acc: 64 BSt: 79 Eco: 90 Name: Kabir Eng: 66 IP: 93 Acc: 70 BSt: 58 Eco: 81 Yusra [71, 88, 64, 79, 90] Kabir [66, 93, 70, 58, 81] Eng 68.5 IP 90.5 Acc 67.0 BSt 68.5 Eco 85.5
Why it works: each value is a list of five marks. record[name][k] reads as: the list of this name, then position k. The second loop runs subject by subject, so it answers what a teacher asks: which subject was weak?
Aim: To print the highest and the lowest values in a dictionary.
# Program 17: highest and lowest values
rain = {"Agumbe": 41, "Jaisalmer": 0,
"Puri": 18, "Mawsynram": 67,
"Leh": 0}
first = True
for place in rain:
mm = rain[place]
if first:
high = low = mm
first = False
elif mm > high:
high = mm
elif mm < low:
low = mm
print("Highest", high, "lowest", low, "mm")
for place in rain:
if rain[place] == high:
print("Wettest:", place)
if rain[place] == low:
print("Driest :", place)
Highest 67 lowest 0 mm Driest : Jaisalmer Wettest: Mawsynram Driest : Leh
Why it works: the first value seen becomes both answers. A second loop prints every place with that value, since Jaisalmer and Leh tie at 0 and both deserve a line.
Aim: To create NumPy arrays from lists and compare them with lists.
# Program 18: NumPy arrays from lists
import numpy as np
steps = [4200, 6100, 5300]
week = np.array(steps)
print(week, week.dtype)
print("List twice :", len(steps * 2))
print("Array twice:", week * 2)
mixed = np.array([3, 4.5, 6]) # one float
print(mixed, mixed.dtype)
rows = [[12, 15], [9, 11], [14, 10]]
seats = np.array(rows)
print(seats)
print("Rows and columns:", seats.shape)
[4200 6100 5300] int64 List twice : 6 Array twice: [ 8400 12200 10600] [3. 4.5 6. ] float64 [[12 15] [ 9 11] [14 10]] Rows and columns: (3, 2)
Why it works: a list times 2 has twice as many items, but an array times 2 has doubled values. One float turns the whole array to float, because an array holds one data type. The int64 shown can be int32 on some computers.
Part B, entries 1 to 12
Entries 1 to 6 answer the six CBSE tasks in their own order; 7 to 12 use the other WHERE operators of Unit 3. Run on MySQL 26.10 with the time of each query left out.
Aim: To create a database and open it.
CREATE DATABASE ip_lab; USE ip_lab;
Query OK, 1 row affected Database changed
Notice: CREATE makes it, USE enters it. Forgetting USE is the usual reason for “No database selected”.
Aim: To create a student table with student id as the primary key.
CREATE TABLE student ( sid INT PRIMARY KEY, class CHAR(2), section CHAR(1), gender CHAR(1), name VARCHAR(20) NOT NULL, dob DATE, marks INT ); DESC student;
Query OK, 0 rows affected +---------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +---------+-------------+------+-----+---------+-------+ | sid | int | NO | PRI | NULL | | | class | char(2) | YES | | NULL | | | section | char(1) | YES | | NULL | | | gender | char(1) | YES | | NULL | | | name | varchar(20) | NO | | NULL | | | dob | date | YES | | NULL | | | marks | int | YES | | NULL | | +---------+-------------+------+-----+---------+-------+ 7 rows in set
Notice: under Key the word PRI marks sid, and its Null column says NO although we never wrote NOT NULL there. A primary key brings that rule with it.
Aim: To insert the details of at least ten students.
INSERT INTO student VALUES (1, 'XI', 'A', 'F', 'Aarohi', '2005-03-18', 78), (2, 'XI', 'A', 'M', 'Bhavesh', '2004-11-02', 49), (3, 'XI', 'B', 'F', 'Charvi', '2005-12-31', 50), (4, 'XI', 'B', 'M', 'Devansh', '2006-01-01', 91), (5, 'XI', 'A', 'F', 'Esha', '2005-01-01', 66), (6, 'XI', 'C', 'M', 'Faizan', '2005-07-24', 35), (7, 'XI', 'C', 'F', 'Gurleen', '2006-02-15', 84), (8, 'XI', 'B', 'M', 'Harshit', '2004-09-09', 51), (9, 'XI', 'C', 'F', 'Ilma', '2005-10-06', 73); INSERT INTO student (sid, class, section, gender, name) VALUES (10, 'XI', 'A', 'M', 'Jatin');
Query OK, 9 rows affected Records: 9 Duplicates: 0 Warnings: 0 Query OK, 1 row affected
Notice: dates go inside quotes as year-month-day. The tenth row names its columns and leaves two out, so Jatin has NULL in dob and marks. That NULL is useful from here on.
Aim: To display the entire content of the table.
SELECT * FROM student;
+-----+-------+---------+--------+---------+------------+-------+ | sid | class | section | gender | name | dob | marks | +-----+-------+---------+--------+---------+------------+-------+ | 1 | XI | A | F | Aarohi | 2005-03-18 | 78 | | 2 | XI | A | M | Bhavesh | 2004-11-02 | 49 | | 3 | XI | B | F | Charvi | 2005-12-31 | 50 | | 4 | XI | B | M | Devansh | 2006-01-01 | 91 | | 5 | XI | A | F | Esha | 2005-01-01 | 66 | | 6 | XI | C | M | Faizan | 2005-07-24 | 35 | | 7 | XI | C | F | Gurleen | 2006-02-15 | 84 | | 8 | XI | B | M | Harshit | 2004-09-09 | 51 | | 9 | XI | C | F | Ilma | 2005-10-06 | 73 | | 10 | XI | A | M | Jatin | NULL | NULL | +-----+-------+---------+--------+---------+------------+-------+ 10 rows in set
Notice: the star means all columns. With no WHERE, all ten rows come back.
Aim: To display Rno, name and marks of students scoring more than 50.
SELECT sid AS Rno, name, marks FROM student WHERE marks > 50;
+-----+---------+-------+ | Rno | name | marks | +-----+---------+-------+ | 1 | Aarohi | 78 | | 4 | Devansh | 91 | | 5 | Esha | 66 | | 7 | Gurleen | 84 | | 8 | Harshit | 51 | | 9 | Ilma | 73 | +-----+---------+-------+ 6 rows in set
Notice: Charvi has exactly 50 and is out. The CBSE task says Rno while the table says student id, so AS Rno renames the heading in the result only.
Aim: To display Rno, name and dob of students born between 2005-01-01 and 2005-12-31.
SELECT sid AS Rno, name, dob FROM student
WHERE dob BETWEEN '2005-01-01'
AND '2005-12-31';
+-----+--------+------------+ | Rno | name | dob | +-----+--------+------------+ | 1 | Aarohi | 2005-03-18 | | 3 | Charvi | 2005-12-31 | | 5 | Esha | 2005-01-01 | | 6 | Faizan | 2005-07-24 | | 9 | Ilma | 2005-10-06 | +-----+--------+------------+ 5 rows in set
Notice: BETWEEN includes both ends: Esha on 1 January and Charvi on 31 December are in, Devansh one day later is out. The 2005 dates are printed in the CBSE task, so we kept them.
Aim: To display students who are not in section A.
SELECT name, section FROM student WHERE section <> 'A';
+---------+---------+ | name | section | +---------+---------+ | Charvi | B | | Devansh | B | | Faizan | C | | Gurleen | C | | Harshit | B | | Ilma | C | +---------+---------+ 6 rows in set
Notice: <> and != mean the same in MySQL.
Aim: To display girls with marks of 75 or more.
SELECT name, gender, marks FROM student WHERE gender = 'F' AND marks >= 75;
+---------+--------+-------+ | name | gender | marks | +---------+--------+-------+ | Aarohi | F | 78 | | Gurleen | F | 84 | +---------+--------+-------+ 2 rows in set
Notice: both conditions must be true. Ilma is a girl with 73, so one condition fails and she is left out.
Aim: To display students of section C or with marks below 50.
SELECT name, section, marks FROM student WHERE section = 'C' OR marks < 50;
+---------+---------+-------+ | name | section | marks | +---------+---------+-------+ | Bhavesh | A | 49 | | Faizan | C | 35 | | Gurleen | C | 84 | | Ilma | C | 73 | +---------+---------+-------+ 4 rows in set
Notice: Faizan meets both conditions and still appears once. OR asks about a row; it does not add rows up.
Aim: To display students of sections A and B with marks above 60, first without brackets and then with them.
SELECT name, section, marks FROM student
WHERE section = 'A' OR section = 'B'
AND marks > 60;
SELECT name, section, marks FROM student
WHERE (section = 'A' OR section = 'B')
AND marks > 60;
+---------+---------+-------+ | name | section | marks | +---------+---------+-------+ | Aarohi | A | 78 | | Bhavesh | A | 49 | | Devansh | B | 91 | | Esha | A | 66 | | Jatin | A | NULL | +---------+---------+-------+ 5 rows in set +---------+---------+-------+ | name | section | marks | +---------+---------+-------+ | Aarohi | A | 78 | | Devansh | B | 91 | | Esha | A | 66 | +---------+---------+-------+ 3 rows in set
Notice: AND is worked out before OR. Without brackets the marks test sticks to section B only, so every student of A enters, even 49 and NULL. The second query is the right one.
Aim: To display students whose marks are not from 40 to 80.
SELECT name, marks FROM student WHERE NOT marks BETWEEN 40 AND 80;
+---------+-------+ | name | marks | +---------+-------+ | Devansh | 91 | | Faizan | 35 | | Gurleen | 84 | +---------+-------+ 3 rows in set
Notice: Jatin is missing. His marks are NULL, so MySQL cannot say whether they are outside the range, and a row is shown only when the answer is true.
Aim: To find students with no marks, and those in section A whose dob is known.
SELECT sid, name FROM student WHERE marks IS NULL; SELECT name, dob FROM student WHERE dob IS NOT NULL AND section = 'A';
+-----+-------+ | sid | name | +-----+-------+ | 10 | Jatin | +-----+-------+ 1 row in set +---------+------------+ | name | dob | +---------+------------+ | Aarohi | 2005-03-18 | | Bhavesh | 2004-11-02 | | Esha | 2005-01-01 | +---------+------------+ 3 rows in set
Notice: marks = NULL never finds anything; IS NULL is the test to write.
Part B, entries 13 to 20
ALTER and DROP change structure, UPDATE and DELETE change rows. Entries run in this order on the table made above, so keep the order in your file too.
Aim: To add a column house to the student table.
ALTER TABLE student ADD house VARCHAR(10);
Query OK, 0 rows affected Records: 0 Duplicates: 0 Warnings: 0
Notice: the new column is NULL in all ten rows, and no row is counted as affected.
Aim: To give a house to every student and list those above 70.
UPDATE student SET house = 'Ganga' WHERE section = 'A'; UPDATE student SET house = 'Kaveri' WHERE house IS NULL; SELECT name, house FROM student WHERE marks > 70;
Query OK, 4 rows affected Rows matched: 4 Changed: 4 Warnings: 0 Query OK, 6 rows affected Rows matched: 6 Changed: 6 Warnings: 0 +---------+--------+ | name | house | +---------+--------+ | Aarohi | Ganga | | Devansh | Kaveri | | Gurleen | Kaveri | | Ilma | Kaveri | +---------+--------+ 4 rows in set
Notice: the second UPDATE needs no section: everyone without a house is exactly everyone left. The counts 4 and 6 add to ten, which is a quick check.
Aim: To give 3 grace marks to students below 50.
UPDATE student SET marks = marks + 3 WHERE marks < 50; SELECT name, marks FROM student WHERE section = 'C' OR section = 'A';
Query OK, 2 rows affected Rows matched: 2 Changed: 2 Warnings: 0 +---------+-------+ | name | marks | +---------+-------+ | Aarohi | 78 | | Bhavesh | 52 | | Esha | 66 | | Faizan | 38 | | Gurleen | 84 | | Ilma | 73 | | Jatin | NULL | +---------+-------+ 7 rows in set
Notice: two rows matched, 49 and 35. Jatin’s NULL is untouched. Leave out the WHERE and all marks rise, so write it before you press Enter.
Aim: To allow one decimal place in marks and enter 62.5 for the tenth student.
ALTER TABLE student MODIFY marks DECIMAL(5,1); UPDATE student SET marks = 62.5 WHERE sid = 10; SELECT name, marks FROM student WHERE sid = 10;
Query OK, 10 rows affected Records: 10 Duplicates: 0 Warnings: 0 Query OK, 1 row affected Rows matched: 1 Changed: 1 Warnings: 0 +-------+-------+ | name | marks | +-------+-------+ | Jatin | 62.5 | +-------+-------+ 1 row in set
Notice: DECIMAL(5,1) means five digits in all, one of them after the point. MySQL converted the ten existing rows.
Aim: To see what happens when a student id is used twice.
INSERT INTO student (sid, name) VALUES (7, 'Kavya'); SELECT sid, name FROM student WHERE sid = 7;
ERROR 1062 (23000): Duplicate entry '7' for key 'student.PRIMARY' +-----+---------+ | sid | name | +-----+---------+ | 7 | Gurleen | +-----+---------+ 1 row in set
Notice: MySQL refuses the row and Gurleen stays. The message is one line on the screen, broken in two here. An error entry is worth keeping in the file because the viva often starts from one.
Aim: To delete the student with id 2.
DELETE FROM student WHERE sid = 2; SELECT sid, name FROM student WHERE section = 'A';
Query OK, 1 row affected +-----+--------+ | sid | name | +-----+--------+ | 1 | Aarohi | | 5 | Esha | | 10 | Jatin | +-----+--------+ 3 rows in set
Notice: ids 3 to 10 do not move up. A primary key is a name for a row and not its position.
Aim: To remove the house column and to make code the primary key of a new table.
ALTER TABLE student DROP house;
CREATE TABLE club (code INT,
cname CHAR(10));
ALTER TABLE club ADD PRIMARY KEY (code);
DESC club;
Query OK, 0 rows affected Records: 0 Duplicates: 0 Warnings: 0 Query OK, 0 rows affected Query OK, 0 rows affected Records: 0 Duplicates: 0 Warnings: 0 +-------+----------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------+----------+------+-----+---------+-------+ | code | int | NO | PRI | NULL | | | cname | char(10) | YES | | NULL | | +-------+----------+------+-----+---------+-------+ 2 rows in set
Notice: DROP inside ALTER TABLE removes a column and all its values. ADD PRIMARY KEY works here because no two rows of the empty table can clash.
Aim: To remove the table club and then the database.
DROP TABLE club; DROP DATABASE ip_lab;
Query OK, 0 rows affected Query OK, 1 row affected
Notice: there is no question “are you sure?” and no undo. DELETE empties rows and keeps the table; DROP takes the table itself. Run this entry last.
The theory behind these commands, keys and degree included, is in the Class 11 IP notes.
Five marks, spoken
Mostly your own file, then the ideas under it. CBSE publishes no viva list, so prepare by opening a random entry and explaining it. These sixteen are a start.
float(input()) in Python 1 and int(input()) in Python 8? Marks may have a decimal part; units of electricity here do not. Both are needed because input() gives a string.largest = smallest = units[0] do? It gives both names the same first value in one statement.list()? high = times would make a second name for the same list, and every remove would damage the original.remove() different from pop()? remove() takes a value and deletes its first occurrence. pop() takes a position, deletes that item and returns it.range(1, 101) is shorter because the count is known.WHERE marks = NULL return? No rows, whatever the table holds.Your towns, your subjects, your table of ten friends or ten plants. The output changes with it, and so the entry becomes your work.
A triangle that cannot exist, a repeated key, a discount of 130. It shows the examiner you tested.
Select the grid in the MySQL window and paste it in a fixed-width font such as Courier New, so the lines stay straight.
Join both parts in one document, put page numbers in the index, then export. If you want this page as a PDF for reference, print it from the browser and choose Save as PDF.
Next: test the theory with the Class 11 IP sample paper, or look ahead at what the file becomes in Class 12 IP, where pandas takes over. Undecided about the subject itself? Compare CS and IP in Class 11.
One student, one teacher
Our IP classes are personalised one to one. To see one before deciding, book the priority demo: a paid, full live class at a slot of your choice, followed by a written skill report, with its fee set against your first month when you enrol. A free demo class is also available.
Before you enrol · Try a class
a full live class of about 45 to 60 minutes
The classes · Choose your own timing
₹4,999
per month, 4 private classes, fully flexible timingtwo private classes a week, at a time set with you
Most Class 11 students are steadier on one half of the file than the other, so the plan gives extra time to the weaker half. You pay by the month, there is no admission fee, and you may stop at any month end. The fee for your country is shown above.
Outside India
From Riyadh to Kuala Lumpur the 065 file has the same two halves and the same minimum of 14 and 14. We set the class by your evening.
| Where you live | Time difference | Usual class window, local time | Format |
|---|---|---|---|
| India every Indian city | Indian time | Any time you choose | Personalised 1-on-1 |
| UAE and Oman Dubai, Abu Dhabi, Sharjah, Muscat | 1 h 30 min behind India | 3:00 PM to 9:00 PM | Personalised 1-on-1 |
| Saudi Arabia, Qatar, Kuwait, Bahrain Riyadh, Jeddah, Dammam, Doha, Kuwait City, Manama | 2 h 30 min behind India | 3:00 PM to 9:00 PM | Personalised 1-on-1 |
| Nepal Kathmandu | 15 min ahead of India | 4:30 PM to 9:00 PM | Personalised 1-on-1 |
| Ethiopia and East Africa Addis Ababa and East Africa Time | 2 h 30 min behind India | 4:30 PM to 9:00 PM | Personalised 1-on-1 |
| Singapore and Malaysia Singapore, Kuala Lumpur | 2 h 30 min ahead of India | 3:30 PM to 9:00 PM | Personalised 1-on-1 |
Bring your school’s submission date to the first class, because each school fixes its own. General Class 11 tuition is described on the CBSE Class 11 page.
What families say
Real reviews from real families. We neither write nor commission them.
★★★★★
"The one step solution for my son. Modern Age Coders make learning coding so simple that kids love it. The teachers explain complex concepts clearly with practical exercises and interactive content."
Ria Mukherjee
Parent
★★★★★
"Modern Age Coders has been a game-changer for me. I struggled to grasp IT concepts and coding before joining, but their classes transformed everything. I can now confidently write complex programs with ease."
Samriddha Mondal
Student
★★★★★
"One of the most wonderful education centres out there. Education is not limited to school syllabus but focuses on skill development."
Vansh Agarwal
Student
★★★★★
"My child Dhairya is really enjoying the Modern Age Coders classes. This is his first online class and he eagerly looks forward to it. I can already see his improvement, and the teachers are very cooperative."
Sonam Oswal
Parent of Dhairya
★★★★★
"Modern Age Coders have wonderful teachers who teach in a clear, easy and practical way. The teacher boosts students' confidence and inspires them to learn without hesitation."
Sonu Goyal
Parent
★★★★★
"I highly recommend this computer coding class! The teachers are incredibly knowledgeable and passionate about coding."
Ritu Kedia
Parent
The rest of the Class 11 series
Every page in the CBSE Class 11 Computer Science, IP and AI series, grouped by what you need.
CBSE Class 12 Computer Science (083): Class 12 CS viva questions Class 12 CS sample paper practice Class 12 CS project with source code Class 12 CS important questions
CBSE Class 12 Informatics Practices (065): Class 12 IP practical file Class 12 IP project with source code Class 12 IP sample paper practice Class 12 IP important questions
CBSE Class 12 Information Technology (802): IT 802 practical and project file IT 802 Java notes and programs IT 802 notes
ISC Computer Science (868): ISC Class 12 CS syllabus 2027 ISC Class 12 CS practice paper ISC Class 12 practical questions solved ISC Boolean algebra and K-maps
Program lists with output: Python programs for Class 11 Python project ideas
File questions
CBSE asks for a minimum of 14 Python programs and 14 SQL queries in the Class XI Informatics Practices (065) curriculum for 2026-27. The file is worth 7 marks. The file on this page has 18 Python programs and 20 SQL entries, so you can leave a few out and still be above the minimum.
You can save this page as a PDF from your browser: choose Print, then Save as PDF. Please treat it as reference. Schools expect a file with your own data and your own output, and the 5-mark viva quickly shows whether you ran the programs yourself.
The CBSE suggested list has 17: average and grade, sale price, shapes, simple and compound interest, profit and loss, EMI, tax, largest and smallest, third largest, sum of squares, multiples, vowels, words by first letter, letter counts, states and capitals, marks in five subjects, and highest and lowest dictionary values.
Six tasks are suggested: create a database, create a student table with student id as primary key, insert at least ten students, display the table, show those with marks above 50, and show those born between two dates in 2005. Since 14 queries are needed, add UPDATE, DELETE, ALTER and more WHERE conditions.
It is in the syllabus, as an introduction and creation of arrays from a list, but not in the suggested practical list. One short NumPy program is a sensible extra entry. Pandas and Matplotlib belong to Class 12.
No project is listed in the Class XI practical for 2026-27. The 30 marks are Python problem solving 11, MySQL 7, practical file 7 and viva 5. Project work of 5 marks appears in Class 12 IP. A school may still set a small task for its own internal use.
The CBSE document does not say handwritten or printed, so ask your teacher. Where both are allowed, printed code and output are easier to read, and a handwritten aim and explanation show that you understood the entry.
Any recent version works for these commands, as CREATE, ALTER, INSERT, UPDATE, DELETE, DROP and SELECT with WHERE behave in the same way. We ran this file on MySQL 26.10. Small details of the messages can differ from your screen.
Your school decides. Class 11 examinations, theory and practical, are conducted by the school and not by the board, so there is no common CBSE date. Ask separately for the date of file submission, which is often earlier.
Yes, in live one to one classes at your own days and time. The student types and runs each program and query while the teacher questions and corrects; we do not prepare a file on anyone’s behalf. You may begin with a priority demo or a free demo class.
Start
It may be a query that returns nothing or a loop that never ends. In a demo class your child works on it live, gets it to run, and explains the result in one or two sentences, as the viva will ask.
Choose a priority demo for a slot of your own and a written skill report afterwards; the fee counts towards the first month if you enrol. The free demo class is open to everyone.
WhatsApp us · +91 91233 66161 · connect@modernagecoders.com
Every class is live video. The form requests a callback and reserves nothing.
A full live class of about 45 to 60 minutes at a slot you pick, with a written skill report and learning roadmap on WhatsApp afterwards. The fee is adjusted against your first month if you enrol.
Book a priority demo