Students must start practicing the questions from CBSE Sample Papers for Class 12 Informatics Practices with Solutions Set 3 are designed as per the revised syllabus.
CBSE Sample Papers for Class 12 Informatics Practices Set 3 with Solutions
Time: 3 Hours
Maximum Marks: 70
General Instructions
- Please check this question paper, which contains 37 questions.
- All questions are compulsory. However, internal choices have been provided in some questions. Attempt only one of the choices in such questions.
- The paper is divided into 5 Sections – A, B, C, D and E.
- Section A consists of 21 questions (1 to 21). Each question carries 1 Mark.
- Section B consists of 7 questions (22 to 28). Each question carries 2 Marks.
- Section C consists of 4 questions (29 to 32). Each question carries 3 Marks.
- Section D consists of 2 case study-type questions (33 to 34). Each question carries 4 Marks.
- Section E consists of 3 questions (35 to 37). Each question carries 5 Marks.
- All programming questions are to be answered using Python Language only.
- In the case of MCQ, the text of the correct answer should also be written.
Section A
(21 × 1 = 21)
Question 1.
State whether the following statement is True or False:
By default, Pandas’Series creates an integer index starting from zero if no index is provided.
Answer:
True
Question 2.
Which SQL statement is used to insert new data into a table?
(a) UPDATE
(b) INSERT INTO
(c) ALTER TABLE
(d) SELECT
Answer:
(b) INSERT INTO
Question 3.
Which protocol is used to assign IP addresses dynamically in a network?
(a) DHCP
(b) FTP
(c) TCP
(d) HTTP
Answer:
(a) DHCP
Question 4.
Which of the following commands is not a data manipulation command?
(a) SELECT
(b) INSERT
(c) UPDATE
(d) ALTER
Answer:
(d) ALTER
![]()
Question 5.
The electronic discovery technique used to determine and reveal technical criminal evidence is called ___________
(a) cyber investigation
(b) cyber evidence
(c) cyber forensics
(d) cyber intrude
Answer:
(c) cyber forensics
Question 6.
Which of the following method is used to remove missing values (NaN) from a DataFrame df?
(a) df.fillna()
(b) df.dropna()
(c) df.clean()
(d) df.replace_na()
Answer:
(b) df.dropna()
Question 7.
Which parameter is used to define the position/alignment of the plot title in the title() function?
(a) pos
(b) align
(c) loc
(d) All of these
Answer:
(c) loc
Question 8.
State whether the following statement is True or False:
SQL’s WHERE clause can be used to filter rows before the GROUP BY clause is applied.
Answer:
True
Question 9.
Which function is used to save a DataFrame to a CSV file in pandas (Note: df is a DataFrame object)?
(a) df.to_save(‘filename.csv’)
(b) df.write_csv(‘filename.csv’)
(c) df.save_csv(‘filename.csv’)
(d) df.to_csv(‘filename.csv’)
Answer:
(d) df.to_csv(‘filename.csv’)
Question 10.
The term phishing is synonymous to the term
(a) spoofing
(b) spooling
(c) stalking
(d) None of these
Answer:
(a) spoofing
Question 11.
Fill in the Blank.
In SQL, the ___________ operator is used to combine the result sets of two SELECT queries.
(a) UNION
(b) JOIN
(c) INTERSECT
(d) SELECT
Answer:
(a) UNION
Question 12.
In which topology is each device connected to a central hub or switch?
(a) Ring
(b) Bus
(c) Star
(d) Mesh
Answer:
(c) Star
Question 13.
Which of the following can be used to specify the data while creating a DataFrame?
(a) Series
(b) List of Dictionaries
(c) Structured ndarray
(d) All of these
Answer:
(d) All of these
Question 14.
Rohit forgot his laptop in his car and when he came back, he found his laptop was missing. This act is ___________
(a) cybercrime
(b) phishing
(c) theft
(d) plagiarism
Answer:
(c) theft
Question 15.
To display last five rows of a series object “M”, you may write
(a) M.Head()
(b) M.Tail(5)
(c) M.Head(5)
(d) M.tail()
Answer:
(d) M.tail()
![]()
Question 16.
Match the following SQL functions/clauses with their descriptions:
| SQL Function | Description |
| P. NOW() | 1. Returns the system date and time. |
| Q. GETDATE() | 2. Returns the current date. |
| R. DATE() | 3. Extracts the date part from a datetime. |
| S. CURDATE() | 4. Returns the current date and time. |
(a) P – 4, Q – 1, R – 3, S – 2
(b) P – 2, Q – 3, R – 1, S – 4
(c) P – 1, Q – 4, R – 3, S – 2
(d) P – 4, Q – 3, R – 2, S – 1
Answer:
(b) P – 2, Q – 3, R – 1, S – 4
Question 17.
Fill in the Blank.
While creating a DataFrame Sunil wanted to specify the datatype, _________ property will help him to do so.
(a) datatype
(b) type
(c) dtype
(d) dt
Answer:
(c) dtype
Question 18.
Which is/are the parameter(s) that can be used in grid() function to specify the line properties?
(a) color
(b) linestyle
(c) linewidth
(d) All of these
Answer:
(d) All of these
Question 19.
Which protocol is used to securely access a remote computer over the internet?
(a) FTP
(b) Telnet
(c) SSH
(d) SMTP
Answer:
(c) SSH
Directions (Q. Nos. 20 and 21) are Assertion (A) and Reason (R) Type questions. Choose the correct option as:
(a) Both Assertion (A) and Reason (R) are true, and Reason (R) is the correct explanation of Assertion (A)
(b) Both Assertion (A) and Reason (R) are true, but Reason (R) is not the correct explanation of Assertion (A)
(c) Assertion (A) is True, but Reason (R) is False
(d) Assertion (A) is False, but Reason (R) is True
Question 20.
Assertion (A): Some time we want to combine the two DataFrame using the merge() function.
Reason (R): Merging operation can be performed only with common values of column not with specific column.
Answer:
(c) The joining is performed on columns or indexes.
If the joining is done on columns, indexes are ignored.
We can specify the column names to use for merging using “on” parameter.
Hence A is true and R is false.
Question 21.
Assertion (A): The SQL command ‘ALTER TABLE’ is used to modify the structure of an existing table.
Reason (R): ‘ALTER TABLE’ can be used to add or delete columns from an existing table.
Answer:
(a) ‘ALTER TABLE’ allows modification of table structures, such as adding or deleting columns.
Hence, Both A and R are true, and R is the correct explanation of A.
Section B
(7 × 2 = 14)
Question 22.
(A) What are the differences between a Series and a DataFrame?
Or
(B) What is the use of matplotlib and pyplot?
Answer:
(A) 1. Series: 1D array-like structure with labeled indices.
2. DataFrame: 2D table-like structure with labeled axes (rows and columns).
Or
(B) 1. matplotlib: A library for creating static, animated, and interactive visualizations in Python.
2. pyplot: A module within matplotlib that provides a MATLAB-like interface for making plots and graphs.
Question 23.
Mention any four networking etiquettes.
Answer:
Four networking etiquettes:
- Be respectful and polite in all communications.
- Use clear and professional language.
- Avoid spamming or sending irrelevant messages.
- Respect others’ privacy and confidentiality.
Question 24.
Sangeetha is a database administrator who needs to display Block the total number of records of 2 and 3 Block Apartments. She is encountering an error while executing the following query:
SELECT BLOCK, COUNT (*) FROM APARTMENTS GROUP BY BLOCK WHERE BLOCK=2 OR 3;
Help her identify the reason for the error and write the correct query by suggesting the possible correction (s).
Answer:
The error in the query is due to the incorrect placement of the WHERE clause. It should come before the GROUP BY. The correct query is:
SELECT BLOCK, COUNT(*) FROM APARTMENTS WHERE BLOCK = 2 OR BLOCK = 3 GROUP BY BLOCK;
Question 25.
(A) Identify the following devices:
(i) An intelligent device that connects several nodes to form a network and redirects the received information only to the intended node(s).
(ii) A device that regenerates (amplifies) the received signal and re-transmits it to its destinations.
Or
(B) What is a modem?
Answer:
(A) (i) Switch
(ii) Repeater
Or
(B) Modem stands for Modulator/Demodulator, which converts the analog signal into a digital signal and again digital signal into an analog signal. It is used to connect the computers and transmit data using telephone lines.
![]()
Question 26.
Differentiate Unique and NOT NULL constraints.
Answer:
| Unique | NOT NULL |
| Ensures distinct values in a field. | Ensures non-blank values in a field. |
| Allows NULL values in the column. | Does not allow NULL values. |
| Does not allow duplicate values in the column. | Allows duplicate values in the column. |
Question 27.
According to a survey, one of the major Asian countries generates approximately about 2 million tonnes of electronic waste per year. Only 1.5 % of the total e-waste gets recycled. Suggest a method to manage e-waste.
Answer:
To manage e-waste, promote e-waste recycling programs, enforce proper disposal regulations, encourage manufacturer take-back schemes, and spread awareness about the environmental impact of e-waste.
Question 28.
(A) The Python code written below has syntactical errors. Rewrite the correct code and underline the corrections made.
import pandas as Pd
data = {Name ['Alice'. 'Bob', 'Charlie'], Age [25, 30, 22]}
df = pd.DataFrame(Data)
df['Country'] = ['USA', 'Canada', 'UK']
print(df)
Or
(B) Complete the given Python code: to rename the column Age to Years in the DataFrame df and display the updated DataFrame.
import __________ as pd
df = pd.DataFrame({'Name': ['John', 'Alice', 'Bob'], 'Age': [25, 30, 22]})
df = df._________(columns={'Age':_________})
print(df)
Answer:
(A) import pandas as pd
data ={'Name': ['Alice'. 'Bob'. 'Charlie'], 'Age': [25. 30, 22]}
df = pd.DataFrame(data)
df['Country'] = ['USA', 'Canada', 'UK']
print(df)
Or
(B) import pandas as pd
df = pd.DataFrame({'Name': ['John', 'Alice', 'Bob'], 'Age': [25, 30, 22]})
df = df.rename(columns={'Age': 'Years'})
print(df)
Section C
(4 × 3 = 12)
Question 29.
Rohan is a student working with electronic materials and computers. Recently he found some of his hardware parts were not working. He wanted to throw them anywhere outside. His friend suggested he not to do so and treat the e-wastes properly. Answer the following questions in this scenario:
(i) What are eWastes?
(ii) What are the advantages of proper treatment of e-Wastes?
(iii) Which of the following are not eWastes?
Books, defective mouse, defective motherboard, plastic toys, defective keyboard.
Answer:
(i) Electronic waste (e-waste), is a generic term used to describe all types of old, end-of-life or discarded electrical and electronic equipment, such as household appliances; office information and communications equipment; entertainment and consumer electronic equipment; lighting equipment; electric and electronic tools, etc.
(ii) Advantages
- It Prioritizes Environmental Protection.
- E-waste Recycling Helps to Conserve Available Natural Resources.
- Creates Jobs.
- Saves Landfill and Reduces GHG emissions.
- Prevent Water Bodies from Toxic Waste Poisoning.
(iii) Books, Plastic toys.
Question 30.
(A) Consider the DataFrame MyDF given below and create a DataFrame using a list of dictionaries:

Or
(B) Write a program to create a series object using a dictionary that stores the number of students in each house of class 12B of your school.
Note: Assume four house names are Beas, Chenab, Ravi and Satluj having 18, 2, 20, 18 students respectively and pandas library has been imported as pd.
Answer:
(A) import pandas as pd
data = [{'Emp_id': 'E001'. 'Name': 'Ritvi'. 'Designation': 'Clerk', 'City': 'Gurugram', 'Salary': 32000},
{'Emp_id': 'E025', 'Name': 'Riya'. 'Designation': 'Programmer', 'City': 'Delhi', 'Salary': 65000},
{'Emp_id': 'E034', 'Name': 'Gaurav', ’Designation’: 'Data Analyst', 'City': 'Bangalore', 'Salary': 95000},
{'Emp_id': 'EQ16', 'Name': 'Kanishka', 'Designation': 'Manager', 'City': 'Mumbai', 'Salary': 87000}
]
MyDF = pd.DataFrame(data)
print(MyDF)
Or
(B) import pandas as pd
house_data = {‘Beas’: 18, 'Chenab': 2, 'Ravi': 20. 'Satluj': 18}
# Creating Series object
house_series = pd.Series(house_data)
print(house_series)
Question 31.
I. Write an SQL statement to create a table named DOCTORS, with the following specifications:
DoctorID: INTEGER, Primary Key, Auto Increment
FirstName: VARCHAR(50), cannot be NULL
LastName: VARCHAR(50), cannot be NULL
Specialization: VARCHAR(100), cannot be NULL
DateOfJoining: DATE, cannot be NULL
Salary: DECIMAL(10, 2)
II. Write SQL Query to insert the following data in the DOCTORS Table:
1, Anil, Sharma, Cardiologist, 2015-05-20, 120000.50
Answer:
I. CREATE TABLE DOCTORS ( DoctorID INTEGER PRIMARY KEY AUT0_INCREMENT, FirstName VARCHAR(50) NOT NULL, LastName VARCHAR(50) NOT NULL, Specialization VARCHAR(100) NOT NULL, DateOfJoining DATE NOT NULL, Salary DECIMAL(10, 2)); II. INSERT INTO DOCTORS (DoctorID, FirstName, LastName, Specialization, DateOfJoining, Salary) VALUES (1, 'Anil', 'Sharma', 'Cardiologist', '2015-05-20', 120000.50);
Question 32.
(A) Consider the following tables CABHUB and CUSTOMER.

Write SQL commands for the following statements:
(i) To display the names of all the white-coloured vehicles.
(ii) To display the name of vehicle name and the capacity of vehicles in ascending order of their sitting capacity.
(iii) To display the customer name and the corresponding name of the vehicle hired by them.
Or
(B) Consider the following tables EMPLOYEE and DEPARTMENT.

Write SQL commands for the following statements:
(i) To display all DepName along with the DepCde in descending order of DepCde.
(ii) To display the average age of Employees in DepCde as 103.
(iii) To display the name of DepHead of the Employee named “Sanjeev P”
Answer:
(A) (i) SELECT VehicleName FROM CABHUB WHERE Colour = “WHITE”; (ii) SELECT VehicleName, Capacity From CABHUB ORDER BY Capacity ASC; (iii) SELECT Cname,VehicleName FROM CABHUB, CUSTOMER WHERE CUSTOMER. Vcode=CABHUB, Vcode; Or (B) (i) SELECT DEPNAME, DEPARTMENT. DepCde FROM EMPLOYEE, DEPARTMENT WHERE EMPLOYEE. DepCDE= DEPARTMENT. DepCde Order by DepCde DESC; (ii) Select AVG (Age) from EMPLOYEE WHERE DepCde=“103’’; (iii) SELECT DeptHead FROM DEPARTMENT WHERE Employee, TName= “Sanjeev P” AND EMPLOYEE, DepCde = 'DEPARTMENT. DepCde;
Section D
(2 × 4 = 8)
Question 33.
Consider the following data of COVID-19-affected patients in various countries. This data is represented by a bar chart and students have to fill in the blanks of the Python program in their practical exam.

import matplotlib.pyplot as plt
countries = ['India', 'America', 'Brazil', 'Russia', 'South Africa', 'Peru', 'Chili', 'Spain']
patients = [20, 50, 30, 10, 6, 5, 4, 4]
plt.bar(_________,_________) # Statements 1, 2
plt.xlabel('_________') # Statement 3
plt.ylabel('COVID-19 affected patients (in Lakh)')
plt.title('C0VID19 Affected Patients in Various Countries')
plt.__________() # Statement 4
I. Write the suitable code in the blank space in the line marked as Statement 1.
II. Refer to the graph shown above and fill in the blank in Statement 2 with suitable Python code.
III. Statement 3 with the name of the x-axis.
IV. Refer to the graph shown above and fill in the blank in Statement 4 with a suitable function.
Answer:
I. countries
II. patients
III. Countries
IV. show()
![]()
Question 34.
(A) New Youngs club is maintaining the following table “Football” for keeping records of players. Write SQL queries for them for the table as instructed:
PID Shows the unique code for each book.
PlayerName Specifies the player name.
Matches Specifies the number of matches
Goals Show the Goals of each player.

(a) Display the names and matches of all players.
(b) Display the last 3 characters of all players and the matches played by them.
(c) Increase the Goals of all players by 2.
(d) Change the width of the Playername column to varchar(40).
Or
(B) Consider the table PERSONS given below. Write the output for (i) to (iv).

(i) SELECT SurName FROM PERSONS WHERE BasicSalary>= 50000;
(ii) SELECT SUM (BasicSalary) FROM PERSONS WHERE Gender = ‘F’;
(iii) SELECT Gender. MIN (BasicSalary) FROM PERSONS GROUP BY Gender;
(iv) SELECT Gender, COUNT (*) FROM PERSONS GROUP BY Gender;
Answer:
(A) (a) Select PlayerName, Matches from Football; (b) Select right(PIayerName, 3), Matches from Football; (c) Update Football set Goals =Goals+2 ; (d) Alter table Football Modify Playername varchar(40);
Or
(B)

Section E
(3 × 5 = 15)
Question 35.
China Middleton Fashion is planning to expand its network in India, starting with two cities to provide infrastructure for the distribution of its products.
The company has planned to set up its main office in Chennai at three different locations and has named their offices as Production Unit, Finance Unit, and Media Unit. The company has its Corporate Unit in Delhi.
A rough layout of the same is as follows:

Approximate distance between these units is as follows:

In continuation of the above, the company experts have planned to install the following number of computers in each of these units.

(i) Suggest the kind of network required (out of LAN, MAN, WAN) for each of the following units.
(a) Production Unit and Media Unit
(b) Production Unit and Finance Unit
(ii) Which of the following devices will you suggest for connecting all computers with each of their office units?
(a) Switch/Hub
(b) Modem
(c) Telephone
(iii) Suggest a cable/wiring layout for connecting the company’s local office units located in Chennai.
(iv) After setting up the lab and the Internet in the lab, the company is now required to enable videos and animations to be played on the web browser for its employees. Which browser tool/service can be used for the same?
(v) Give an example of an Open Source web browser.
Answer:
(i) (a) The type of network between the Production Unit and Media Unit is LAN (Local Area Network).
(b) The type of network between the Production Unit and the Finance Unit is MAN (Metropolitan Area Network).
(ii) (a) The suitable device for connecting all the computers within each of their office units is a switch/hub.
(iii) The cable/wiring layout for connection is as follows:

(iv) Add-ons browser tools/services can be used to enable videos and animations to be played on the web browser for students of multimedia class.
(v) Google Chrome, Firefox.
Question 36.
A DataFrame df stores data about passengers, Flights and Years. First few of the DataFrame are shown below:

1. Add both the male and female passengers and assign to the column “Total_passengers”.
2. Display the maximum passengers of male passengers and maximum passengers in female passengers of the DataFrame.
3. Display the DataFrame.
4. Display the average number of total passengers in the DataFrame.
5. Display the data for the month with the highest total passengers.
Answer:
1. df['Total_passengers'] = df['MalePassengers'] + df['FemalePassengers']
2. max_male = df[’Mai ePassengers'], max()
max_female = df['FemalePassengers'], max()
print(f''Maximum Male Passengers: (max_male)")
print(f"Maximum Female Passengers: (max_femalel"))
3. print(df)
4. average_total = df['Total _passengers'].mean()
print(f"Average Total Passengers: {average_total}")
5. max_total = df[df['Total_passengers'] == df['Total_passengers'].max()]
print(max_total)
![]()
Question 37.
(A) Write the names of SQL functions which will perform the following operations:
(i) To display the current date.
(ii) To convert the string in capital letters Thiruvananthapuram.
(iii) To remove spaces from the end of the string “Delhi Public School, Meerut”.
(iv) To display the month from the current date.
(v) To compute the power of a number nl raised to the power n2.
Or
(B) Explain the following SQL functions using suitable examples.
(i) LCASE()
(ii) RTRIM()
(iii) MID()
(iv) YEAR()
(v) POWER()
Answer:
(A) (i) CURRENT_DATE()
(ii) UPPER('Thiruvananthapuram)
(iii) RTRIM('Delhi Public School, Meerut')
(iv) MONTH (CURRENT_DATE())
(v) P0WER(n1, n2)
Or
(B) (i) LCASE(): Converts a string to lowercase.
Example: SELECT LCASE(‘HELLO’);
Output: ‘hello’
(ii) RTRIM(): Removes trailing spaces from a string.
Example: SELECT RTRIM(‘HELLO’);
Output: ‘HELLO’
(iii) MID(): Extracts a substring from a string starting from a specified position.
Example: SELECT MI0(‘HELLO’, 2, 3);
Output: ‘ELL’
(iv) YEAR(): Extracts the year from a date.
Example: SELECT YEAR(‘2024-09-06’);
Output: 2024
(v) POWER(): Raises a number to a specified power.
Example: SELECT POWER(2, 3);
Output: 8