CBSE Class 11 · Informatics Practices 065 · Session 2026-27

Class 11 IP practical file: 18 Python programs, 20 SQL entries, viva.

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

Courses behind the two halves of the file

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.

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?

How many programs are required in the Class 11 IP practical file?

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 practicalMarksWhat you are asked to do
Problem solving in Python11Write and run programs in the lab
Creating a database in MySQL and performing queries7Make a table, fill it, ask it questions
Practical file714 Python programs and 14 SQL queries or more
Viva voce5Answer aloud about your file and the syllabus
Total30With 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?

Informatics Practices class 11 practical file: format and index

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.

Cover

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.

Certificate

“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.

Acknowledgement

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.

Index, part A: Python

Index, part B: SQL

No.QuerySource
1Create a databaseCBSE list, 1
2Create the student tableList, 2
3Insert ten studentsList, 3
4Display the whole tableList, 4
5Marks more than 50List, 5
6Born in a given yearList, 6
7Not equal toRelational operator
8Two conditions with ANDLogical operator
9Either condition with ORLogical operator
10Why brackets matterLogical operators
11NOT with BETWEENLogical operator
12NULL testsIS NULL, IS NOT NULL
13Add a columnALTER
14Fill the columnUPDATE
15Raise some marksUPDATE
16Change a data typeALTER
17A repeated primary keyINSERT and keys
18Delete a rowDELETE
19Drop a column, add a keyALTER
20Drop a table and a databaseDROP

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

Class 11 IP practical file Python programs 1 to 7: marks, shapes and money

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.

Python 1: average and grade

Aim: To find the average and the grade for given marks.

Python 1program
# 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)
Screen2 runs
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.

Python 2: sale price after discount

Aim: To find the sale price of an item from its cost and discount per cent.

Python 2program
# 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))
Screen2 runs
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.

Python 3: perimeter and area of shapes

Aim: To calculate the perimeter or circumference and the area of a triangle, rectangle, square or circle.

Python 3program
# 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")
Screen3 runs
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.

Python 4: simple and compound interest

Aim: To calculate simple interest and compound interest, yearly.

Python 4program
# 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)
Screenone run
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.

Python 5: profit or loss

Aim: To calculate profit or loss from cost price and selling price.

Python 5program
# 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))
Screen2 runs
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”.

Python 6: EMI of a loan

Aim: To calculate the equated monthly instalment for an amount, period and rate of interest.

Python 6program
# 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))
Screenone run
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.

Python 7: income tax by slabs

Aim: To calculate income tax when different slabs have different rates.

Python 7program
# 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)
Screen3 runs
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

Python programs 8 to 14: lists, loops and strings

These seven are about walking through something one item at a time: a list, a run of numbers or the characters of a string.

Python 8: largest and smallest in a list

Aim: To find the largest and the smallest number in a list.

Python 8program
# 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))
Screenone run
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.

Python 9: third largest and third smallest

Aim: To find the third largest and the third smallest number in a list.

Python 9program
# 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))
Screenone run
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.

Python 10: sum of squares

Aim: To find the sum of squares of the first 100 natural numbers.

Python 10program
# 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)
Screenone run
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.

Python 11: first n multiples

Aim: To print the first n multiples of a given number.

Python 11program
# 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))
Screenone run
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.

Python 12: vowels in a string

Aim: To count the vowels in a string entered by the user.

Python 12program
# 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])
Screen2 runs
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.

Python 13: words starting with a letter

Aim: To print the words of a sentence that start with a given letter.

Python 13program
# 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)
Screen2 runs
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.

Python 14: a letter counted in each string

Aim: To print how many times a given letter occurs in each of several strings.

Python 14program
# 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)
Screenone run
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

Python programs 15 to 18: dictionaries and NumPy

Three dictionary programs end the CBSE list. The fourth entry covers the NumPy line of the syllabus, which the suggested list leaves out.

Python 15: states and their capitals

Aim: To create a dictionary of states and capitals.

Python 15program
# 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)
Screen2 runs
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.

Python 16: marks in five subjects

Aim: To store names and marks in five subjects for n students in a dictionary.

Python 16program
# 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)
Screenone run
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?

Python 17: highest and lowest in a dictionary

Aim: To print the highest and the lowest values in a dictionary.

Python 17program
# 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)
Screenone run
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.

Python 18: NumPy arrays from lists

Aim: To create NumPy arrays from lists and compare them with lists.

Python 18program
# 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)
Screenone run
[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

Class 11 IP practical file SQL queries 1 to 12: build the table and ask it questions

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.

SQL 1: create a database

Aim: To create a database and open it.

Query set 1SQL
CREATE DATABASE ip_lab;
USE ip_lab;
MySQL saysresult
Query OK, 1 row affected
Database changed

Notice: CREATE makes it, USE enters it. Forgetting USE is the usual reason for “No database selected”.

SQL 2: create the student table

Aim: To create a student table with student id as the primary key.

Query set 2SQL
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;
MySQL saysresult
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.

SQL 3: insert ten students

Aim: To insert the details of at least ten students.

Query set 3SQL
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');
MySQL saysresult
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.

SQL 4: display the whole table

Aim: To display the entire content of the table.

Query set 4SQL
SELECT * FROM student;
MySQL saysresult
+-----+-------+---------+--------+---------+------------+-------+
| 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.

SQL 5: marks more than 50

Aim: To display Rno, name and marks of students scoring more than 50.

Query set 5SQL
SELECT sid AS Rno, name, marks
FROM student WHERE marks > 50;
MySQL saysresult
+-----+---------+-------+
| 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.

SQL 6: born in a given year

Aim: To display Rno, name and dob of students born between 2005-01-01 and 2005-12-31.

Query set 6SQL
SELECT sid AS Rno, name, dob FROM student
WHERE dob BETWEEN '2005-01-01'
          AND '2005-12-31';
MySQL saysresult
+-----+--------+------------+
| 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.

SQL 7: not equal to

Aim: To display students who are not in section A.

Query set 7SQL
SELECT name, section FROM student
WHERE section <> 'A';
MySQL saysresult
+---------+---------+
| 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.

SQL 8: two conditions with AND

Aim: To display girls with marks of 75 or more.

Query set 8SQL
SELECT name, gender, marks FROM student
WHERE gender = 'F' AND marks >= 75;
MySQL saysresult
+---------+--------+-------+
| 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.

SQL 9: either condition with OR

Aim: To display students of section C or with marks below 50.

Query set 9SQL
SELECT name, section, marks FROM student
WHERE section = 'C' OR marks < 50;
MySQL saysresult
+---------+---------+-------+
| 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.

SQL 10: why brackets matter

Aim: To display students of sections A and B with marks above 60, first without brackets and then with them.

Query set 10SQL
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;
MySQL saysresult
+---------+---------+-------+
| 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.

SQL 11: NOT with BETWEEN

Aim: To display students whose marks are not from 40 to 80.

Query set 11SQL
SELECT name, marks FROM student
WHERE NOT marks BETWEEN 40 AND 80;
MySQL saysresult
+---------+-------+
| 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.

SQL 12: NULL tests

Aim: To find students with no marks, and those in section A whose dob is known.

Query set 12SQL
SELECT sid, name FROM student
WHERE marks IS NULL;

SELECT name, dob FROM student
WHERE dob IS NOT NULL AND section = 'A';
MySQL saysresult
+-----+-------+
| 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

SQL queries 13 to 20: ALTER, UPDATE, DELETE and DROP

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.

SQL 13: add a column

Aim: To add a column house to the student table.

Query set 13SQL
ALTER TABLE student
ADD house VARCHAR(10);
MySQL saysresult
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.

SQL 14: fill the column

Aim: To give a house to every student and list those above 70.

Query set 14SQL
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;
MySQL saysresult
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.

SQL 15: raise some marks

Aim: To give 3 grace marks to students below 50.

Query set 15SQL
UPDATE student SET marks = marks + 3
WHERE marks < 50;

SELECT name, marks FROM student
WHERE section = 'C' OR section = 'A';
MySQL saysresult
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.

SQL 16: change a data type

Aim: To allow one decimal place in marks and enter 62.5 for the tenth student.

Query set 16SQL
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;
MySQL saysresult
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.

SQL 17: a repeated primary key

Aim: To see what happens when a student id is used twice.

Query set 17SQL
INSERT INTO student (sid, name)
VALUES (7, 'Kavya');

SELECT sid, name FROM student
WHERE sid = 7;
MySQL saysresult
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.

SQL 18: delete a row

Aim: To delete the student with id 2.

Query set 18SQL
DELETE FROM student WHERE sid = 2;

SELECT sid, name FROM student
WHERE section = 'A';
MySQL saysresult
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.

SQL 19: drop a column, add a key

Aim: To remove the house column and to make code the primary key of a new table.

Query set 19SQL
ALTER TABLE student DROP house;

CREATE TABLE club (code INT,
                   cname CHAR(10));
ALTER TABLE club ADD PRIMARY KEY (code);
DESC club;
MySQL saysresult
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.

SQL 20: drop a table and a database

Aim: To remove the table club and then the database.

Query set 20SQL
DROP TABLE club;
DROP DATABASE ip_lab;
MySQL saysresult
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

What can be asked in the Class 11 IP viva?

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.

About the Python half

  1. Why 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.
  2. What does largest = smallest = units[0] do? It gives both names the same first value in one statement.
  3. Why copy a list with list()? high = times would make a second name for the same list, and every remove would damage the original.
  4. How is remove() different from pop()? remove() takes a value and deletes its first occurrence. pop() takes a position, deletes that item and returns it.
  5. Which loop suits Python 10? Either. A for loop with range(1, 101) is shorter because the count is known.
  6. Can a dictionary have two equal keys? No. A second assignment to the same key replaces the value.
  7. Name one mutable and one immutable type. A list can change in place; a string cannot.
  8. What is an array in NumPy? A collection of values of one data type on which arithmetic works item by item.

About the SQL half

  1. What are the degree and cardinality after SQL 4? Degree 7, for seven columns; cardinality 10, for ten rows.
  2. And after SQL 18? Degree 8, because house was added, and cardinality 9.
  3. Why CHAR for section and VARCHAR for name? Every section has one letter. Names differ in length, and VARCHAR stores only what is typed.
  4. Could name be the primary key? Not safely. Two students may share a name, and a key must be unique in every row.
  5. Is NULL the same as 0? No. Zero is a mark that was scored; NULL says no mark is recorded.
  6. Which commands here are DDL? CREATE, ALTER and DROP. INSERT, UPDATE and DELETE are DML, and SELECT is the query part.
  7. What does WHERE marks = NULL return? No rows, whatever the table holds.
  8. DELETE or DROP: which keeps the columns? DELETE. The table is still there, empty if you gave no WHERE.

Make it yours before you print

  1. Replace our data with yours

    Your towns, your subjects, your table of ten friends or ten plants. The output changes with it, and so the entry becomes your work.

  2. Keep one failed run

    A triangle that cannot exist, a repeated key, a discount of 130. It shows the examiner you tested.

  3. Copy SQL output, not a photo of it

    Select the grid in the MySQL window and paste it in a fixed-width font such as Courier New, so the lines stay straight.

  4. Export the file as PDF

    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

Finish the IP file entry by entry, with someone to ask

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

Priority demo, at a slot you pick

a full live class of about 45 to 60 minutes

  • One Python entry and one SQL entry written live by the student
  • A wrong query repaired together until the rows are right
  • Viva-style questions on the code just written
  • A skill report in writing that covers Python, SQL and explaining
Book a priority demo

The classes · Choose your own timing

Personalised one to one

₹4,999

per month, 4 private classes, fully flexible timing

  • Class days that fit around tuition, sport and school tests
  • MySQL set up and checked on your own computer in the first weeks
  • Entries written when their chapter is taught, so nothing piles up
  • Practice for the 11-mark Python task and the 7-mark MySQL task
Ask for a personalised plan

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

IP file help for students in CBSE schools abroad

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 liveTime differenceUsual class window, local timeFormat
India
every Indian city
Indian timeAny time you choosePersonalised 1-on-1
UAE and Oman
Dubai, Abu Dhabi, Sharjah, Muscat
1 h 30 min behind India3:00 PM to 9:00 PMPersonalised 1-on-1
Saudi Arabia, Qatar, Kuwait, Bahrain
Riyadh, Jeddah, Dammam, Doha, Kuwait City, Manama
2 h 30 min behind India3:00 PM to 9:00 PMPersonalised 1-on-1
Nepal
Kathmandu
15 min ahead of India4:30 PM to 9:00 PMPersonalised 1-on-1
Ethiopia and East Africa
Addis Ababa and East Africa Time
2 h 30 min behind India4:30 PM to 9:00 PMPersonalised 1-on-1
Singapore and Malaysia
Singapore, Kuala Lumpur
2 h 30 min ahead of India3:30 PM to 9:00 PMPersonalised 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

Rated 4.9 across 547 Google reviews

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

Other Class 11 pages for IP, CS and AI

Every page in the CBSE Class 11 Computer Science, IP and AI series, grouped by what you need.

File questions

Class 11 IP practical file: common questions

How many programs are there in the Class 11 IP practical file?

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.

Where can I download the Class 11 IP practical file PDF?

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.

Which Python programs come in the Class 11 IP practical file?

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.

Which SQL queries are in the Class 11 IP practical list?

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.

Is NumPy needed in the Class 11 IP practical file?

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.

Is there a project in Class 11 Informatics Practices?

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.

Can the Class 11 IP practical file be handwritten?

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.

Which MySQL version should I use for Class 11 IP?

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.

When is the Class 11 IP practical exam?

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.

Can I get online help with my Class 11 IP practical file?

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

Bring the entry that is stuck

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.

We call within a few hours. No card, no enrolment fee.

Want it sooner? Book a priority demo

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

Keep exploring Modern Age Coders

By class and age

Learn more

Free resources

From the blog

Start here