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.
General instructions
- All questions are compulsory. There is no overall choice, but some questions have an internal choice (marked OR): answer only one of them.
- The paper has five sections, A to E.
- Section A has 21 questions of 1 mark each.
- Section B has 7 questions of 2 marks each.
- Section C has 4 questions of 3 marks each.
- Section D has 2 questions of 4 marks each.
- Section E has 3 questions of 5 marks each.
- All programming questions are to be answered using Python only.
- For a multiple-choice question, write the text of the correct answer as well.
The paper
Section A (21 × 1 = 21 marks)
- Q1. 1 mark
Which statement reads a CSV file into a DataFrame?
- pd.to_csv('marks.csv')
- pd.load('marks.csv')
- pd.open_csv('marks.csv')
- pd.read_csv('marks.csv')
- 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;
- 6
- 3
- 4
- 5
- Q3. 1 mark
Which intellectual property right protects a slogan that identifies a firm’s products?
- trademark
- patent
- plagiarism
- copyright
- 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()
- 2
- 3
- 5
- 4
- Q5. 1 mark
In the URL http://shop.example.com/class12/help/about.html, what is the name of the file asked for?
- com
- about.html
- http
- shop.example.com
- Q6. 1 mark
To which category of SQL commands does this statement belong? UPDATE EMPLOYEE SET Salary = Salary + 4000 WHERE EmpId = 'E121';
- DQL (Data Query Language)
- DDL (Data Definition Language)
- DCL (Data Control Language)
- DML (Data Manipulation Language)
- Q7. 1 mark
Which of these breaks net etiquette?
- keeping a friend’s secrets off public posts
- writing politely even when disagreeing
- sharing a password with friends
- checking a fact before forwarding it
- Q8. 1 mark
s = pd.Series(8, index=['a', 'b', 'c', 'd', 'e', 'f']) What does print(s.size) show?
- 6
- 8
- 48
- 14
- Q9. 1 mark
An aggregate (multiple row) function such as SUM():
- gives one result for each row
- works only on text
- changes the values stored in the table
- gives one result for a group of rows
- Q10. 1 mark
Which network device joins the computers of a LAN and learns which computer is on which port?
- modem
- gateway
- router
- switch
- Q11. 1 mark
COUNT(*) differs from COUNT(column) because COUNT(*):
- counts only NULL values
- counts rows even when the column holds NULL
- works only on numeric columns
- leaves out duplicate values
- Q12. 1 mark
Which attribute gives the number of rows and columns of a DataFrame?
- index
- size
- shape
- ndim
- Q13. 1 mark
Which licence or status is this: anyone may use, study, change and share the software and its source code?
- CC BY-ND
- public domain
- GNU GPL
- free and open source software
- Q14. 1 mark
Which clause filters groups made by GROUP BY?
- DISTINCT
- WHERE
- HAVING
- ORDER BY
- Q15. 1 mark
Series s: Mon | 23 Tue | 96 Wed | 77 Thu | 36 Fri | 53 Which values does print(s[s >= 53]) show?
- 53, 77, 96
- 23, 36, 53
- 96, 77, 53
- 96, 77
- Q16. 1 mark
Which type of network is a phone connected to wireless earbuds and a smartwatch?
- LAN
- MAN
- WAN
- PAN
- 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?
- 45
- 120
- 95
- 70
- Q18. 1 mark
Series s: A | 66 B | 84 C | 22 D | 45 E | 29 Which labels does s.loc['A':'D'] show?
- B, C
- B, C, D, E
- A, B, C, D
- A, B, C, D, E
- Q19. 1 mark
Which name is selected by the condition Name LIKE 'Z%a'?
- Zoya
- Bhavna
- Farhan
- Rahul
- 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.
- Both A and R are true, and R is the correct explanation of A.
- Both A and R are true, but R is not the correct explanation of A.
- A is true, but R is false.
- A is false, but R is true.
- 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.
- Both A and R are true, and R is the correct explanation of A.
- Both A and R are true, but R is not the correct explanation of A.
- A is true, but R is false.
- A is false, but R is true.
Section B (7 × 2 = 14 marks)
- 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?
- Q23. 2 marks
What is ransomware? Suggest one way to stay safe from it.
- 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?
- Q25. 2 marks
Differentiate between a hub and a switch.
OR
Define mesh topology. Mention one major advantage of using it.
- 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'.
- Q27. 2 marks
Differentiate between plagiarism and copyright infringement.
- 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 Name Chemistry 0 Tanvi 55 1 Vikram 57 2 Ritu 53 3 Aman 78 4 Dev 66 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)
- 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?
- 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)
- 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');
- 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 EmpNo Name Dept Salary Bonus 101 Ishaan HR 43000 NULL 102 Neha HR 32000 1500 103 Tanvi Marketing 70000 5500 104 Sneha Marketing 82000 4500 105 Anjali HR 53000 2000 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 MemNo MName Plan DOJ 545 Harsh Basic 2024-04-13 546 Tanvi Silver 2023-07-04 547 Manav Gold 2024-05-03 548 Aman Silver 2023-08-09 549 Rohit Silver 2023-03-08
Section D (2 × 4 = 8 marks)
- 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.
- 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 OrderNo Customer Item Amount 401 Vivek Sugar 100 402 Pooja Sugar 300 403 Kavya Oil 380 404 Gaurav Sugar 160 405 Simran Wheat 200 406 Divya Oil 300 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 SID SName WingID Pay 501 Rohit W2 23000 502 Aman W1 54000 503 Tanvi W1 32000 504 Divya W3 50000 505 Anjali W1 37000
Section E (3 × 5 = 15 marks)
- 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 Block Number of computers Block A 90 Block B 150 Block C 155 Block D 140 - 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 City Term1 Term2 0 Indore 2500 4500 1 Pune 5000 9000 2 Lucknow 8000 1500 - 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 CID CName Trainer Fee 41 Typing Skills Shalini 209 42 Web Design Meena 570 43 Spreadsheets Arvind 1020 44 Digital Safety Arvind 649 45 Python Basics Meena 1060 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 PCode PName Category Qty Price P10 Lassi Drinks 120 798.92 P11 Pens Stationery 70 890.44 P12 Notebooks Stationery 80 266.85 P13 Toothpaste Toiletries 55 297.27 P14 Soap Toiletries 60 650.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
- Q1
(d) pd.read_csv('marks.csv')
- Q2
(b) 3 (COUNT(DISTINCT …) counts each different value once)
- Q3
(a) trademark
- Q4
(d) 4 (the last bin includes both 25 and 30)
- Q5
(b) about.html (protocol://domain name/path/file)
- Q6
(d) DML (Data Manipulation Language) (CREATE, ALTER and DROP define structure; INSERT, UPDATE and DELETE change data; SELECT queries it)
- Q7
(c) sharing a password with friends (it disrespects or harms others online)
- Q8
(a) 6 (a scalar is repeated for each of the 6 labels)
- Q9
(d) gives one result for a group of rows
- Q10
(d) switch
- Q11
(b) counts rows even when the column holds NULL
- Q12
(c) shape
- Q13
(d) free and open source software
- Q14
(c) HAVING
- Q15
(c) 96, 77, 53 (keeps the elements where s >= 53)
- Q16
(d) PAN
- Q17
(c) 95 (the row matches the WHERE condition, so 70 + 25)
- Q18
(c) A, B, C, D (loc slices by label and includes the end label)
- 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)
- 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.)
- 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
- Q22
- head(n) displays the first n rows; without n it uses 5 and shows the first 5 rows (1)
- head(): R1, R2, R3, R4, R5; tail(4): R7, R8, R9, R10 (1)
Q22 OR- import pandas and put the two dictionaries in a list: L = [dict1, dict2] (1)
- df = pd.DataFrame(L): the keys become columns, NaN where a key is missing (1)
- Q23
- Ransomware: malicious software that locks a computer’s files and demands money to unlock them (1)
- Safety: Keep backups of files and do not open unknown attachments (1)
- Q24
- plt.legend(); it shows which line stands for which data (1)
- plt.savefig('orders_term10.png') (1)
- Q25
- A hub sends the data it receives to every device connected to it (1)
- A switch sends the data only to the device it is meant for, using its MAC address (1)
Q25 OR- Definition: every device is connected to every other device (or many of them) by its own link (1)
- Advantage: each link carries only its own data, so it is fast and secure (1)
- Q26
- SELECT RIGHT(MName, 2) FROM CLUB; (1)
- SELECT INSTR('Television', 'vi'); (1)
- Q27
- Plagiarism: using another’s work as one’s own without credit (1)
- Copyright infringement: using a copyrighted work without the owner’s permission (1)
- Q28
- Boolean indexing keeps only the rows for which a condition is True (1)
- df[df['Chemistry'] > 60]; it displays Aman, Dev (1)
Q28 OR- read_csv() reads a CSV file into a DataFrame; sep is the separator, a comma by default (1)
- df = pd.read_csv('attendance9.csv', sep=':') (1)
Section C (4 × 3 = 12 marks): answers and marks
- Q29
- Copyright (1)
- Recycle (1)
- Active digital footprint (1)
- Q30
- size is the number of elements: 6 (1)
- the value labelled Mumbai: 35 (1)
- only the cities above 25: Kochi, Jaipur, Mumbai, Delhi, Kolkata (1)
Q30 OR- import pandas as pd; Inventory = pd.Series(stock) (1)
- labels matched: s are added (1)
- r, t are in only one Series, so NaN (float64) (1)
- Q31
- SELECT MOD(POWER(7, 2), 9); → 4 (1)
- SELECT UPPER(RIGHT('Solar Power', 3)); → WER (1)
- SELECT LENGTH('Digital India'); → 13 (1)
- Q32
- SELECT COUNT(Bonus), COUNT(*) FROM EMP; gives COUNT(Bonus) | COUNT(*) 4 | 5 (1)
- SELECT Dept, SUM(Salary) FROM EMP GROUP BY Dept ORDER BY Dept; gives Dept | SUM(Salary) HR | 128000 Marketing | 152000 (1)
- SELECT MAX(Bonus), MIN(Bonus) FROM EMP WHERE Dept = 'HR'; gives MAX(Bonus) | MIN(Bonus) 2000 | 1500 (1)
Q32 OR- SELECT UPPER(MName) FROM LIBRARY WHERE Plan = 'Silver'; (1)
- SELECT MemNo, YEAR(DOJ) FROM LIBRARY; (1)
- SELECT * FROM LIBRARY ORDER BY DOJ DESC; (1)
Section D (2 × 4 = 8 marks): answers and marks
- Q33
- import matplotlib.pyplot as plt (1)
- plt.plot(names, y, label='Sales') with the two lists (1)
- plt.title('Sales Performance'), plt.xlabel('Month') and plt.ylabel('Amount') (1)
- plt.legend() and plt.show() (1)
- Q34
- SELECT Item, SUM(Amount) FROM ORDERS GROUP BY Item HAVING SUM(Amount) > 620; (2)
- SELECT Customer, SupName FROM ORDERS, SUPPLIER WHERE ORDERS.Item = SUPPLIER.Item; (2)
Q34 OR- 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)
- 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
- Q35
- Block C: it has the most computers (155), so most of the traffic stays within the block. (1)
- 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)
- 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)
- A router (with a modem from the Internet service provider): it forwards data between the campus network and the Internet. (1)
- Optical fibre: it carries data at high speed over long distances without being affected by electrical noise. (1)
- Q36
- one Series for each column (1)
- a dictionary of the Series passed to pd.DataFrame() (1)
- the keys City, Term1 and Term2 as the column names (1)
- Zones.loc[3] = ['Mumbai', 5500, 5000] (1)
- print(Zones['City']) (1)
- Q37
- CREATE TABLE COURSE (CID INT PRIMARY KEY, CName VARCHAR(40), Trainer VARCHAR(30), Fee INT); (1)
- INSERT INTO COURSE (CID, CName, Trainer) VALUES (46, 'Data Analysis', 'Arvind'); (1)
- UPDATE COURSE SET Fee = Fee + Fee * 20 / 100 WHERE Trainer = 'Arvind'; (1)
- DELETE FROM COURSE WHERE Fee < 750; (1)
- ALTER TABLE COURSE DROP COLUMN Trainer; (1)
Q37 OR- SELECT PName, ROUND(Price, 0) FROM PRODUCT; (1)
- SELECT PName FROM PRODUCT WHERE PName LIKE 'E%'; (1)
- SELECT PName, Category FROM PRODUCT WHERE Price <= 500; (1)
- SELECT SUM(Qty) FROM PRODUCT; (1)
- 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.
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.
More Class 12 sample papers
- CBSE Class 12 Mathematics (041) sample paper
- CBSE Class 12 Physics (042) sample paper
- CBSE Class 12 Chemistry (043) sample paper
- CBSE Class 12 Biology (044) sample paper
- CBSE Class 12 English Core (301) sample paper
- CBSE Class 12 Accountancy (055) sample paper
- CBSE Class 12 Business Studies (054) sample paper
- CBSE Class 12 Economics (030) sample paper
- CBSE Class 12 Hindi Core (302) sample paper
- CBSE Class 12 Computer Science (083) sample paper
- CBSE Class 12 Geography (029) sample paper
- CBSE Class 12 Psychology (037) sample paper
- CBSE Class 12 History (027) sample paper
- CBSE Class 12 Political Science (028) sample paper
- CBSE Class 12 Sociology (039) sample paper
- CBSE Class 12 Applied Mathematics (241) sample paper
- CBSE Class 12 Physical Education (048) sample paper
