CBSE Class XII • Session 2026-27

INFORMATICS PRACTICES

Code No. 065 | Sample Question Paper (Theory)

Time: 3 Hours • Max Marks: 70
Q1 Section A
1 Mark
A Pandas Series S1 is created with index labels ['a', 'b', 'c', 'd', 'e']. State whether the following statement is True or False:
"The statement S1 ['b':'d'] will produce the same result as S1 [1:3]."
Marking Scheme / Solution:
False
Reason: Label-based slicing S1['b':'d'] includes the stop label 'd' (returns 3 elements: b, c, d), whereas positional slicing S1[1:3] excludes index 3 (returns 2 elements: b, c).
Q2 Section A
1 Mark
Ravi needs to find the total number of characters in the StudentName column. Which SQL function should he use?
Marking Scheme / Solution:
C. LENGTH()
Q3 Section A
1 Mark
Which type of Intellectual Property Right (IPR) protects an invention by giving the creator exclusive rights to make, use, and sell it for a specific period?
Marking Scheme / Solution:
C. Patent
Q4 Section A
1 Mark
While plotting a graph using Matplotlib, which function is used to specify the label for the Y-axis?
Marking Scheme / Solution:
B. ylabel()
Q5 Section A
1 Mark
I am a networking device that converts digital data from a computer into analog signals for transmission, and then converts incoming analog signals back into digital data for the computer to understand. Who am I?
Marking Scheme / Solution:
C. Modem
Q6 Section A
1 Mark
Which of the following is a Data Manipulation Language (DML) command in SQL?
Marking Scheme / Solution:
C. UPDATE
Q7 Section A
1 Mark
The process of re-selling old electronic goods after minor repairs or modification is called:
Marking Scheme / Solution:
B. Refurbishing
Q8 Section A
1 Mark
What will be the output of the following code?
import pandas as pd
print(pd.Series(5, index=[0, 1, 2]))
Marking Scheme / Solution:
A. A Series with values 5, 5, 5
Q9 Section A
1 Mark
Fill in the blank:
The SQL clause used to filter the groups formed by the GROUP BY clause based on a specific condition is ____________.
Marking Scheme / Solution:
HAVING
Q10 Section A
1 Mark
Riya visited an online shopping website, and it saved small text files on her computer to remember her preferences and session details. What are these files called?
Marking Scheme / Solution:
C. Cookies
Q11 Section A
1 Mark
Which keyword is used with the ORDER BY clause to sort data in descending order?
Marking Scheme / Solution:
A. DESC
Q12 Section A
1 Mark
If we add two Pandas Series that do not have matching index labels, the result for those non-matching indices will be:
Marking Scheme / Solution:
C. NaN
Q13 Section A
1 Mark
The process of buying electronic gadgets only when necessary to minimize the generation of electronic waste is an example of which 'R' of e-waste management?
Marking Scheme / Solution:
C. Reduce
Q14 Section A
1 Mark
Which SQL function is used to extract a specific number of characters from a string starting from a given position?
Marking Scheme / Solution:
D. MID()
Q15 Section A
1 Mark
Aman is exporting a Pandas DataFrame to a CSV file using the to_csv() function. He wants to save only the data and avoid writing the row indices to the file. Which parameter should he set to False to prevent the indices from being included?
Marking Scheme / Solution:
C. index
Q16 Section A
1 Mark
Fill in the blank:
The process of storing a website on a web server so that it can be accessed over the internet is known as ____________.
Marking Scheme / Solution:
Web Hosting
Q17 Section A
1 Mark
A HR manager queries an employee database. He wants to retrieve only those records where the Commission field actually contains a value. Which SQL condition should he use?
Marking Scheme / Solution:
B. WHERE Commission IS NOT NULL
Q18 Section A
1 Mark
When creating a DataFrame from a list of dictionaries, the dictionary keys become:
Marking Scheme / Solution:
C. Column labels
Q19 Section A
1 Mark
State whether the following statement is True or False:
In SQL, the BETWEEN operator is inclusive of both the lower and upper values specified in the range.
Marking Scheme / Solution:
True
Q20 Section A
1 Mark
Assertion (A): The statement df.drop('Science', axis=0) will remove the column labeled 'Science' from the DataFrame.
Reason (R): In Pandas drop() method, axis=0 refers to row-wise operations and axis=1 refers to column-wise operations.
Marking Scheme / Solution:
D. Assertion (A) is False, but Reason (R) is True.
Reason: To drop a column, axis=1 must be used.
Q21 Section A
1 Mark
Assertion (A): In SQL, the query select * from emp; and SELECT * FROM EMP; will produce the same result.
Reason (R): SQL is a case-sensitive language.
Marking Scheme / Solution:
C. Assertion (A) is True and Reason (R) is False.
Reason: SQL is case-insensitive for standard statements.
Q22 Section B
2 Marks
(A) (i) Explain the use of the head() function in a Pandas DataFrame.
(ii) What happens if the parameter n is not specified in the head() function?
Marking Scheme / Solution (Option A):
(i) The head() function returns the first n rows of a DataFrame.
(ii) If n is not specified, it returns the first 5 rows by default.
--- OR ---
(B) Explain the concept of Boolean Indexing in DataFrames. Write a small Python code example to demonstrate it.
Marking Scheme / Solution (Option B):
Boolean Indexing uses boolean vectors (True/False values) to filter data in DataFrames.
df[df['Marks'] > 80]
Q23 Section B
2 Marks
Differentiate between an Active and a Passive digital footprint.
Marking Scheme / Solution:
Active digital footprint: Created intentionally when a user submits or shares data online (e.g., posting on social media).
Passive digital footprint: Created unintentionally without explicit user action (e.g., website cookies tracking browsing history).
Q24 Section B
2 Marks
Define Data Visualization and state its primary purpose.
Marking Scheme / Solution:
Data Visualization is the graphical representation of information and data using visual elements like charts, graphs, and maps.
Primary Purpose: To help analyze trends, patterns, and outliers in large datasets clearly and effectively.
Q25 Section B
2 Marks
(A) Define Star Topology. Mention one major advantage of using it.
Marking Scheme / Solution (Option A):
A network topology where all devices are individually connected to a central node (hub/switch).
Advantage: Failure of one cable/device does not affect the rest of the network.
--- OR ---
(B) What is VoIP? State any one advantage of using VoIP for communication.
Marking Scheme / Solution (Option B):
Voice over Internet Protocol (VoIP) enables voice communication and multimedia sessions over Internet Protocol (IP) networks.
Advantage: Cost-effective compared to traditional phone calls.
Q26 Section B
2 Marks
Write SQL queries for the following requirements:
(i) Display the last 3 characters of the attribute Ename from the EMPLOYEE table.
(ii) Find the position of the substring 'ma' in the string 'Informatics'.
Marking Scheme / Solution:
(i) SELECT RIGHT(Ename, 3) FROM EMPLOYEE;
(ii) SELECT INSTR('Informatics', 'ma');
Q27 Section B
2 Marks
Mention and briefly explain any two guidelines of netiquette.
Marking Scheme / Solution:
1. Respect Privacy: Do not share personal or confidential information of others without permission.
2. Avoid Shouting: Do not use ALL CAPITAL LETTERS in messages as it is considered equivalent to shouting.
Q28 Section B
2 Marks
(A) Consider the following two dictionaries:
dict1 = {'a': 10, 'b': 20}
dict2 = {'a': 5, 'b': 10, 'c': 20}
Write Python code to create a DataFrame from a list containing the above two dictionaries.
Marking Scheme / Solution (Option A):
import pandas as pd
dict1 = {'a': 10, 'b': 20}
dict2 = {'a': 5, 'b': 10, 'c': 20}
df = pd.DataFrame([dict1, dict2])
--- OR ---
(B) Mention the purpose of read_csv() and explain the use of its sep parameter.
Marking Scheme / Solution (Option B):
read_csv() reads a CSV file into a DataFrame. The sep parameter specifies the delimiter/separator character used in the file (default is comma ,).
Q29 Section C
3 Marks
Consider the following digital security scenarios and answer the questions:
(i) Mehak receives an SMS from an unknown number stating she has won a lottery. To claim it, she must click a link and enter her Aadhaar number and bank OTP. What type of cybercrime is this?
(ii) A group of people repeatedly post insulting comments and spread rumors about a classmate on a social media platform to distress them. What is this activity called?
(iii) Suggest one Communication Etiquette that should be followed to maintain credibility while participating in an online discussion forum.
Marking Scheme / Solution:
(i) Smishing / Phishing
(ii) Cyberbullying / Cyberstalking
(iii) Be polite, verify facts before posting, and give proper credit to original authors/sources.
Q30 Section C
3 Marks
(A) (i) Write a Python program to create a Pandas Series named Inventory from the following dictionary:
stock = {'Pens': 150, 'Erasers': 80, 'Sharpeners': 60, 'Notebooks': 200}
(ii) Consider two Series S1 and S2:
import pandas as pd
S1 = pd.Series([10, 20], index=['a', 'b'])
S2 = pd.Series([30, 40], index=['b', 'c'])
Write the output of: print(S1 + S2)
Marking Scheme / Solution (Option A):
(i)
import pandas as pd
stock = {'Pens': 150, 'Erasers': 80, 'Sharpeners': 60, 'Notebooks': 200}
Inventory = pd.Series(stock)
(ii) Output:
a     NaN
b    50.0
c     NaN
dtype: float64
--- OR ---
(B) Consider a DataFrame df as shown below:
IndexNameIPMaths
0Arpit9588
1Vani8992
2Chetan7880
Write Pandas statements to perform the following actions:
(i) Add a new column 'Total' containing the values [183, 181, 158].
(ii) Rename the 'Name' column to 'Student'.
(iii) Delete the 'Maths' column from the DataFrame.
Marking Scheme / Solution (Option B):
(i) df['Total'] = [183, 181, 158]
(ii) df.rename(columns={'Name': 'Student'}, inplace=True)
(iii) df.drop('Maths', axis=1, inplace=True)
Q31 Section C
3 Marks
Consider the table HOSPITAL:
PNoPNameDeptDOA
101Ravi KumarCardiology2024-05-12
102Anita SharmaNeurology2025-06-01
103Mohan DasCardiology2023-05-18
104Seema VermaOrthopedics2022-04-22
105Rahul SinghCardiology2025-03-30
Write SQL queries to perform the following tasks:
(i) Display the names of all patients in the Cardiology department in lowercase.
(ii) Display each patient's number along with the day name of the week on which they were admitted.
(iii) Display the patient names arranged in alphabetical order.
Marking Scheme / Solution:
(i) SELECT LOWER(PName) FROM HOSPITAL WHERE Dept = 'Cardiology';
(ii) SELECT PNo, DAYNAME(DOA) FROM HOSPITAL;
(iii) SELECT PName FROM HOSPITAL ORDER BY PName ASC;
Q32 Section C
3 Marks
(A) Consider a table named STUDENT containing the following data:
IDNameDOB
1Aman2005-08-15
2Vinod2006-01-26
3Saurabh2004-01-01
Write the output of the following SQL queries:
(i) SELECT UPPER(Name), LENGTH(Name) FROM STUDENT WHERE ID = 2;
(ii) SELECT DAY(DOB), YEAR(DOB) FROM STUDENT WHERE ID = 3;
(iii) SELECT RIGHT(Name, 3) FROM STUDENT WHERE ID = 1;
Marking Scheme / Solution (Option A):
(i) VINOD | 5
(ii) 1 | 2004
(iii) man
--- OR ---
(B) Write the output of the following SQL queries:
(i) SELECT POWER(MOD(13, 5), 2);
(ii) SELECT UCASE(MID("Digital India", 9, 5));
(iii) SELECT LENGTH(TRIM(" Informatics "));
Marking Scheme / Solution (Option B):
(i) 9 (Since 13 % 5 = 3, and 3^2 = 9)
(ii) INDIA
(iii) 11
Q33 Section D
4 Marks
Write a Python program using Matplotlib to plot a Line Graph showing the "Monthly Sales" of a shop with the following data:
Months: ['Jan', 'Feb', 'Mar', 'Apr']
Sales: [12000, 15000, 11000, 18000]

The program should include:
• Code to import the required library.
• Code to plot the line graph with a label "Sales".
• A title "Sales Performance".
• Labels for both X-axis ("Month") and Y-axis ("Amount").
• Code to display the legend and show the plot.
Marking Scheme / Solution:
import matplotlib.pyplot as plt

months = ['Jan', 'Feb', 'Mar', 'Apr']
sales = [12000, 15000, 11000, 18000]

plt.plot(months, sales, label="Sales")
plt.title("Sales Performance")
plt.xlabel("Month")
plt.ylabel("Amount")
plt.legend()
plt.show()
Q34 Section D
4 Marks
(A) Consider the following tables:
Table: SPORTS
RegNoSNameGameFees
101AryanCricket500
102RiyaTennis600
103KabirCricket500
104IshaanTennis600
105TejasFootball750
Table: COACH
CoachIDCNameGame
C1VenkateshCricket
C2RameshwarTennis
C3SridharFootball
Write SQL queries for the following:
(i) Display the Game name and total fees collected for each game, but only for games where total fees exceed 1000.
(ii) Display the Student Name (SName) and their respective Coach Name (CName).
Marking Scheme / Solution (Option A):
(i) SELECT Game, SUM(Fees) FROM SPORTS GROUP BY Game HAVING SUM(Fees) > 1000;
(ii) SELECT SName, CName FROM SPORTS, COACH WHERE SPORTS.Game = COACH.Game;
--- OR ---
(B) Consider the following tables:
Table: Employee
EmpIDNameDeptIDSalary
301AaravD15200
302RiyaD27500
303KabirD26800
304AnanyaD34000
305IshaanD14900
Table: Department
DeptIDDeptName
D1HR
D2IT
D3Sales
Write the output of the following SQL queries:
(i) SELECT DeptID, COUNT(*), MAX(Salary) FROM Employee GROUP BY DeptID HAVING COUNT(*) > 1 ORDER BY DeptID;
(ii) SELECT Name, DeptName FROM Employee, Department WHERE Employee.DeptID = Department.DeptID AND Employee.Salary > 6000;
Marking Scheme / Solution (Option B):
(i)
D1 | 2 | 5200
D2 | 2 | 7500

(ii)
Riya | IT
Kabir | IT
Q35 Section E
5 Marks
Tech-Innovate Pvt Ltd is setting up a campus network connecting four blocks: Block A, Block B, Block C, and Block D.

Distance between blocks:
FromToDistance
Block ABlock B40 m
Block ABlock C50 m
Block ABlock D160 m
Block BBlock C70 m
Block BBlock D60 m
Block CBlock D120 m
Number of computers:
BlockNo. of Computers
Block A25
Block B60
Block C15
Block D150
As a network engineer, answer the following questions:
(i) Suggest the most suitable block to install the server. Justify your answer.
(ii) What type of network (PAN, LAN, MAN, or WAN) will be formed within the campus?
(iii) Suggest the placement of a Switch with suitable justification.
(iv) The company wants to host a website where clients can log in and see real-time project updates. Should they develop a Static or a Dynamic website? Why?
(v) Identify between which blocks a repeater is needed and justify your answer.
Marking Scheme / Solution:
(i) Block D because it has the maximum number of computers (150) to minimize network traffic (80/20 rule).
(ii) LAN (Local Area Network) as all blocks are within campus distance.
(iii) A Switch should be placed in each block (A, B, C, and D) to connect all computers within that block together.
(iv) Dynamic Website, because user logins and real-time updates require interaction with a backend database.
(v) A repeater is needed between Block A and Block D because the distance exceeds 100 meters (160m).
Q36 Section E
5 Marks
(i) Create a DataFrame named StoreDF as shown below using a dictionary of Series:
IndexItemsQuantityUnit_Price
0Bread5030
1Milk10025
2Eggs1206
Write suitable Pandas statements to perform the following operations:
(ii) Add a new row containing data ['Butter', 40, 55] at index position 3.
(iii) Display values of the 'Items' column only.
Marking Scheme / Solution:
(i)
import pandas as pd
data = {
    'Items': pd.Series(['Bread', 'Milk', 'Eggs']),
    'Quantity': pd.Series([50, 100, 120]),
    'Unit_Price': pd.Series([30, 25, 6])
}
StoreDF = pd.DataFrame(data)
(ii) StoreDF.loc[3] = ['Butter', 40, 55]
(iii) print(StoreDF['Items'])
Q37 Section E
5 Marks
(A) Refer to the table given below:
BookIDTitleAuthorPrice
201Wings of FireAPJ Abdul Kalam350
202The GuideR. K. Narayan299
203The God of Small ThingsArundhati Roy399
204Malgudi DaysR. K. Narayan280
Write SQL commands for the following tasks:
(i) Insert a new record into the table with values: 205, 'The White Tiger', 'Aravind Adiga', 350.
(ii) Update the Price of the book with BookID 202 to 325.
(iii) Delete the records of all books written by 'R. K. Narayan'.
(iv) Add a new column Publisher of type VARCHAR(30) to the table.
(v) Drop the table BOOK from the database.
Marking Scheme / Solution (Option A):
(i) INSERT INTO BOOK VALUES (205, 'The White Tiger', 'Aravind Adiga', 350);
(ii) UPDATE BOOK SET Price = 325 WHERE BookID = 202;
(iii) DELETE FROM BOOK WHERE Author = 'R. K. Narayan';
(iv) ALTER TABLE BOOK ADD Publisher VARCHAR(30);
(v) DROP TABLE BOOK;
--- OR ---
(B) Consider a table named PRODUCT with columns: PCode, PName, Category, Qty, Price, ExpiryDate.
Write SQL queries for:
(i) Display PName and its Price rounded to one decimal place.
(ii) Display the names of products that end with the letter 's'.
(iii) Display PName and Category of products whose Price is less than or equal to 500.
(iv) Display the total quantity of all products.
(v) Display PName after removing leading spaces only.
Marking Scheme / Solution (Option B):
(i) SELECT PName, ROUND(Price, 1) FROM PRODUCT;
(ii) SELECT PName FROM PRODUCT WHERE PName LIKE '%s';
(iii) SELECT PName, Category FROM PRODUCT WHERE Price <= 500;
(iv) SELECT SUM(Qty) FROM PRODUCT;
(v) SELECT LTRIM(PName) FROM PRODUCT;