Students must start practicing the questions from CBSE Sample Papers for Class 12 Informatics Practices with Solutions Set 1 are designed as per the revised syllabus.
CBSE Sample Papers for Class 12 Informatics Practices Set 1 with Solutions
Time: 3 Hours
Maximum Marks: 70
General Instructions
- Please check this question paper 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:
Slicing can be used to extract a specific portion from a Pandas Series.
Answer:
True
Question 2.
The purpose of WHERE clause in a SQL statement is to:
(a) Create a table
(b) Filter rows based on a specific condition
(c) Specify the columns to be displayed
(d) Sort the result based on a column
Answer:
(b) Filter rows based on a specific condition
Question 3.
Identify the networking device responsible for routing data packets based on their destination addresses.
(a) Modem
(b) Hub
(c) Repeater
(d) Router
Answer:
(d) Router
![]()
Question 4.
Identify the SQL command used to delete a relation (table) from a relational database.
(a) DROP TABLE
(b) REMOVE TABLE
(c) DELETE TABLE
(d) ERASE TABLE
Answer:
(a) DROP TABLE
Question 5.
e-waste refers to:
(a) Software that has become obsolete
(b) Data that has been deleted from a storage device
(c) Viruses that infect computers
(d) Electronic devices that are no longer in use
Answer:
(d) Electronic devices that are no longer in use
Question 6.
Which of the following Python statements can be used to select a column column_name from a DataFrame df?
(a) df.getcolumn(‘column_name’)
(b) df[‘column_name’]
(c) df.select(‘column name’)
(d) df(column_name)
Answer:
(b) df[‘column_name’]
Question 7.
By default, the plot() function of Matplotlib draws a __________ plot.
(a) histogram
(b) column
(c) bar
(d) line
Answer:
(d) line
Question 8.
State whether the following statement is True or False:
In SQL, the HAVING clause is used to apply filter on groups formed by the GROUP BY clause.
Answer:
True
Question 9.
Which of the following Python statements is used to import data from a CSV file into a Pandas DataFrame.
(Note: pd is an alias for pandas)?
(a) pd.open_csv(‘filename.csv’)
(b) pd.read_csv(‘filename.csv’)
(c) pd.load_csv(‘filename.csv’)
(d) pd.import_csv(‘filename.csv’)
Answer:
(b) pd.read_csv(‘filename.csv’)
Question 10.
What is plagiarism?
(a) Using copyrighted material without giving proper acknowledgement to the source.
(b) Downloading illegal software.
(c) Spreading misinformation online.
(d) Hacking into computer systems.
Answer:
(a) Using copyrighted material without giving proper acknowledgement to the source
Question 11.
Fill in the blank:
The COUNT(*) function provides the total number of __________ within a relation (table) in a relational database.
(a) Columns
(b) Unique values
(c) Not-null values
(d) Rows
Answer:
(d) Rows
![]()
Question 12.
In which of the network topologies do all devices connect to a central point, such as a switch or hub?
(a) Star
(b) Bus
(c) Tree
(d) Mesh
Answer:
(a) Star
Question 13.
In a Pandas DataFrame, if the tail() function is used without specifying the optional argument indicating the number of rows to display, what is the default number of rows displayed, considering the DataFrame has 10 entries?
(a) 0
(b) 1
(c) 4
(d) 5
Answer:
(d) 5
Question 14.
Identify the type of cybercrime that involves sending fraudulent emails to deceive individuals into revealing sensitive information.
(a) Hacking
(b) Phishing
(c) Cyberbullying
(d) Cyberstalking
Answer:
(b) Phishing
Question 15.
While creating a Series using a dictionary, the keys of the dictionary become
(a) Values of the Series
(b) Indices of the Series
(c) Data type of the Series
(d) Name of the Series
Answer:
(b)Indices of the Series
Question 16.
Match the following SQL functions/clauses with their descriptions:
| SQL Function | Description |
| P. MAX() | 1. Find the position of a substring in a string. |
| Q. SUBSTRING() | 2. Returns the maximum value in a column. |
| R. INSTR() | 3. Sort the data based on a column. |
| S. ORDER BY | 4. Extract a portion of a string. |
(a) P – 2, Q – 4, R – 3, S – 1
(b) P – 2, Q – 4, R – 1, S – 3
(c) P – 4, Q – 3, R – 2, S – 1
(d) P – 4, Q – 2, R – 1, S – 3
Answer:
(b) P – 2, Q – 4, R – 1, S – 3
Question 17.
Fill in the blank:
Boolean indexing in Pandas DataFrame can be used for __________
(a) Creating a new DataFrame
(b) Sorting data based on index labels
(c) Joining data using labels
(d) Filtering data based on condition
Answer:
(d) Filtering data based on condition
Question 18.
Which Matplotlib plot is best suited to represent changes in data over time?
(a) Bar plot
(b) Histogram
(c) Line plot
(d) Histogram and Bar plot
Answer:
(c) Line plot
Question 19.
Which type of network covers a small geographical area like a single office, building, or school campus?
(a) PAN
(b) MAN
(c) LAN
(d) WAN
Answer:
(c) LAN
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): We can add a new column in an existing DataFrame.
Reason (R): DataFrames are size mutable.
Answer:
(a) In pandas, DataFrames are indeed mutable in terms of size, meaning you can add new columns or rows. This mutability allows you to modify the structure of the DataFrame, which is why you can add a new column. Hence, Both Assertion (A) and Reason (R) are true, and Reason (R) is the correct explanation of Assertion (A).
![]()
Question 21.
Assertion (A): In SQL, INSERT INTO is a Data Definition Language (DDL) Command.
Reason (R): DDL commands are used to create, modify, or remove database structures, such as tables.
Answer:
(d) The INSERT INTO command in SQL is a Data Manipulation Language (DML) command, not a Data Definition Language (DDL) command. DDL commands are used to define and modify the database schema, such as CREATE, ALTER, and DROP commands. Hence, Assertion (A) is False, but Reason (R) is True.
Section B
(7 × 2 = 14)
Question 22.
(A) What is a Series in Python Pandas? Also, give a suitable example to support your answer.
Or
(B) What does the term ‘library’ signify in Python? Mention one use for each of the following libraries:
- Pandas
- Matplotlib
Answer:
(A) Series in Pandas is a one-dimensional labeled array that can hold data of any type (integers, strings, floats, etc.). It is similar to a column in a spreadsheet or a single-column DataFrame.
Example:
import pandas as pd data = pd.Series([10, 20, 30, 40]) print(data)
Or
(B) In Python, a library is a collection of pre-written code that you can use to perform common tasks without writing them from scratch.
Use of Libraries:
Pandas: Used for data manipulation and analysis, such as handling data frames.
Matplotlib: Used for data visualization, like creating plots and charts.
Question 23.
What are intellectual property rights (IPR), and why are they important in the digital world?
Answer:
Intellectual Property Rights (IPR): These are legal rights that protect the creations of the human intellect. The nature of these works can be artistic, literary or technical, etc.
Importance in the digital world: These rights help prevent the unauthorized use or reproduction of digital content and ensure that creators are fairly compensated and incentivized for their original work.
Question 24.
Consider the string: “Database Management System”. Write suitable SQL queries for the following:
I. To extract and display “Manage” from the string.
II. Display the position of the first occurrence of “base” in the given string.
Answer:
I. SELECT SUBSTRING('Database Management System', 10, 6):
II. SELECT INSTR('Database Management System', 'base'):
Question 25.
(A) What is the Internet and how does it differ from the World Wide Web (WWW)?
Or
(B) Explain the concept of browser cookies and mention one advantage of using them.
Answer:
(A) The Internet is a global network of interconnected computers that enables communication and data sharing between devices. The World Wide Web (WWW) is a system of interlinked web pages accessible over the Internet. The Internet provides the infrastructure, while the WWW is one of the services that run on it.
Or
(B) Browser cookies are small text files stored on a user’s device by websites to remember user preferences, and login details, or track browsing activity.
Advantage: Cookies help improve user experience by remembering login details, and allowing automatic sign-ins without re-entering credentials each time.
Question 26.
Define the term Primary Key in a database. Explain how it is different from a Candidate Key.
Answer:
A Primary Key is a unique identifier for a record in a database table. It ensures that no two rows have the same value.
The difference between a Candidate Key and a Primary Key is that a table can have multiple Candidate Keys (potential unique identifiers), but only one Primary Key is chosen from them.
Question 27.
Mention two health concerns associated with excessive use of Digital Devices.
Answer:
Two health concerns associated with excessive use of digital devices are:
(i) Eye strain or Computer Vision Syndrome (CVS) due to prolonged screen time.
(ii) Musculoskeletal problems like neck and back pain from poor posture.
![]()
Question 28.
(A) Sneha is writing a Python program to create a DataFrame using a list of dictionaries. However, her code contains some mistakes. Identify the errors, rewrite the correct code, and underline the corrections made.
import Pandas as pd
D1 = {'Name': 'Rakshit', 'Age': 25}
D2 = {'Name': 'Paul', 'Age': 30}
D3 = {'Name': "Ayesha", 'Age': 28}
data = [D1,D2,D3)
df = pd.Dataframe(data)
print(df)
Or
(B) Complete the given Python code to get the required output (ignore the dtype attribute) as
Output
Tamil Nadu Chennai
Uttar Pradesh Lucknow
Manipur Imphal
Code
import __________ as pd data = ['Chennai','__________', 'Imphal'] indx = ['Tamil Nadu', 'Uttar Pradesh','Manipur'] s = pd.Series(__________, indx) print(__________)
Answer:
(A) import pandas as pd
D1 = {'Name': 'Rakshit', 'Age': 25}
D2 = {'Name': 'Paul', 'Age': 30}
D3 = {'Name': 'Ayesha'. 'Age': 28}
data = [D1, D2, D3]
df = pd.DataFrame(data)
print(df)
Or
(B) import pandas as pd
data = ['Chennai'. 'Lucknow', 'Imphal']
indx = ['Tamil Nadu','Uttar Pradesh','Manipur']
s = pd.Series(data, indx)
print(s)
Section C
(4 × 3 = 12)
Question 29.
Ayesha’s family is replacing their old computer with a new one. They decide to throw the old computer in a nearby empty field/plot.
I. Explain any one potential environmental hazard associated with improper e-waste disposal.
II. Suggest one responsible way to Ayesha’s family for proper disposal of their old computer.
III. Describe the importance of recycling in e-waste management.
Answer:
I. Environmental hazard: Improper disposal of e-waste can release toxic chemicals like lead and mercury into the soil and water, harming plants, animals, and human health.
II. Responsible disposal: Ayesha’s family can take the old computer to a certified e-waste recycling center to ensure safe and eco-friendly disposal.
III. Importance of recycling: Recycling helps recover valuable materials from e-waste, reduces the need for new resources, and minimizes the environmental impact of waste in landfills.
Question 30.
(A) Write a Python program to create the following DataFrame using a list of dictionaries.
| Product | Price | |
| 0 | Laptop | 60000 |
| 1 | Desktop | 45000 |
| 2 | Monitor | 15000 |
| 3 | Tablet | 30000 |
Or
(B) Write a Python Program to create a Pandas Series as shown below using a dictionary. Note that the left column indicates the indices and the right column displays the data.
| Russia | Moscow |
| Hungary | Budapest |
| Switzerland | Bern |
Answer:
(A) import pandas as pd
data = [{"Product": "Laptop", "Price": 60000}, {"Product": "Desktop", "Price": 45000}, {"Product": "Monitor", "Price": 15000}, {"Product": "Tablet". "Price": 30000}]
df = pd.DataFrame(data)
print(df)
Or
(B) import pandas as pd
data = {"Russia": "Moscow", "Hungary": "Budapest", "Switzerland": "Bern"}
series = pd.Series(data)
print(series)
Question 31.
I. Write an SQL statement to create a table named STUDENTS, with the following specifications:
| Column Name | Data Type | Key |
| StudentID | Numeric | Primary Key |
| FirstName | Varchar(20) | |
| LastName | Varchar(10) | |
| DateOfBirth | Date | |
| Percentage | Float(10,2) |
II. Write SQL query to insert the following data in the Students Table 1, Supriya, Singh, 2010-08-18, 75.5
Answer:
I. CREATE TABLE STUDENTS (StudentID NUMERIC PRIMARY KEY, FirstName VARCHAR(20), LastName VARCHAR(10), DateOfBirth DATE, Percentage FLOAT(10,2)); II. INSERT INTO STUDENTS (StudentID, FirstName, LastName, DateOfBirth, Percentage) VALUES (1, 'Supriya', 'Singh'. '2010-08-18', 75.5):
Question 32.
(A) Consider the following tables.
Table 1
EMPLOYEE which stores Employee ID (EMP_ID), Employee Name (EMP_NAME), Employee City (EMP_CITY)
Table 2
PAYROLL which stores Employee ID (EMP_ID), Department (DEPARTMENT), Designation (DESIGNATION), and Salary (SALARY) for various employees.
Note: Attribute names are written within brackets.

Write appropriate SQL queries for the following:
I. Display department-wise average Salary.
II. List all designations in the decreasing order of Salary.
III. Display employee names along with their corresponding departments.
Or
(B) Consider the following tables:
Table 1
ATHLETE, which stores AthletelD, Name, Country. The table displays basic information of the athletes
Table 2
MEDALS, which stores AthleteID, Sport, and Medals. The table displays the number of medals won by each athlete in their respective sports.

Write appropriate SQL queries for the following:
I. Display the sports-wise total number of medals won.
II. Display the names of all the Indian athletes in uppercase.
III. Display the athlete’s name along with their corresponding sports.
Answer:
(A) I. SELECT DEPARTMENT, AVG(SALARY) AS AVG_SALARY FROM PAYROLL GROUP BY DEPARTMENT: II. SELECT DESIGNATION FROM PAYROLL ORDER BY SALARY DESC; III. SELECT EMPLOYEE.EMPJAME, PAYROLL.DEPARTMENT FROM EMPLOYEE JOIN PAYROLL ON EMPLOYEE.EMP_ID = PAYROLL.EMP_ID; Or (B) I. SELECT Sport. SUM(Medals) AS Total_Medals FROM MEDALS GROUP BY Sport: II. SELECT UPPER(Name) FROM ATHLETE WHERE Country, = 'INDIA': III. SELECT A.Name. M.Sport FROM ATHLETE A JOIN MEDALS M ON A.AthletelD = M.AthleteID:
Section D
(2 × 4 = 8)
Question 33.
During a practical exam, a student Ankita has to fill in the blanks in a Python program that generates a bar chart. This bar chart represents the number of books read by four students in one month.

Help Ankita to complete the code.
import __________ as plt #Statement-1
students = ['Karan', 'Lina', 'Raj', 'Simran']
books_read = [12, 9, 5, 3]
plt.bar(students, __________, label='Books Read’) #Statement-2
plt.xlabel('Student Name')
pit.__________('Books Read') #Statement-3
plt.legend()
plt.title('__________') #Statement-4
plt.show()
I. Write the suitable code for the import statement 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. Fill in the blank in Statement 3 with the name of the function to set the label on the y-axis.
IV. Refer to the graph shown above and fill in the blank in Statement 4 with a suitable Chart Title.
Answer:
I. matplotlib pyplot
II. books_read
III. ylabel
IV. Number of Books Read by Students
![]()
Question 34.
(A) Rahul, who works as a database designer, has developed a database for a bookshop. This database includes a table BOOK whose column (attribute) names are mentioned below:
BCODE Shows the unique code for each book.
TITLE Indicates the book’s title.
AUTHOR Specifies the author’s name.
PRICE Lists the cost of the book.

I. Write SQL query to display book titles in lowercase.
II. Write SQL query to display the highest price among the books.
III. Write SQL query to display the number of characters in each book title.
IV. Write SQL query to display the Book Code and Price sorted by Price in descending order.
Or
(B) Dr. Kavita has created a database for a hospital’s pharmacy. The database includes a table named MEDICINE whose column (attribute) names are mentioned below:
MID Shows the unique code for each medicine.
MED_NAME Specifies the medicine name
SUPP_CITY Specifies the city where the supplier is located.
STOCK Indicates the quantity of medicine available.
DEL_DATE Specifies the date when the medicine was delivered.

Write the output of the following SQL Queries.
I. Select LENGTH(MED_NAME) from MEDICINE where STOCK > 100: II. Select MED_NAME from MEDICINE where month(DEL_DATE) = 4; III. Select MED_NAME from MEDICINE where STOCK between 120 and 200: IV. Select max(DEL_DATE) from MEDICINE:
Answer:
(A) I. SELECT LOWER(TITLE) AS titlelowercase FROM BOOK: II. SELECT MAX(PRICE) AS highest_price FROM BOOK: III. SELECT TITLE, LENGTH(TITLE) AS title_length FROM BOOK: IV. SELECT BCODE, PRICE FROM BOOK ORDER BY PRICE DESC: Or (B) I. Select LENGTH(MED_NAME) from MEDICINE where STOCK >100;II. Select MED_NAME from MEDICINE where month (DEL_DATE) = 4;
III. Select MEDJAME from MEDICINE where STOCK between 120 and 200;
IV. Select max(DEL_DATE) from MEDICINE;
Section E
(3 × 5 = 15)
Question 35.
ABC Pvt. Ltd., a multinational technology company, is looking to establish its Indian Head Office in Bengaluru, and a regional office branch in Lucknow. The Bengaluru head office will be organized into four departments: HR, FINANCE, TECHNICAL, AND SUPPORT. As a network engineer, you have to propose solutions for various queries listed from I to V.

The shortest distances between the departments/offices are as follows:
| HR TO FINANCE | 65 M |
| HR TO TECHNICAL | 80 M |
| HR TO SUPPORT | 70 M |
| FINANCE TO TECHNICAL | 60 M |
| FINANCE TO SUPPORT | 75 M |
| TECHNICAL TO SUPPORT | 50 M |
| BENGALURU OFFICE TO LUCKNOW | 1900 KM |
The number of computers in each department/office is as follows:
| HR | 175 |
| FINANCE | 35 |
| TECHNICAL | 50 |
| SUPPORT | 15 |
| LUCKNOW OFFICE | 40 |
I. Suggest the most suitable department in the Bengaluru Office Setup, to install the server. Also, give a reason to justify your suggested location.
II. Draw a suitable cable layout of wired network connectivity between the departments in the Bengaluru Office.
III. Which networking device would you suggest the company to purchase to interconnect all the computers within a department in Bengaluru Office?
IV. The company is considering establishing a network connection between its Bengaluru Head Office and Lucknow regional office. Which type of network—LAN, MAN, or WAN—will be created? Justify your answer.
V. The company plans to develop an interactive website that will enable its employees to monitor their performance after login. Would you recommend a static or dynamic website, and why?
Answer:
I. HR is the most suitable department because it has a maximum number of computers.
II.

III. Switch/Hub
IV. WAN
Reason: The distance between the Bengaluru Head Office and the Lucknow Regional Office is 1900 km, which is too large for a LAN (Local Area Network) or MAN (Metropolitan Area Network).
A WAN is designed to cover extensive geographic areas and is suitable for connecting remote offices over such long distances.
V. A dynamic website is recommended because:
Personalization: It allows for interactive features and personalized content based on user login information, such as performance metrics and personalized dashboards.
Real-Time Data: It can display real-time data updates, which is crucial for monitoring employee performance and other metrics.
Question 36.
Consider the DataFrame df shown below.

Write Python statements for the DataFrame df to:
I. Print the first two rows of the DataFrame df.
II. Display titles of all the movies.
III. Remove the column rating.
IV. Display the data of the ‘Title’ column from indexes 2 to 4 (both included).
V. Rename the column name ‘Title’ to ‘Name’.
Answer:
I. print(df.head(2))
II. print(df['Title'])
III. df = df.drop(columns=['Rating'])
IV. print(df.loc[2:4, 'Title'])
V. df = df.rename(columns={'Title': 'Name'})
![]()
Question 37.
(A) Write a suitable SQL query for the following:
I. To display the average score from the test_results column (attribute) in the Exams table.
II. To display the last three characters of the registration_number column (attribute) in the Vehicles table.
(Note: The registration numbers are stored in the format DL-01-AV-1234)
III. To display the data from the column (attribute) username in the Users table, after eliminating any leading and trailing spaces.
IV. To display the maximum value in the salary column (attribute) of the Employees table.
V. To determine the count of rows in the Suppliers table.
Or
(B) Write a suitable SQL query for the following:
I. Round the value of pi (3.14159) to two decimal places.
II. Calculate the remainder when 125 is divided by 8.
III. Display the number of characters in the word ‘NewDelhi’.
IV. Display the first 5 characters from the word ‘Informatics Practices’.
V. Display details from the ’email’ column (attribute), in the ‘Students’ table, after removing any leading and trailing spaces.
Answer:
(A) I. SELECT AVG(test_results) AS average_scoreFROM Exams;
II. SELECT RIGHT(registration_number, 3) AS last_three_characters FROM Vehicles;
III. SELECT TRIM(username) AS trimmed_username FROM Users;
IV. SELECT MAX(salary) AS max_salary FROM Employees;
V. SELECT COUNT(*) AS row_count FROM Suppliers;
Or
(B) I. SELECT ROUND(3.14159, 2);
II. SELECT MOD(125,8);
III. SELECT LENGTH('NewDelhi');
IV. SELECT SUBSTRING('Informatics Practices', 1, 5);
V. SELECT TRIM(email) FROM Students:
II. Select MED_NAME from MEDICINE where month (DEL_DATE) = 4;
III. Select MEDJAME from MEDICINE where STOCK between 120 and 200;
IV. Select max(DEL_DATE) from MEDICINE;
