CBSE Sample Papers for Class 12 Informatics Practices Set 8 with Solutions

Students must start practicing the questions from CBSE Sample Papers for Class 12 Informatics Practices with Solutions Set 8 are designed as per the revised syllabus.

CBSE Sample Papers for Class 12 Informatics Practices Set 8 with Solutions

Time Allowed: 3 hours
Maximum Marks: 70

General Instructions:

  1. This question paper contains five sections, Section A to E.
  2. All questions are compulsory.
  3. Section A has 18 questions carrying 01 mark each.
  4. Section B has 07 Very Short Answer type questions carrying 02 marks each.
  5. Section C has 05 Short Answer type questions carrying 03 marks each.
  6. Section D has 02 questions carrying 04 marks each.
  7. Section E has 03 questions carrying 05 marks each.
  8. All programming questions are to be answered using Python Language only.

Section – A

Question 1.
Intentionally kept traces of activities done over the web are called ____. [1](a) passive digital footprints
(b) data prints
(c) digital traceback
(d) active digital footprints
(d) active digital footprints

Question 2.
Snigdha found her image attached to an unknown person and published in a social networking site. What should she do? [1](a) Complain the cyber crime cell
(b) Ignore it
(c) Upload more pictures of herself
(d) Try to contact the source
(a) Complain the cyber crime cell

Question 3.
While creating a Series, the number of values [1](a) should be same as number of indexes
(b) can be more than the number of indexes
(c) can be less than the number of indexes
(d) Both (b) and (c)
(a) Should be same as number of indexes

Question 4.
Selling of a software illegally for temporary use as on rent basis is called . [1](a) Renting
(b) Softlifting
(c) Downloading
(d) Counterfeiting
(a) Renting

Question 5.
Which of the following function returns only date part from the given date/time argument? [1](a) DATE( )
(b) CURDATE( )
(c) DATECUR( )
(d) None of these
(a) DATE()

Question 6.
Which of the following cannot be used to access data from a DataFrame?
(a) loc ( )
(b) iloc( )
(c) head( )
(d) getdata( )
(d) getdata( )

Question 7.
Sunaina’s computer system was not working due to a problem in the CPU, what should she do with it? [1](a) Dispose the entire set and buy a new one
(b) Keeping the usable components dispose the unused parts to an e-Waste recycler
(c) Dispose the system casually anywhere
(d) Give it to her sister for play
(b) Keeping the usable components dispose the unused parts to an e-Waste recycler

Question 8.
The “T” property can be used on [1](a) Series
(b) DataFrame
(c) Both (a) and (b)
(d) invalid parameter
(b) DataFrame

Question 9.
Use of electronic means to perform business transactions are related to [1](a) e-Commerce
(b) e-Business
(c) e-Shopping
(d) All of these
(d) All of these

Question 10.
What will be returned by the given query’? [1]SELECT INSTR(‘INDIA’, ‘DI) :
(a) 2
(b) 3
(c) -2
(d) – 3
(b) 3

Question 11.
____ is a text based web browser? [1](a) Opera
(b) Linux
(c) Safari
(d) All of these
(b) Linux

Question 12.
Which of the following function converts the characters of an argument string to the uppercase characters? [1](a) UCASE( )
(b) UPPER( )
(c) Both (a) and (b)
(d) None of these
(c) Both (a) and (b)

Question 13.
Firewalls are _____. [1](a) softwares that destroy viruses
(b) commercial softwares
(c) utilities that filter the entry of malwares
(d) cleaner softwares
(c) Utilities that filter the entry of malwares

Question 14.
Choose the correct query to display the length of customer’s name(CNAME) from Customers table. [1](a) mysql > SELECT LENGTH(CNAME) FROM Customers;
(b) mysql>SELECT LEN(CNAME) FROM Customers;
(c) mysql>SELECT COUNT(NAME) FROM Customers;
(d) mysql>SELECT COUNT(CNAME) FROM Customers;
(a) mysql>SELECT LENGTH(CNAME) FROM Customers;

Question 15.
Which clause is used with aggregate functions? [1](a) GROUP BY
(d) Both (a) and (b)

Question 16.
Which function only removes the trailing space from the characters of a string passed as an argument? [1](a) TRIM( )
(b) LTRIM( )
(c) RTRIM( )
(d) Both (a) and (c)
(c) RTRIM()

Directions (Q.Nos. 17-18) Assertion and Reason based Questions.

Question 17.
Assertion (A) The Internet is a world wide collection of networked computers, which are able to exchange information with each other very quickly. [1]Reason (R) A gateway is a device that connects dissimilar networks.
(a) Both A and R are true and R is the correct explanation of A.
(b) Both A and R are true but R is not the correct explanation of A.
(c) A is true but R is false.
(d) A is false but R is true.
(b) Both A and R are true but R is not the correct explanation of A.

Question 18.
Assertion (A) Data visualisation refers to the graphical representation of information and data using visual elements like charts, graphs and maps etc. [1]Reason (R) To install matplotlib library, we can use the command pip install matplotlib.
(a) Both A and R are true and R is the correct explanation of A.
(b) Both A and R are true but R is not the correct explanation of A.
(c) A is true but R is false.
(d) A is false but R is true.
(b) Both A and R are true but R is not the correct explanation of A.

Section – B

Question 19.
Define Voice over Internet Protocol (VoIP). Also, explain its one advantage. [2]


Explain any two uses of the Internet.
VoIP (Voice over Internet Protocol) is an IP telephony term for a set of facilities used to manage the delivery of voice information over Internet. It enables a user to make cheap telephone calls over a broadband Internet connection, instead of using a regular telephone service. A major advantage of VoIP is that avoids the tolls charged by ordinary telephone service.


Two uses of Internet are as follows:

(i) Electronic Mail (E-mail) The first major use of the Internet is E-mail. People used E-mail for sharing information, data files, photos, videos, business communications and any other files instantaneously with others. This had enabled faster communication between people and improve business efficiency.

(ii) E-commerce The Internet enables the selling of goods and services in online mode. There are many E-commerce platform vendors like Amazon, Ola who aggregate several products/services available in the market and sell them through their portal to customers.

Question 20.
Rashmi is a travel agent, she has stored the data of all passengers in a table Travel(PNo, PName,TDate,Km, Coach). She has given the following command to display the name of the traveller whose travel date is in year 2016. She is encountering an error while executing the following query: [2]SELECT PName, TDate WHERE TDate= ‘2016’ FROM Travel:
Help her in identifying the reason of the error and write the correct query by suggesting the possible correction(s).

SELECT PName, TDate FROM Travel WHERE YEAR(TDate)=2016;

Question 21.
Samadrita wants to find the outputs of the following queries using SUBSTR() and MOD() functions. Help her to find the outputs. [2](i) SELECT SUBSTR(“testcases”, -5, 3);
(ii) SELECT M0D(17, 7, 3);

The SUBSTR() function extracts certain number of characters from a string. Here, the function extracts characters starting from position – 5 and then 3 characters from the right.


The MOD() function returns the remainder of division.

Question 22.
The Python code written below has syntactical errors. Rewrite the correct code and underline the corrections made. [2]

import pandas as pd
data1 = {'ID': [1, 2, 3], 'Name': ['Riya’, 'Preeti', 'Neeta']}
data2 = {'ID': [3, 4, 5], 'Age' [22, 30, 40]}
df1 = Pd.DataFrame(data1)
df2 = Pd.DataFrame(data2)
result = Pd.merge(df1, df2, on='ID', how=inner)


import pandas as pd
data1 = {'ID’: [1, 2, 3], 'Name': ['Riya', 'Preeti', 'Neeta']}
data2 = {'ID': [3, 4, 5], ‘Age': [22, 30, 40]}
df1 = pd.DataFrame(data1)
df2 = pd.DataFrame(data2)
result = pd.merge(df1, df2, on='ID', how=’inner‘)

Question 23.
Intellectural property right means that the person who produces the information is the only one who can use that information. Now, explain the need of protecting intellectual property rights. [2]Answer:
The intellectual property rights must be protected because of protecting them,

  1. encourages individuals and business to create new software and new software applications, as well as improving existing applications.
  2. ensures new ideas and technologies are widely distributed.
  3. promotes investment in the national economy.

Question 24.
Answer the following questions based on the Series given below [2]

import pandas as pd
list1=[1, 2, 3, 4, 5, 6, 7, 8]
list2=[‘swimming’,'tt',‘skating’,'kho kho’, ‘bb’, 'chess’, 'football'cricket']
school=pd.Series(list1, index=list2)

What will be the output of the following statements?
(a) print (school*2)
(b) print (school[“tt”])

Swimming 2
Tt 4
Skating 6
Kho kho 8
Bb 10
Chess 12
Football 14
Cricket 16

(b) tt 2

Question 25.
Complete the given Python code to concatenate the DataFrames ‘df1’ and ‘df2’ vertically and display the resulting DataFrame. [2]

import ____ as pd
df1 = pd.DataFrame({'A': [1, 2, 3], 'B’: [4, 5, 6]})
df2 = pd.DataFrame({'A': [7, 8, 9], ’B’: [10, 11, 12]})
result_df = pd.____(____)


import pandas as pd
df1 = pd.DataFrame({'A': [1, 2, 3], 'B': [4, 5, 6]})
df2 = pd.DataFrame({'A': [7, 8, 9], 'B': [10, 11, 12]})
result_df = pd.concat([df1, df2]. axis=0)

Section – C

Question 26.
Consider the given table Order. [3]Table: Order

Write the SQL statements for the following based on above table Order.

(i) Display the maximum and minimum orders placed for each city.
(ii) Find the average of Payments received by Cloc Jaipur.
(iii) List all orders given between 01/01/2008 to 12/10/2008.


Which type of MySQL function accepts only numeric values? What is the use of such functions? Give the name of some functions of that type.
(i) SELECT Cloc, MAX (Orders), MIN(Orders) FROM Order GROUP BY Cloc;
(ii) SELECT AVG(Payments ) FROM Order WHERE Cloc=’ Jaipur ’;
(iii) SELECT * FROM Order WHERE Orderdate> ’01/01/2008 ’ and OrderdateC’12/10/2008’;


Mathematical functions accept only numeric values and return the value of same type. These functions are used to perform mathematical operations on the database data.
Some mathematical functions are : POWER( ), R0-UND ( ), TRUNCATE( ).

Question 27.
Write a Python code to create a DataFrame with appropriate column headings from the list given below: [3][[P01 ,‘Sachin Tendulkar’, ‘lndia’],[P02 , ‘Brian Lara’, ‘West Indies’], [P03, ‘Wasim Akram’, ‘Pakistan’],[P04,’Adam Gilchrist’, ‘Australia’]]Answer:

import pandas as pd
data = {"PID”:["P01", “P02", “P03", “P04”].
“Pname”: ["Sachin Tendulkar", "Brian Lara", “Wasim Akram", "Adam Gilchrist"],
“Country”: ["India", "West Indies”, "Pakistan", "Australia"]}
df = pd.DataFrame(data)

Question 28.
Pushp, a student of Class XII, has been assigned a code to create a pandas Series ‘S1’, as shown below. [3]

Help him to write the Python statements for the following.
(i) To extract the value with the index ‘c’.
(ii) Display the series by adding 10 in each value.
(iii) Delete the value against index ‘d’.
(i) print(S1[‘c’ ])
(ii) print(S1+10)
(iii) S1=S1.drop[ ‘d ’]

Question 29.
Sumit has to prepare a project on “Swachh Bharat Shreshth Bharat”. He decides to get information from the Internet. He downloads three web pages (webpage 1, webpage2, webpage3) containing information on the given topic.

1. He reads a paragraph from webpage 1 and rephrased it in his own words. He finally pasted the rephrased paragraph in his project.
2. He downloaded three images from webpage2. He made a collage for his project using these images.
3. He also downloaded an icon from webpage3 and pasted it on the front page of his project report.

Now, answer the following questions based on above reading. [3]

(i) Step 1 an example of ………………
(ii) Step 3 an act of …………….
(iii) The process of getting web pages, images and files from a web server to local computer is called ……………….


What is cyber stalking? Is cyber stalking a crime? How cyber stalking messages are different from ordinary spam?
(i) Paraphrasing
(ii) Copyright infringement
(iii) Downloading


Yes, cyber stalking is a crime in which the attacker harasses a victim using electronic communication, such as E-mail or Instant Messaging (IM), or messages posted to a website or a discussion group. Cyber stalking messages differ from ordinary spam in that a cyber stalker targets a specific victim with often threatening messages.

Question 30.
Consider the following table BOOK. [3]Table: BOOK

Give the output of the following SQL commands on the basis of the above table BOOK.
(i) SELECT LEFT(Publication, 1) FROM BOOK WHERE Price>280;
(iii) SELECT SUBSTR (Title, 2, 3) FROM BOOK WHERE Code = ‘0002’;

Section – D

Question 31.
Army hospital Patna maintains the following table for its patients. They want certain outputs department wise – like the average charges, total number of patients department wise etc. As a database programmer, helps them to get the required outputs. [4]Table: Hospital

(i) Display each Dept and the total number of patients in each.
(ii) Display the department wise average Charges.
(iii) Display the total number of unique departments.
(iv) Display the minimum Charges among patients whose name starts with “S” or “R”.
(i) SELECT Dept, COUNT(*) FROM Hospital GROUP BY Dept;
(ii) SELECT Dept, AVG(Charges) FROM Hospital GROUP BY Dept;
(iv) SELECT MIN(Charges) FROM Hospital WHERE Pname LIKE “S%” OR Pname LIKE “R%”;

Question 32.
Ms. Jennifer Christiano wants to create a DataFrame “Football” and perform some operations with it. [4]Football

Index Player Club Charges
0 Ronaldo AC Milan 9.6
1 Pele Real Madrid 10.5
2 Maradona Royal Argentina 19.5

(Assume pandas is imported as pd)
(a) Write the output for the following:
(i) Foolball[‘Charges’]/2
(ii) Football.size
(b) Help her to write the code for the following:
To set the index as ‘R’,’P’ and ‘M\ respectively for the three rows.
(c) To change index Label of Football from 0 to Zero and 1 to One.
Or (Option for part (c) only)
To make all the charges to 11.9


(ii) 9
(b) Football=Football.reindex([‘R’,‘P’,‘M’])
(c) Football.rename (index = {0 : ‘Zero’, 1 : ‘One’, 2 : ‘Two’ }, inplace = True)


Football [‘Charges’]=11.9

Section – E

Question 33.
Carefully, observe the following table named ‘Stock’. [5]Table: Stock

Pid PName Category Qty Price
1 Keyboard 10 15 450
2 Mouse 10 10 350
3 Wifi-router NW 5 2600
4 Switch NW 3 3000
5 Monitor 0 10 4500
6 Printer 0 4 17000

Write SQL queries for the following
(i) To display the records in decreasing order of Price.
(ii) To display Category and category wise total Quantities of products.
(iii) To display the Category and its average Price.
(iv) To display Category and category wise highest Price of the products.
(v) To display product names of the items with price below 200 and quantity less than 5.


Briefly explain the purpose of the following SQL functions.
(i) POWER()
(ii) MOD()
(iii) NOW()
(iv) MONTH()
(v) LENGTH()
(ii) SELECT Category, SUM(Qty) FROM Stock GROUP BY Category;
(iii) SELECT Category, AVG(Price) FROM Stock GROUP BY Category;
(iv) SELECT Category, MAX(Price) FROM Stock GROUP BY Category;
(v) SELECT PName FROM Stock WHERE Price<2000 and Qty<5;


(i) POWER() function returns the value of a number raised to the power of another number.
(ii) MOD() function returns the remainder of a number dividing by another number,
(iii) NOW() function returns the system date and time.
(iv) MONTFI() function extracts the month part of a date.
(v) LENGTH() function returns the length of a string value.

Question 34.
“Anutulya Creations”-A start-up fashion house has set up its main centre at Kanpur, Uttar Pradesh for its dress designing, production and dress supplying activities. It has 4 blocks of buildings:

Distance between the various blocks:

A to D                      — 50 m
A to P                      — 60 m
A to S                     — 110 m
D to S                     — 60 m
PtoS                       — 50 m
P to D                     — 150 m

Number of computers in each block:

A to D                      — 50 m
A to P                      — 60 m
A to S                     — 110 m
D to S                     — 60 m
PtoS                       — 50 m
P to D                     — 150 m

Based on the above specifications, answer the following questions.

(i) Out of LAN, WAN and MAN, what type of network will be formed, if we interconnect, different computers of the campus? Justify.

(ii) Suggest the topology, which should be used to efficiently connect various blocks of buildings within Kanpur centre for fast communication.
Also, draw the cable layout for the same.

(iii) Suggest the placement of the following device with justification.
(a) Repeater
(b) Switch/Hub

(iv) Now-a-days, video-conferencing software is being used frequently by the company to discuss the product details with the clients. Name any one video conferencing software.
Also, mention the protocol which is used internally in video conferencing software.

(v) Suggest the suitable place (BLOCK) to house the server, with a suitable reason.
(i) A LAN network is formed. LAN or Local Area Network is a network of systems spread in a small area that spans for 500 m to 1 km approx. Here, the distance between the offices are maximum 150 m.

(ii) Star topology should be used.
Cable layout

(iii) (a) Repeater A to S and P to D. Since, the distances between the blocks are 110 m and 150 m respectively, a repeater will be required to amplify the signals.
(b) Switch/Hub It will be required in all the buildings to connect multiple computers present in them.

(iv) Video conferencing softwares Zoom, Google Meet, MS Teams.
Protocol VoIP (Voice over Internet Protocol).

(v) The most suitable place (i.e. BLOCK) to house the server is BLOCK D, because it has maximum number of computers.

Question 35.
Write a Pandas program to sort the DataFrame first by Name in descending order, then by ‘Score’ in ascending order. [5]Sample DataFrame :
exam_data={‘Name’:[‘Abhi’,’Chirag’,’Tarun’,‘Anjali’,’Mahi’,’Tushar’,’Shubham’, ‘Harsh’,’Vanshika’,’Kartik’],
‘Score’:[12, 5, 9, 16, 5, np, NaN, 9, 20, 14.5, np, NaN, 8, 19].
‘Attempts’:[1, 3, 2, 3, 2, 3, 1, 1, 2, 1],
‘Qualify’:[‘Yes’, ‘No’, ‘Yes’, ‘No’, ‘No’, ‘Yes’, ‘Yes’, ‘No’, ‘No’, ‘Yes’]}
labels=[‘a’, ‘b’, ‘c’, ‘d’, ‘e’, ‘f’, ‘g’, ‘h’, ‘i’, ‘j’]


Python provides the facility to draw multiple bar charts in same plot. Shrey used this feature and made multiple bar charts in same plot but by mistake the code of graph has deleted. Now, help him to write the code of given graph.

import pandas as pd
import numpy as np
exam_data = {'Name': [‘Abhi', ‘Chi rag', 'Tarun', 'Anjali'. 'Mahi', 'Tushar', 'Shubham', 'Harsh’, ‘Vanshika',‘Kartik']. 'Score': [12.5, 9, 16.5, np.NaN, 9, 20, 14.5, np.NaN, 8, 19],
'Attempts': [1, 3, 2, 3, 2, 3, 1, 1, 2, 1],
'Qualify': ['Yes’, 'No', 'Yes', 'No', 'No','Yes', 'Yes', 'No', 'No', 'Yes']}
labels = ['a', 'b', 'c', 'd', ‘e’, ‘f’, ‘g’, 'h', ' i', 'j']
df = pd.DataFrame(exam_data , indexedabels)
print('Orginal rows:")
result=df.sort_values(by=[‘Name’, 'Score'], ascending=[False, True])
print("Sort the DataFrame first by 'Name' in descending order, then by 'Score' in ascending order:”)


import numpy as np
import matplotlib.pyplot as plt
groups = 5
boys = (45, 23, 62, 16, 33)
girls = (55, 18, 31, 46, 29)
fig, ax = plt.subplots( )
index = np.arange(groups)
bar_width = 0.35
opacity = 0.8
rects1 = boys, bar_width,
rects2 = + bar_width, girls, bar_width,
plt.title('Multiple Bar Chart')
plt.xticks(index + bar_width, ('GI', 'G2', 'G3', 'G4', 'G5'))
plt.legend( )
plt.tight_layout( ) )

Show More

Related Articles

यौगिक किसे कहते हैं? परिभाषा, प्रकार और विशेषताएं | Yogik Kise Kahate Hain Circuit Breaker Kya Hai Ohm ka Niyam Power Factor Kya hai Basic Electrical in Hindi Interview Questions In Hindi