Class 12 sample papers › Informatics Practices

CBSE Class 12 Informatics Practices (065) pre-board sample paper 2026–27, with marking scheme

A full pre-board and board practice paper in the CBSE 2026–27 board pattern, 70 marks for 3 hours. 37 questions in five sections: Pandas Series and DataFrames, Matplotlib plots, SQL functions, GROUP BY and joins, computer networks with a case study, and societal impacts. Paper AW-12IP-BP-71065; it follows the CBSE pattern but is not an official CBSE paper.

Open the printable paperMarking scheme

General instructions

  1. All questions are compulsory. There is no overall choice, but some questions have an internal choice (marked OR): answer only one of them.
  2. The paper has five sections, A to E.
  3. Section A has 21 questions of 1 mark each.
  4. Section B has 7 questions of 2 marks each.
  5. Section C has 4 questions of 3 marks each.
  6. Section D has 2 questions of 4 marks each.
  7. Section E has 3 questions of 5 marks each.
  8. All programming questions are to be answered using Python only.
  9. For a multiple-choice question, write the text of the correct answer as well.

The paper

Section A (21 × 1 = 21 marks)

  1. Q1. 1 mark

    Which statement reads a CSV file into a DataFrame?

    1. pd.to_csv('marks.csv')
    2. pd.load('marks.csv')
    3. pd.open_csv('marks.csv')
    4. pd.read_csv('marks.csv')
  2. Q2. 1 mark

    Table STUDENT RollNo | Name | City | Marks 1 | Diya | Indore | NULL 2 | Zoya | Indore | 41 3 | Farhan | Patna | 68 4 | Isha | Patna | 67 5 | Sana | Nagpur | 95 6 | Arjun | Nagpur | NULL What does this query return? SELECT COUNT(DISTINCT City) FROM STUDENT;

    1. 6
    2. 3
    3. 4
    4. 5
  3. Q3. 1 mark

    Which intellectual property right protects a slogan that identifies a firm’s products?

    1. trademark
    2. patent
    3. plagiarism
    4. copyright
  4. Q4. 1 mark

    How many values fall in the bar for the bin 25–30 in this histogram? import matplotlib.pyplot as plt data = [25, 18, 10, 10, 25, 23, 29, 19, 30, 10, 24] plt.hist(data, bins=[10, 15, 20, 25, 30]) plt.show()

    1. 2
    2. 3
    3. 5
    4. 4
  5. Q5. 1 mark

    In the URL http://shop.example.com/class12/help/about.html, what is the name of the file asked for?

    1. com
    2. about.html
    3. http
    4. shop.example.com
  6. Q6. 1 mark

    To which category of SQL commands does this statement belong? UPDATE EMPLOYEE SET Salary = Salary + 4000 WHERE EmpId = 'E121';

    1. DQL (Data Query Language)
    2. DDL (Data Definition Language)
    3. DCL (Data Control Language)
    4. DML (Data Manipulation Language)
  7. Q7. 1 mark

    Which of these breaks net etiquette?

    1. keeping a friend’s secrets off public posts
    2. writing politely even when disagreeing
    3. sharing a password with friends
    4. checking a fact before forwarding it
  8. Q8. 1 mark

    s = pd.Series(8, index=['a', 'b', 'c', 'd', 'e', 'f']) What does print(s.size) show?

    1. 6
    2. 8
    3. 48
    4. 14
  9. Q9. 1 mark

    An aggregate (multiple row) function such as SUM():

    1. gives one result for each row
    2. works only on text
    3. changes the values stored in the table
    4. gives one result for a group of rows
  10. Q10. 1 mark

    Which network device joins the computers of a LAN and learns which computer is on which port?

    1. modem
    2. gateway
    3. router
    4. switch
  11. Q11. 1 mark

    COUNT(*) differs from COUNT(column) because COUNT(*):

    1. counts only NULL values
    2. counts rows even when the column holds NULL
    3. works only on numeric columns
    4. leaves out duplicate values
  12. Q12. 1 mark

    Which attribute gives the number of rows and columns of a DataFrame?

    1. index
    2. size
    3. shape
    4. ndim
  13. Q13. 1 mark

    Which licence or status is this: anyone may use, study, change and share the software and its source code?

    1. CC BY-ND
    2. public domain
    3. GNU GPL
    4. free and open source software
  14. Q14. 1 mark

    Which clause filters groups made by GROUP BY?

    1. DISTINCT
    2. WHERE
    3. HAVING
    4. ORDER BY
  15. Q15. 1 mark

    Series s: Mon | 23 Tue | 96 Wed | 77 Thu | 36 Fri | 53 Which values does print(s[s >= 53]) show?

    1. 53, 77, 96
    2. 23, 36, 53
    3. 96, 77, 53
    4. 96, 77
  16. Q16. 1 mark

    Which type of network is a phone connected to wireless earbuds and a smartwatch?

    1. LAN
    2. MAN
    3. WAN
    4. PAN
  17. Q17. 1 mark

    Table: STUDENT RollNo | Name | Gender | Section | Marks | DOB 9 | Asha | F | C | 40 | 2010-03-08 10 | Bhavna | F | B | 70 | 2010-12-07 11 | Uday | M | C | NULL | 2008-06-16 12 | Meera | F | B | 92 | 2009-10-20 13 | Kavya | F | A | 68 | 2009-11-06 14 | Sana | F | A | 61 | 2008-08-21 15 | Ritu | F | C | 64 | 2009-06-25 UPDATE STUDENT SET Marks = Marks + 25 WHERE Gender = 'F'; After this, what does SELECT Marks FROM STUDENT WHERE RollNo = 10; show?

    1. 45
    2. 120
    3. 95
    4. 70
  18. Q18. 1 mark

    Series s: A | 66 B | 84 C | 22 D | 45 E | 29 Which labels does s.loc['A':'D'] show?

    1. B, C
    2. B, C, D, E
    3. A, B, C, D
    4. A, B, C, D, E
  19. Q19. 1 mark

    Which name is selected by the condition Name LIKE 'Z%a'?

    1. Zoya
    2. Bhavna
    3. Farhan
    4. Rahul
  20. Q20. 1 mark

    Assertion (A): pd.DataFrame([{'Chemistry': 91, 'English': 58}, {'Chemistry': 97, 'English': 94}]) makes a DataFrame whose rows are labelled Chemistry and English. Reason (R): When a DataFrame is created from a list of dictionaries, the dictionary keys become the column labels and each dictionary becomes a row.

    1. Both A and R are true, and R is the correct explanation of A.
    2. Both A and R are true, but R is not the correct explanation of A.
    3. A is true, but R is false.
    4. A is false, but R is true.
  21. Q21. 1 mark

    Assertion (A): The queries select * from library; and SELECT * FROM LIBRARY; produce the same result. Reason (R): Every SQL statement in MySQL ends with a semicolon.

    1. Both A and R are true, and R is the correct explanation of A.
    2. Both A and R are true, but R is not the correct explanation of A.
    3. A is true, but R is false.
    4. A is false, but R is true.

Section B (7 × 2 = 14 marks)

  1. Q22. 2 marks

    A DataFrame stock has 10 rows labelled R1 to R10. (i) Explain the use of the head() function. What happens if the parameter n is not given? (ii) Which rows does stock.head() display, and which does stock.tail(4)?

    OR

    Consider the following two dictionaries: dict1 = {'a': 20, 'c': 45} dict2 = {'a': 30, 'c': 35, 'z': 50} Write Python code to create a DataFrame from a list containing the above two dictionaries. What will the DataFrame look like?

  2. Q23. 2 marks

    What is ransomware? Suggest one way to stay safe from it.

  3. Q24. 2 marks

    A line is drawn with plt.plot(x, y, label='Orders'). Write statements to (i) show the legend on the plot (ii) save the plot as 'orders_term10.png'. What does a legend show?

  4. Q25. 2 marks

    Differentiate between a hub and a switch.

    OR

    Define mesh topology. Mention one major advantage of using it.

  5. Q26. 2 marks

    Write SQL queries for the following: (i) Display the last 2 characters of the column MName of the table CLUB. (ii) Find the position of the substring 'vi' in the string 'Television'.

  6. Q27. 2 marks

    Differentiate between plagiarism and copyright infringement.

  7. Q28. 2 marks

    Explain Boolean indexing in a DataFrame. Using Boolean indexing, write a statement to display the rows of the DataFrame df below in which Chemistry marks are more than 60, and name the students it displays.

    DataFrame df
    NameChemistry
    0Tanvi55
    1Vikram57
    2Ritu53
    3Aman78
    4Dev66

    OR

    Mention the purpose of read_csv() and explain the use of its sep parameter. Write a statement to read the file attendance9.csv, whose values are separated by a colon, into a DataFrame df.

Section C (4 × 3 = 12 marks)

  1. Q29. 3 marks

    Read the following situations and answer the questions: (i) Aman composes a song and wants to stop others from copying it without permission. Which kind of Intellectual Property Right should be obtained? (ii) Neha hands an old phone to an authorised e-waste collection centre so that its metals can be recovered. Which ‘R’ of e-waste management is this? (iii) Pooja uploads a photo of a science project to a school website. What kind of digital footprint is this?

  2. Q30. 3 marks

    Consider the Series: temp = pd.Series([41, 39, 23, 35, 27, 32], index=['Kochi', 'Jaipur', 'Lucknow', 'Mumbai', 'Delhi', 'Kolkata']) Write the output of: (i) print(temp.size) (ii) print(temp['Mumbai']) (iii) print(temp[temp > 25])

    OR

    (i) Write a Python program to create a Pandas Series named Inventory from the following dictionary: stock = {'Erasers': 90, 'Files': 240, 'Pens': 120, 'Rulers': 90} (ii) Consider two Series S1 and S2: import pandas as pd S1 = pd.Series([30, 10], index=['r', 's']) S2 = pd.Series([70, 60], index=['s', 't']) Write the output of the statement: print(S1 + S2)

  3. Q31. 3 marks

    Write the output of the following SQL queries: (i) SELECT MOD(POWER(7, 2), 9); (ii) SELECT UPPER(RIGHT('Solar Power', 3)); (iii) SELECT LENGTH('Digital India');

  4. Q32. 3 marks

    Consider the table EMP given below. Write the output of the following SQL queries: (i) SELECT COUNT(Bonus), COUNT(*) FROM EMP; (ii) SELECT Dept, SUM(Salary) FROM EMP GROUP BY Dept ORDER BY Dept; (iii) SELECT MAX(Bonus), MIN(Bonus) FROM EMP WHERE Dept = 'HR';

    Table: EMP
    EmpNoNameDeptSalaryBonus
    101IshaanHR43000NULL
    102NehaHR320001500
    103TanviMarketing700005500
    104SnehaMarketing820004500
    105AnjaliHR530002000

    OR

    Consider the table LIBRARY given below. Write SQL queries to do the following: (i) Display the names of all members of the plan 'Silver' in uppercase. (ii) Display each member's MemNo with the year of the date of joining. (iii) Display all the details, the latest date of joining first.

    Table: LIBRARY
    MemNoMNamePlanDOJ
    545HarshBasic2024-04-13
    546TanviSilver2023-07-04
    547ManavGold2024-05-03
    548AmanSilver2023-08-09
    549RohitSilver2023-03-08

Section D (2 × 4 = 8 marks)

  1. Q33. 4 marks

    Write a Python program using Matplotlib to plot a line graph showing the monthly sales of a shop, with the following data: Month: ['May', 'Jun', 'Jul', 'Aug'] Sales: [16500, 15000, 22000, 16000] The program should: import the required library; plot the line with the label 'Sales'; give the title 'Sales Performance'; label the x-axis 'Month' and the y-axis 'Amount'; display the legend and show the plot.

  2. Q34. 4 marks

    Consider the tables ORDERS (given below) and SUPPLIER: Table: SUPPLIER SupID | SupName | Item S1 | Fatima | Sugar S2 | Joseph | Oil S3 | Lakshmi | Wheat Write SQL queries for the following: (i) Display the item and the total amount for each item, but only for those items where the total amount is more than 620. (ii) Display each customer's name (Customer) with the name of their supplier (SupName).

    Table: ORDERS
    OrderNoCustomerItemAmount
    401VivekSugar100
    402PoojaSugar300
    403KavyaOil380
    404GauravSugar160
    405SimranWheat200
    406DivyaOil300

    OR

    Consider the tables Staff (given below) and Wing: Table: Wing WingID | WingName W1 | Library W2 | Labs W3 | Admin Write the output of the following SQL queries: (i) SELECT WingID, COUNT(*), SUM(Pay) FROM Staff GROUP BY WingID HAVING COUNT(*) > 1 ORDER BY WingID; (ii) SELECT SName, WingName FROM Staff, Wing WHERE Staff.WingID = Wing.WingID AND Staff.Pay > 36000;

    Table: Staff
    SIDSNameWingIDPay
    501RohitW223000
    502AmanW154000
    503TanviW132000
    504DivyaW350000
    505AnjaliW137000

Section E (3 × 5 = 15 marks)

  1. Q35. 5 marks

    A software company in Pune has four blocks: Block A, Block B, Block C, Block D. Distances between the blocks: From | To | Distance Block A | Block B | 55 m Block A | Block C | 155 m Block A | Block D | 25 m Block B | Block C | 60 m Block B | Block D | 180 m Block C | Block D | 180 m The number of computers in each block is given in the table below. Answer the following: (i) Suggest the most suitable block to house the server, with a reason. (ii) Suggest a cable layout (topology) to connect all the blocks, with the server block at its centre. (iii) In that layout, on which links is a repeater needed? Why? (iv) Which device would you use to connect the campus network to the Internet? (v) It wants to link this network with its office in Ahmedabad using a fast wired medium. Which medium would you suggest?

    Number of computers in each block
    BlockNumber of computers
    Block A90
    Block B150
    Block C155
    Block D140
  2. Q36. 5 marks

    (i) Create the DataFrame Zones shown below using a dictionary of Series. Then write Pandas statements to: (ii) add a new row containing the data 'Mumbai', 5500, 5000 (iii) display the City column only.

    DataFrame Zones
    CityTerm1Term2
    0Indore25004500
    1Pune50009000
    2Lucknow80001500
  3. Q37. 5 marks

    The table COURSE is shown below. Write SQL commands for the following: (i) Create the table COURSE with CID as an integer primary key, CName as text of up to 40 characters, Trainer as text of up to 30 characters and Fee as an integer. (ii) Insert a record with CID 46, CName 'Data Analysis' and Trainer 'Arvind', leaving Fee empty. (iii) Increase the Fee of every entry taught by 'Arvind' by 20%. (iv) Delete the records whose Fee is less than 750. (v) Remove the column Trainer from the table.

    Table: COURSE
    CIDCNameTrainerFee
    41Typing SkillsShalini209
    42Web DesignMeena570
    43SpreadsheetsArvind1020
    44Digital SafetyArvind649
    45Python BasicsMeena1060

    OR

    Consider the table PRODUCT given below. Write SQL queries for the following: (i) Display PName and its Price rounded to the nearest whole number. (ii) Display the names of products that begin with the letter 'E'. (iii) Display the PName and Category of the products whose Price is less than or equal to 500. (iv) Display the total quantity of all products. (v) Display PName after removing both leading and trailing spaces.

    Table: PRODUCT
    PCodePNameCategoryQtyPrice
    P10LassiDrinks120798.92
    P11PensStationery70890.44
    P12NotebooksStationery80266.85
    P13ToothpasteToiletries55297.27
    P14SoapToiletries60650.85

Marking scheme

The answers and the marks for each step or point, as an examiner marks them. Open a section to check a question.

Section A (21 × 1 = 21 marks): answers and marks
  1. Q1

    (d) pd.read_csv('marks.csv')

  2. Q2

    (b) 3 (COUNT(DISTINCT …) counts each different value once)

  3. Q3

    (a) trademark

  4. Q4

    (d) 4 (the last bin includes both 25 and 30)

  5. Q5

    (b) about.html (protocol://domain name/path/file)

  6. Q6

    (d) DML (Data Manipulation Language) (CREATE, ALTER and DROP define structure; INSERT, UPDATE and DELETE change data; SELECT queries it)

  7. Q7

    (c) sharing a password with friends (it disrespects or harms others online)

  8. Q8

    (a) 6 (a scalar is repeated for each of the 6 labels)

  9. Q9

    (d) gives one result for a group of rows

  10. Q10

    (d) switch

  11. Q11

    (b) counts rows even when the column holds NULL

  12. Q12

    (c) shape

  13. Q13

    (d) free and open source software

  14. Q14

    (c) HAVING

  15. Q15

    (c) 96, 77, 53 (keeps the elements where s >= 53)

  16. Q16

    (d) PAN

  17. Q17

    (c) 95 (the row matches the WHERE condition, so 70 + 25)

  18. Q18

    (c) A, B, C, D (loc slices by label and includes the end label)

  19. Q19

    (a) Zoya (% stands for any run of characters and _ for exactly one; the pattern means the name starts with Z and ends with a)

  20. Q20

    (d) A is false, but R is true. (A is false: the keys become the column labels; the rows are labelled 0 and 1. R is true.)

  21. Q21

    (b) Both A and R are true, but R is not the correct explanation of A. (A is true: keywords and table names are read the same in any case. R is true but does not explain A.)

Section B (7 × 2 = 14 marks): answers and marks
  1. Q22
    1. head(n) displays the first n rows; without n it uses 5 and shows the first 5 rows (1)
    2. head(): R1, R2, R3, R4, R5; tail(4): R7, R8, R9, R10 (1)
    Q22 OR
    1. import pandas and put the two dictionaries in a list: L = [dict1, dict2] (1)
    2. df = pd.DataFrame(L): the keys become columns, NaN where a key is missing (1)
  2. Q23
    1. Ransomware: malicious software that locks a computer’s files and demands money to unlock them (1)
    2. Safety: Keep backups of files and do not open unknown attachments (1)
  3. Q24
    1. plt.legend(); it shows which line stands for which data (1)
    2. plt.savefig('orders_term10.png') (1)
  4. Q25
    1. A hub sends the data it receives to every device connected to it (1)
    2. A switch sends the data only to the device it is meant for, using its MAC address (1)
    Q25 OR
    1. Definition: every device is connected to every other device (or many of them) by its own link (1)
    2. Advantage: each link carries only its own data, so it is fast and secure (1)
  5. Q26
    1. SELECT RIGHT(MName, 2) FROM CLUB; (1)
    2. SELECT INSTR('Television', 'vi'); (1)
  6. Q27
    1. Plagiarism: using another’s work as one’s own without credit (1)
    2. Copyright infringement: using a copyrighted work without the owner’s permission (1)
  7. Q28
    1. Boolean indexing keeps only the rows for which a condition is True (1)
    2. df[df['Chemistry'] > 60]; it displays Aman, Dev (1)
    Q28 OR
    1. read_csv() reads a CSV file into a DataFrame; sep is the separator, a comma by default (1)
    2. df = pd.read_csv('attendance9.csv', sep=':') (1)
Section C (4 × 3 = 12 marks): answers and marks
  1. Q29
    1. Copyright (1)
    2. Recycle (1)
    3. Active digital footprint (1)
  2. Q30
    1. size is the number of elements: 6 (1)
    2. the value labelled Mumbai: 35 (1)
    3. only the cities above 25: Kochi, Jaipur, Mumbai, Delhi, Kolkata (1)
    Q30 OR
    1. import pandas as pd; Inventory = pd.Series(stock) (1)
    2. labels matched: s are added (1)
    3. r, t are in only one Series, so NaN (float64) (1)
  3. Q31
    1. SELECT MOD(POWER(7, 2), 9); → 4 (1)
    2. SELECT UPPER(RIGHT('Solar Power', 3)); → WER (1)
    3. SELECT LENGTH('Digital India'); → 13 (1)
  4. Q32
    1. SELECT COUNT(Bonus), COUNT(*) FROM EMP; gives COUNT(Bonus) | COUNT(*) 4 | 5 (1)
    2. SELECT Dept, SUM(Salary) FROM EMP GROUP BY Dept ORDER BY Dept; gives Dept | SUM(Salary) HR | 128000 Marketing | 152000 (1)
    3. SELECT MAX(Bonus), MIN(Bonus) FROM EMP WHERE Dept = 'HR'; gives MAX(Bonus) | MIN(Bonus) 2000 | 1500 (1)
    Q32 OR
    1. SELECT UPPER(MName) FROM LIBRARY WHERE Plan = 'Silver'; (1)
    2. SELECT MemNo, YEAR(DOJ) FROM LIBRARY; (1)
    3. SELECT * FROM LIBRARY ORDER BY DOJ DESC; (1)
Section D (2 × 4 = 8 marks): answers and marks
  1. Q33
    1. import matplotlib.pyplot as plt (1)
    2. plt.plot(names, y, label='Sales') with the two lists (1)
    3. plt.title('Sales Performance'), plt.xlabel('Month') and plt.ylabel('Amount') (1)
    4. plt.legend() and plt.show() (1)
  2. Q34
    1. SELECT Item, SUM(Amount) FROM ORDERS GROUP BY Item HAVING SUM(Amount) > 620; (2)
    2. SELECT Customer, SupName FROM ORDERS, SUPPLIER WHERE ORDERS.Item = SUPPLIER.Item; (2)
    Q34 OR
    1. SELECT WingID, COUNT(*), SUM(Pay) FROM Staff GROUP BY WingID HAVING COUNT(*) > 1 ORDER BY WingID; gives WingID | COUNT(*) | SUM(Pay) W1 | 3 | 123000 (2)
    2. SELECT SName, WingName FROM Staff, Wing WHERE Staff.WingID = Wing.WingID AND Staff.Pay > 36000; gives SName | WingName Aman | Library Divya | Admin Anjali | Library (2)
Section E (3 × 5 = 15 marks): answers and marks
  1. Q35
    1. Block C: it has the most computers (155), so most of the traffic stays within the block. (1)
    2. A star topology with Block C (the server) at the centre, connected by its own cable to each of Block A, Block B, Block D. (1)
    3. In the layout of (ii), on the links between Block C and Block A; Block C and Block D: they are longer than 100 m. (1)
    4. A router (with a modem from the Internet service provider): it forwards data between the campus network and the Internet. (1)
    5. Optical fibre: it carries data at high speed over long distances without being affected by electrical noise. (1)
  2. Q36
    1. one Series for each column (1)
    2. a dictionary of the Series passed to pd.DataFrame() (1)
    3. the keys City, Term1 and Term2 as the column names (1)
    4. Zones.loc[3] = ['Mumbai', 5500, 5000] (1)
    5. print(Zones['City']) (1)
  3. Q37
    1. CREATE TABLE COURSE (CID INT PRIMARY KEY, CName VARCHAR(40), Trainer VARCHAR(30), Fee INT); (1)
    2. INSERT INTO COURSE (CID, CName, Trainer) VALUES (46, 'Data Analysis', 'Arvind'); (1)
    3. UPDATE COURSE SET Fee = Fee + Fee * 20 / 100 WHERE Trainer = 'Arvind'; (1)
    4. DELETE FROM COURSE WHERE Fee < 750; (1)
    5. ALTER TABLE COURSE DROP COLUMN Trainer; (1)
    Q37 OR
    1. SELECT PName, ROUND(Price, 0) FROM PRODUCT; (1)
    2. SELECT PName FROM PRODUCT WHERE PName LIKE 'E%'; (1)
    3. SELECT PName, Category FROM PRODUCT WHERE Price <= 500; (1)
    4. SELECT SUM(Qty) FROM PRODUCT; (1)
    5. SELECT TRIM(PName) FROM PRODUCT; (1)

A new Informatics Practices paper every time

This sample stays the same. In the app, every Informatics Practices paper is new and leaves out questions your child has already had. Print it, set the 3-hour timer, which rings at 15 minutes left and when time is up, then enter the marks question by question. Your first paper is free.

Get it on Google PlayDownload on the App Store

Revise Class 12 Informatics Practices chapter by chapter

After marking the paper, practise the chapters where marks were lost. Each worksheet has sample questions with answers and a printable sheet.

All Class 12 worksheets for this subject →

More Class 12 sample papers