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

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

Time Allowed: 3 hours
Maximum Marks: 70

General Instructions:
This question paper contains five sections, Section A to E.

  1. All questions are compulsory.
  2. Section A have 18 questions carrying 01 mark each.
  3. Section B has 07 Very Short Answer type questions carrying 02 marks each.
  4. Section C has 05 Short Answer type questions carrying 03 marks each.
  5. Section D has 03 Long Answer type questions carrying 05 marks each.
  6. Section E has 02 questions carrying 04 marks each. One internal choice is given in Q35 against part c only.
  7. All programming questions are to be answered using Python Language only.

Section – A

Multiple Choice Questions

Questions 1.
Series data is _________ but the size of Series data is __________.
(A) Immutable, mutable
(B) Mutable, immutable
(C) Mutable, mutable
(D) Immutable, immutable [1]
Answer:
(B) Mutable, immutable
Explanation: Data structures in Pandas can be mutated in the terms of value but not of size. [1]

Question 2.
Consider the following data frame name df:

Name Agg Marks
0 Amit 15 90.0
1 Bhavdeep 16 NaN
2 Reema 17 87.0

Write the output of the given command: print(df.marks/2)
(A)

0 45.0
1 NaN
2 43.5

(B)

0 45.0
1 NaN
2 43

Name: Marks,dtype: float64 name: Marks, dtype:float64
(C)

0 45.
1 NaN
2. 43.5

(D)

0 45.0
1 0
2. 43.5

Name: Marks,dtype:float64 name: Marks, dtype:float64 [1]
Answer:
Option (A) is correct.
Explanation: The operation print(df.Mark/2), prints the result of float division of each marks by 2. For NaN values it gives NaN. [1]

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

Question 3.
Which function is used to create a histogram ?
(A) histogram( )
(B) histo( )
(C) hist( )
(D) histtype [1]
Answer:
(C) hist( )
Explanation: The hist( ) function in pyplot module of matplotlib library is used to plot a histogram. [1]

Question 4.
An online discussion group that allows direct live communication is known as:
(A) e-Mail
(B) Hyperlink
(C) Chat group
(D) Webcrawler [1]
Answer:
(C) Chat group
Explanation: Group chat is similar to chat features in that it gives you the ability to send instant messages to others in an organization. [1]

Question 5.
When sending an Email, the _________ line describes the contents of the message.
(A) to
(B) cc
(C) subject
(D) contents [1]
Answer:
(C) subject
Explanation: The subject line of an email is the single line of text people see when they receive your email. This one line of text can often determine whether an email is opened or sent straight to trash, so make sure it s optimized toward your audience. [1]

Question 6.
Himanshi sets up her own company to sell her own range of clothes on Instagram. What type of intellectual property can she use to show that the clothes are made by her company?
(A) Patents
(B) Copyright
(C) Design
(D) Trademark [1]
Answer:
(D) Trademark
Explanation: A trademark is a special symbol that exclusively marks one’s products. [1]

Question 7.
A contract between the creator and the user to allow the user use his/her work with some price is:
(A) Agreement
(B) Copyright
(C) License
(D) Patent [1]
Answer:
(C) License
Explanation: A license allows a person to use some other’s copyright work. [1]

Question 8.
Write the output of the following SQL command:
SELECT LEFT(“Python Computer”, 5);
(A) Python
(B) Pytho
(C) Pytho Compu
(D) None of the above. [1]
Answer:
(B) Pytho
Explanation: LEFT extracts a number of characters from a string (starting from left) [1]

Question 9.
Write the output of the following SQL command:
SELECT ROUND(348.45, – 1);
(A) 340
(B) 350
(C) 348
(D) 360 [1]
Answer:
(B) 350
Explanation: ROUND( ): Function is used to round up the number to the upwards or downwards whichever the nearest whole number [1]

Question 10.
What is the result of the following:
SELECT MOD (67,4);
(A) 1
(B) 2
(C) 3
(D) 4 [1]
Answer:
(C) 3
Explanation: SQL MOD() function is used to get the remainder from a division [1]

Question 11.
After a fight with your friend, you did the following activities. Which of these activities is not an example of cyber bullying?
(A) You sent an email to your friend with a message saying that “I am sorry”.
(B) You sent a threatening message to your friend saying “Do not try to call or talk to me”.
(C) You created an embarrassing picture of your friend and uploaded on your account on a social networking site.
(D) None of These [1]
Answer:
(A) You sent an email to your friend with a message saying that “I am sorry”.
Explanation: Cyberbullying or cyber harassment is a form of bullying or harassment using electronic means. Cyberbullying and cyber harassment are also known as online bullying. [1]

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

Question 12.
To avoid problems while working on the Internet, you should follow these precautions.
(A) Install antivirus on your computer
(B) Take the backup of your files regularly
(C) Do not click on unknown links
(D) AE of the above [1]
Answer:
(D) AE of the above
Explanation: The challenges of cyber crime can be mitigated with the twin approach of being alert and taking legal help. Following points can be considered as safety measures to reduce the risk of cyber crime:

(i) Take regular backup of important data
(ii) Use an antivirus software and keep it updated always
(iii) Avoid installing pirated software. [1]

Question 13.
Polluters pay Principle means:
(A) Anyone causing the pollution will pay for the damage caused.
(B) Polluters paid well by NGOs.
(C) Polluters may get a bonus.
(D) PoEuters are not the cause of poUution. [1]
Answer:
(A) Anyone causing the pollution will pay for the damage caused.
Explanation: The ‘polluter pays’ principle is the commonly accepted practice that those who produce pollution should bear the costs of managing it to prevent damage to human health or the environment. [1]

Question 14.
SELECT RIGHT (‘Information’, 6);
Output wiE be –
(A) mation
(B) Inform
(C) ation
(D) None of these [1]
Answer:
(A) mation
Explanation: RIGHT( ) is used to return a specified number of characters from the right of the string. The number of characters returned is determined by the second argument. [1]

Question 15.
We applv the aggregate function to a group of sets of tuples using the clause.
(A) group by
(B) group
(C) group set
(D) group attribute [1]
Answer:
(A) group by
Explanation: We apply the aggregate function to a group of sets of tuples using the group by clause. The group by clause must always be used whenever we are willing to apply the aggregate function to a group of sets of tuples. [1]

Question 16.
What values does the count(*) function ignore?
(A) Repetitive values
(B) NuE values
(C) Characters
(D) Integers [1]
Answer:
(B) NuE values
Explanation: The count(*) aggregation function ignores null values while calculating the number of values in a particular attribute. [1]

Assertion & Reason
Directions: In the following questions, a statement of assertion (A) is followed by a statement of reason (R). Mark the correct choice 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 17.
Assertion (A): The web is the common name for the World Wide Web, a subset of the Internet consisting of the pages that can be accessed by a web browser.
Reason (R): URL is a unique identifier used to locate a resource on the Internet. [1]
Answer:
(B) Both assertion (A) and reason (R) are true but reason (R) is NOT the correct explanation of assertion (A).
Explanation: WWW is the set of linked hypertext documents that can be viewed on web browsers (such as Firefox, Google Chrome, and more). URL stands for Uniform Resource Locator, and is used to specify addresses on the World Wide Web. [1]

Question 18.
Assertion (A): Line graph is a tool for comparison and is created by plotting a series of several points and connecting them with a straight line.
Reason (R): You should never use line chart when the chart is in a continuous data set. [1]
Answer:
(C) Assertion (A) is true but reason (R) is false.
Explanation: A line chart displays information as a series of data points connected by straight line segments. They make sense for continuous sets of data [1]

Section – B

Question 19.
What is the difference between star topology and bus topology of network? [2]
OR
Murugan wants to send a report on his trip to the North East to his mentor. The report contains images and videos. How can he accomplish his task through the Internet?
Answer:

Star Topology Bus Topology
All nodes are directly connected with the central node or sever. There is a single length of transmission medium, on which various nodes are attached and the server can be anywhere in the transmission cable.
Easy to detect faults. Faults cannot be detected easily. [2]

OR
By Uploading files to a cloud storage service, like Google Drive, Dropbox, or OneDrive, and sharing them or email them. Murugan can send his report to his mentor through Internet.

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

Question 20.
Consider the table Organisation:

Org Code Salary
C101 13000
C102 5000
C104 7000
C105 4000

(i) With SQL, how can you find the number of rows (records) in the Organisation table ?
(ii) What Output will be displayed by the following SQL statement:
Select AVG (Salary) FROM Organisation;
Answer:
(i) SELECT COUNT(*) FROM Organisation;
(ii) 7250 [2]

Question 21.
Write the output of the following SQL queries:
(i) SELECT MID(‘Technology’, 2, 5);
(ii) SELECT INSTR(‘Computers’, ‘put’); [2]
Answer:
(i) echno
(ii) 4 [2]

Question 22.
Give the output:
import pandas as pd
data = [[‘Aadi’, 500], [‘Nikita’, 1200], [‘Kishan’, 1500]]
df = pd.DataFrame (data, columns = [‘Name’,’Fees’])
print (df) [2]
Answer:
Output

Name Fees
0 Aadi 500
1 Nikita 1200
2 Kishan 1500

Question 23.
What are the advantages of open source? [2]
OR
Define Phishing.
Answer:

  • Flexible and Agile
  • Speed
  • Cost Effectiveness
  • Ability to be resized
  • Powerful Information Security [2]

OR
Phishing is a type of social engineering attack often used to steal user data, including login credentials and credit card numbers. It occurs when an attacker, masquerading as a trusted entity, dupes a victim into opening an email, instant message, or text message. [2]

Question 24.
Why is the following statement used in every code that plots data in python.
import matplotlib pyplot as pit [2]
Answer:
The matplotlib is a python library that provides many interfaces and functionality for 2D-graphics in various forms. It provides both a very quick way to visualize data from Python. Among, many name collection of methods that matplotlib library offers, Pyplot is one. It allows user to construct 2D plots easily and interactively. In order to use pyplot has data visualization, it needs to be imported in python environment. For this the command import matplotlibpyplot as plt, is given. Now plt can be used as a shorthand for matplotlib. [2]

Question 25.
Write a small Python code to create a DataFrame with heading (a and b) from the list given below:
[[1,2], [3,4]], [[5,6], [7,8]] [2]
Answer:
import pandas as pd
df = pd.DataFrame([[1, 2], [3, 4],[5, 6], [7, 8]],
columns = [‘a’, ‘b’])
print(df)

Section – C

Question 26.
What will be the output of the following querieson the basis of Employee table :

EmpID EName Salary
A001 Bob 5600
A002 John Null
A003 Tom 5000

(i) SELECT AVG(Salary) FROM Employee;
(ii) SELECT Salary FROM Employee WHERE Empld= ‘A002’;
(iii) SELECT EName FROM Employee WHERE Salary = NULL; [3]
Answer:
(i) 5300
(ii) NULL
(iii) John [3]

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

Question 27.
Consider two objects A and B. A is a list where as B is a Series. Both have values 25,40,70,115.
What will be the output of the following two statements considering that the above objects have been created already?
(a) print (A*2)
(b) print(B*2)
Justify your answer. (HJTj [3]
Answer:
(a) will give the output as:
[25, 40, 70, 115, 25, 40, 70, 115] [3]
(b) will give the output as

0 50
1 80
2 140
3 230

Justification: In the first statement, A represents a list so when a list is multiplied by a number, it is replicated that many number of times. The second B represents a series. When a series is multiplied by a value, then each element of the series is multiplied by that number. [3]

Question 28.
Find the output:
import pandas as pd
algos={ ‘search’: [ ‘DFS’, ‘BFS’, ‘Binary Search’, ‘Linear’, ‘Shortest Path(Dijkstra)’], ‘sorting’ :
[‘Quicksort’, ‘Mergesort’, ‘Heapsort’, ‘Bubble Sort’, ‘Insertion Sort’], ‘machine learning’ :
[‘Random Forest’,
‘K Nearest Neighbor’,
‘Logistic Regression’,
‘K-Means Clustering’,
‘Linear Regression’]} algoDF = pd.DataFrame(algos)
print (algoDF) [3]
Answer:

machine learning search sorting
0
1
2
3
4
Random Forest
K Nearest Neighbour
Logistic Regression
K-Means Clustering
Linear Regression
DFS
BFS
Binary Search
Linear
Shortest Path (Dijkstra)
Quicksort
Mergesort
Heasport
Bubble Sort
Insertion Sort

Question 29.
What do you mean by data protection? [3]
OR
Define the following terms:
(i) Patent
(ii) Trademark gJTj
Answer:
(i) It is the process of safeguarding important information from corruption, compromise or loss. In short, you should be able to decide whether or not you want to share some information, who has access to it. For how long, what reason and be able to modify some of this information and more.

(ii) A large part of a data protection strategy is ensuring that data can be restored quickly after any corruption or loss. Protecting data from compromising and ensuring data privacy are other key components of data protection. There are two key areas of data management used in data protection as :

(a) Data life cycle management is the process of automating the movement of critical data to online and offline storage.
(b) Information life cycle management is a comprehensive strategy for valuing, cataloguing and protecting information assets from application and user errors, malware and virus attacks, machine failure or facility outage and disruptions. [3]

OR

(i) Patent: It is usually granted for inventions. Unlike copyright, the inventor needs to file for patenting the invention. When a potent is granted, the owner gets an exclusive right to prevent others from using, selling or distributing the protected invention.

Patent gives full control to the patentee to decide whether or how the invention can be used by others. Thus it encourages inventors to share their scientific or technological finding with others. A patent protects an invention for 20 years, after which it can be freely used. Recognition and financial benefits faster the right environment and provide motivation for more creativity and innovation.

(ii) Trademark: It includes any visual symbol, word, name, design, slogan, label etc., that distinguishes the brands or commercial enterprises, from other brands or commercial enterprises. For example, no company other than ABC can use the ABC brand to sell shoes or clothes. It also prevents others from using a confusingly similar mark, including works or phrases. [3]

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

Question 30.
Consider the following SQL string: “Technology”
Write commands to display:
(i) “logy”
(ii) “nol”
(ii) Tech [3]
OR
Considering the same string “Technology”
Write SQL commands to display:
(i) The position of the substring Tog’ in the string
(ii) The last 5 letters of the string
(iii) The length of the string
Answer:
(i) SELECT MID (“Technology”, 7);
(ii) SELECT SUBSTR(“Technology” , 5,3);
(iii) SELECT LEFT (“Technology”, 4); [3]
OR
(i) SELECT INSTR (“Technology”, “log”);
(ii) SELECT RIGHT(“Technology” ,5);
(iii) SELECT LENGTH (“Technology”);

Section – D

Question 31.
Which function extracts a given number of characters from the left side of a supplied string? Explain with example. [5]
OR
Consider the following tables: COMPANY and MODEL
Table: Model

MODEL_ID Comp_ID Cost Date of Manufacture
T020 1 2000 2010-05-12
M032 4 7000 2009-04-15
M059 2 800 2009-09-23
A167 3 1200 2011-01-12
T024 1 1300 2009-10-14

Table: Company

COMP_ID Comp_Name Comp_HO Contact Person
1. Titan Okhla C.B. Ajit
2. Ajanta Najafgarh R. Mehta
3. Maxima Shahdara B. Kohili
4. Seiko Okhla R. Chadha
5. Ricoh Shahdara J. Kishore

Note:
> Comp_ID is the Primary Key
> Model_ID is the Primary Key.
> Comp_ID is the Foreign Key referencing Comp_ID of Company table.

Write SQL commands for queries (i) to (iv) and output for (v).

(i) To display details of all models in the Model table in ascending order of DateOfManufacture.
(ii) To display details of those models manufactured in 2011 and whose Cost is below 2000.
(iii) To display the Model lD, CompID, Cost from the table Model, CompName and ContactPerson from Company table, with their corresponding Comp_ID.
(iv) To decrease the cost of all the models in Model table by 15%.
(v) Select count(distinct Comp_HO) from Company;
Answer:
The LEFT( ) function extracts a given number of characters from the left side of a supplied string. For example, LEFT(‘SQL Server’, 3) returns SQL.
The syntax of the LEFT( ) function is as follows:
LEFT ( input_string , number_of_characters )
In this syntax:

• The input_string can be a literal string, variable, or column. The data type of the result of the input_string can be any data type, except for TEXT or NTEXT, that is implicitly converted to VARCHAR or NVARCHAR.

• The number_of_characters is a positive integer that specifies the number of characters of the input_string will be returned.

The LEFT( ) function returns a value of VARCHAR when the input_string is a non-Unicode character
data type or NVARCHAR if the input_string is a Unicode character data type.
The following statement uses LEFT( ) to return the three leftmost characters of the character string SQL Server:
SELECT LEFT(‘SQL Server’,3) Result_string;
Here is the output:
Result_string
SQL [5]
OR
(i) select * from Model
order by DateOfManufacture;
(ii) select * from Model
where year(DateOfManufacture) = 2011 and Cost < 2000;
(iii) select Model_ID, Comp_ID, Cost, CompName, ContactPerson from Model, Company where Model. Comp_ID = Company. Comp_ ID;
(iv) update Model
set Cost = Cost – 0.15*Cost;
(v) 3 [5]

Question 32.
Software Development company has set up its new center at Raipur for its office and web based activities. It has 4 blocks of buildings named Block A, Block B, Block C and Block D.
Number of computers:

Block A 25
Block B 50
Block C 125
Block D 10

Shortest distances between various blocks in meters :

Block A to Block B 25
Block B to Block C 40
Block C to Block A 30
Block D to Block C 50

(i) Name the most suitable block where the server should be installed.
(ii) Suggest the type of network to connect all the blocks with suitable reason.
(iii) The company is planning to link all the blocks through secure and high speed wired medium, to connect all the blocks.
(iv) Suggest the most suitable wired medium for efficiently connecting each computer installed out of the following network cables :

  • Coaxial cable
  • Ethernet cable
  • Single pair telephone cable

(v) Suggest where all Hub(s)/Switch(es) should be placed in the network. [5]
Answer:
(i) Block, C, it has maximum number of computers.
(ii) LAN (Local Area Network)
(iii) CBSE Sample Papers for Class 12 Informatics Practices Set 2 Img 1
(iv) Etherenet cable
(v) All blocks need hub/switch as it has more than one computer. [5]

Question 33.
What do you mean by CSV file ?
OR
The area under wheat cultivation last year in the following states correct to nearest lac hectares was :

State Punjab Haryana U.P M.P. Maharashtra Rajasthan
Cultivated Area 220 120 100 40 80 30

Plot a graph for the data. Give a yellow border to each [5]
Answer:
CSV files are the comma separated values. This type of file can be viewed as an excel file and separated by commas. CSV file is nothing more than a simple text file. However, it is the most common, simple and easiest method to store tabular data. This particular format arranges tables by a specific structure divided into rows and columns. Once we have the DataFrame, we can persist it in a CSV file on the local disk. First we create CSV file using data that is currently present in the DataFrame, we can store the data of this DataFrame in CSV format using APi called to_CSV (…) of Pandas [5]
OR
from matplotlib import pyplot as plt
import numpy as np
state = [‘Punjab’, ‘Haryana’, ‘U.P’, ‘M.P’/Maharashtra’, ‘Rajasthan’]
height = [220, 120, 100, 40, 80, 30]
pos = np. arange(len(state))
plt.bar(pos, height, color = ‘g’, width = 2, edgecolor =’yellow’)
plt.xlabel(‘state’)
plt.ylabel(‘Cultivated Area(Lac hectares)’)
plt.xticks(pos, state)
plt.show( )

Section – E

Case based Subjective Questions

Question 34.
Give the output for (i) and (ii) and write SQL query for (iii):

Book_id Book_name Author_name Publisher Price Type Quantity
C0001 Fast Cook Lata Kapoor Oswaal 355 Cookery 5
F0001 The Tears William Hopkins First Publ. 650 Fiction 20
T0001 My First c++ Brain \& Brooke Oswaal 350 Text 10
T0002 C++ Brain works A.W. Rossaine TDH 350 Text 15
F0002 Thunderbolts Anna Roberts First Publ. 750 Fiction 50

(i) SELECT COUNT(*) FROM Book; [1]
(ii) SELECT MAX(Price) FROM Book WHERE Quantity > = 15; [1]
(iii) Display the names and price from books in ascending order of their prices. [2]
OR (Option for part iii only)
Display the Author names from book where book name is ‘C+ + Brain works’.
Answer:
(i)
COUNT(*)
5 [1]
(ii)
MAX(Price)
750 [1]
(iii) SELECT Book_name,Price FROM Book
ORDER BY Price ASC; [2]
OR
SELECT Author_name FROM Book WHERE Book_ name = “C+ + Brain works”;

Question 35.
Consider the following DataFrame df:

Roll no. Name UT1 UT2 UT3 UT4
1 Prerna Singh 24 24 20 22
2 Manish Arora 18 17 19 22
3 Tanish Goel 20 22 18 24
4 Falguni Jain 22 20 24 20

(a) (i) Write down the command that will give the following output. [1]

Name Tanish Goel
UT1 24
UT2 24
UT3 24
UT4 24

dtype: object
(ii) Which statement will give the exact number of values in each column of the dataframe? [1]
(b) Which command will display the column of the DataFrame? [2]
OR (Option for part iii only)
Ms. Sharma the class teacher wants to add a new column, the scores of Grade with the values, ‘A’/B’/A’/A’/B’/A’, to the DataFrame. Help her to write the command to do so.
Answer:
(i) (a) print df.max( ) [1]
(b) print (df.count ()) [1]
(ii) print (df.columns) [2]
OR
df[‘Grade’] = [‘A’,’B’,’A’,’A’,’B’,’A’]