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

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

CBSE Sample Papers for Class 12 Informatics Practices Set 7 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.
e-Waste is becoming one of the fastest growing environmental hazards in the world today. If it is not properly treated or disposed of it can cause serious health hazards, therefore the ___ has issued a formal set of guidelines for proper handling and disposal of e-Waste. [1](a) Central Pollution Control Board (CPCB)
(b) Department of Information Technology (DIT)
(c) Waste Electrical and Electronic Equipment (WEEE)
(d) Information Communication Technology (ICT)
(a) Central Pollution Control Board (CPCB)

Question 2.
There is only 1 day left for Ravisha to submit her Science project. Therefore, she performed the following activities to complete her task. Which of the following activities can be considered as plagiarism? [1](a) Downloaded the images that were marked as CC and pasted in her project file.
(b) Copied the content from some website and pasted in her file.
(c) Copied the content from the website and gave references about the same in the project.
(d) Downloaded and installed the open source software for typing the synopsis.
(a) Downloaded the images that were marked as CC and pasted in her project file.

Question 3.
Which among the following options can be used to create a DataFrame in Pandas? [1](a) A scalar value
(b) An ndarray
(c) A Python diet
(d) All of these
(d) All of these

Question 4.
………….. stands for malicious software, is designed to infiltrate a computer system without the owner’s informed consent. [1](a) Blog
(b) Attachments
(c) Spam
(d) Malware
(d) Malware

Question 5.
We can use the aggregate functions in select list or the clause of a select statement. But they cannot be used in a ……….. clause. [1](a) WHERE, HAVING

Question 6.
In which of the following format, Pandas docs not allow reading and writing? [1](a) int
(b) float
(c) double
(d) All of these formats are allowed
(d) All of these formats are allowed

Question 7.
Which form of Cyber crime refers to offensive comments posted online targeting people? [1](a) Cyber bullying
(b) Cyber stalking
(c) Cyber trolls
(d) Both (a) and (b)
(d) Both (a) and (b)

Question 8.
Which function is used to delete a row from DataFrame? [1](a) DEL( )
(b) DROP( )
(c) DELETE( )
(d) DROPCOL( )
(b) DROP( )

Question 9.
____ is the network topology in which there are bi-directional links between each possible node. [1](a) Ring
(b) Mesh
(c) Tree
(d) None of these
(b) Mesh

Question 10.
Find out the output of the following command. [1]

mysql>SELECT DATE('1991-04-02 01 : 45 : 55');

(a) 02
(b) 04
(c) 1991-04-02
(d) 02-04-1991
(c) 1991-04-02

Question 11.
Arrange the following network in ascending order of their area; [1]LAN, PAN, WAN, MAN
(a) PAN < MAN < LAN < WAN
(b) PAN < LAN < WAN < MAN
(c) LAN < PAN < MAN < WAN
(d) PAN < LAN < MAN < WAN
(d) PAN < LAN < MAN < WAN

Question 12.
Select correct SQL query from below to find the temperature in increasing order of all cites. [1](a) SELECT city FROM weather ORDER BY temperature;
(b) SELECT city, temperature FROM weather;
(c) SELECT city, temperature FROM weather ORDER BY temperature;
(d) SELECT city, temperature FROM weather, ORDER BY city;
(c) SELECT city, temperature FROM weather ORDER BY temperature;

Question 13.
______ is an electronic form of a signature that can be used to authenticate the identity of the sender of a message. [1](a) Digital signature
(b) Digital certificate
(c) Firewall
(d) None of these
(a) Digital signature

Question 14.
Which of the following command is used to discard unwanted data from a database? [1](a) DROP

Question 15.
SELECT CONCAT (‘’Hello’, ‘Wonders’, World’); ‘ [1] What will be the output of the above query? [1](a) Hello Wonders World
(b) hello wonders world
(d) Hellowondersworld
(a) Hello Wonders World

Question 16.
The return type of POWER() function is [1](a) String
(b) Date
(c) Numeric
(d) None of these
(c) Numeric

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

Question 17.
Assertion (A) In March 1989, Tim Berners-Lee took the initiative towards the invention of WWW and wrote the first proposal for the World Wide Web. [1]Reason (R) World Wide Web is a way of exchanging information between computers on the Internet.
(a) Both A and R are true and R is the correct explanation for A.
(b) Both A and R are true but R is not the correct explanation for A.
(c) A is true but R is false.
(d) A is false and R is true.
(b) Both A and R are true but R is not the correct explanation for A.

Question 18.
Assertion (A) DataFrames can store heterogeneous data. [1]Reason (R) DataFrames are immutable.
(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.
(c) DataFrames can store various kinds of data , i.e. heterogeneous data. Also, they are mutable which means they can be changed after creation. Hence, A is true and R is false.

Section – B

Question 19.
List one function of gateway and switch each. [2]


What is a computer network? List down the types of computer networks.
A switch is a networking device, which is used to connect different LAN segments of a network. A switch also supports packet filtering and forwarding between LAN segments. The gateway is a node in a network, which serves as a proxy server and a firewall system, that prevents the unauthorised access.


Computer network is defined as a group of computers connected to each other by a link. Following are the three main types of computer networks, based upon the geographical area as follows;

  1. Local Area Network (LAN)
  2. Metropolitan Area Network (MAN)
  3. Wide Area Network (WAN)

Question 20.
The following query is producing an error. Identify the error and also write the correct query.
As per MySQL, ORDER BY clause must be the last clause in SQL query and in this query, ORDER BY is used before WHERE which is incorrect. The correct query will be

Question 21.
Amisha wants to group the result set based on some column’s value. Also, she wants that the grouped result should appear in a sorted order. In which order will she write the two clauses (for sorting and for grouping). Give example to support your answer. [2]Answer:
When we use GROUP BY clause (for grouping of data) and ORDER BY clause (for sorting data) together, the ORDER BY clause always follows other clauses. That is, the GROUP BY clause will come before ORDER BY clause.
For example,

SELECT userid, SUM(score) AS total_score
FROM user _score
GROUP BY userid
ORDER BY userid ASC;

(c) Write Python statement to display the last state.
Or (Option for part (c) only)
Give syntax to access multiple columns of the DataFrame.

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

import pandas as pd
data = ('A’: Pd.Series([ 1, 2, 3]), 'B': Pd.Series([4, 5, 6]))
df = pd.dataframe(data)

Correct code is

import pandas as pd
data = {'A': pd.Series([1, 2, 3]), 'B': pd.Series([4, 5, 6])}
df = pd.DataFrame(data)

Question 23.
Explain the concept of password cracking and eavesdropping. [2]Answer:
The process of attempting to guess or crack passwords to gain access to computer system or network is called password cracking. Crackers will generally use a variety of tools, scripts or software to crack a system’s password.
In computer security, eavesdropping is defined as the unauthorised interception of a conversation, communication or digital transmission in real time. The various forms of communication include phone calls, E-mails, instant messages or any other internet service.

Question 24.
Answer the following 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"]

What will be the output of
(i) print (school*2)
(ii) print (school [ “tt” ])

Swimming 2
tt 4
Skating 6
Kho kho 8
bb 10
Chess 12
Football 14
Cricket 16

(ii) 2

Question 25.
Complete the given Python code: to read data from the CSV file ‘data.csv’ into a DataFrame and display the first 5 rows. [2]

import ____ as pd
df = pd.read_csv(____)

Code is:

import pandas as pd
df = pd.read_csv('data.csv')

Section – C

Question 26.
Table : Student

Based on above table Student, write the output of the following queries.
(i) SELECT Name FROM Student WHERE City IN(‘‘Agra”,’’Mumbai”);
(ii) SELECT * FROM Student WHERE Gender=”F” AND Class=”XII”0RDER BY Marks;
(iii) SELECT Gender, AVG(Marks) FROM Student GROUP BY Gender HAVING Class=”XI”;


Column Name

Write queries to find:
(i) The amount for each store.
(ii) The list of all the store name whose total Sales amount is over 5000.
(iii) The total number of stores in the Sales table.


(i) SELECT SUM(Sales_Amount) FROM Sales GROUP BY Store_ID;
(ii) SELECT Store_ID FROM Sales GROUP BY Store_ID WHERE SUMCSal es_Amount)>5000;
(iii) SELECT COUNT!*) FROM Sales;

Question 27.

0 Samsung SONY Panorama
2 BPL TATA Microsoft

Write the Python code to create the above DataFrame ‘tvdf’. [3]Answer:

import pandas as pd
tvdata={'LED':[‘Samsung', 'LG', ‘BPL'], 'OLED':['Sony', 'Toshiba', 'Tata']. 'Curved’:['Panorama', 'Weston', 'Microsoft']}
tvdf=pd.DataFrame(tvdata, columns=[’LED’, '0LED', 'Curved'])

Question 28.
Consider the following DataFrame dfn that contain vegetables.

Color Quantity Price
Capsicum Red 12 60
Capsicum Green 22 100
Chilli Red 50 40
Chilli Green 65 55
Lime Green 20 35

Write the code statement to the following:
(i) Find all rows with the label “Chilli”. Extract all columns.
(ii) List 2nd, 3rd and 4th rows.
(iii) List only the columns Quantity and Price using loc.
(i) dfn.loc [‘Chilli’, :](ii) dfn.iloc [1 : 4, : ](iii) dfn. loc [:, [‘Quantity’, ‘Price’]]

Question 29.
Sneha found that her picture posted on a social networking site, has been merged with an unknown person and published. [3](i) What should she do?
(ii) Later she found that after posting some images in social media, some people were writing
negative messages. This is an instance of ………………
(iii) Using someone’s Twitter handle to post something will be termed as…


List e-Waste hazards on environment and on human health.
(i) Report it to the Cyber crime cell
(ii) Trolling
(iii) Identity theft


e-Waste hazards on the environment are as follows:

  1. Acidification of soil
  2. Air pollution
  3. Pollution of ground water
  4. Landfills with lead and heavy metals

e-Waste hazards on the human health are as follows:

  1. Lung cancer
  2. DNA damage
  3. Asthmatic bronchitis
  4. Chronic damage to the brain
  5. Damage to heart and liver

Question 30.
Insert any two rows into a table COLLEGE, whose structure is given below: [3]

Roll_No Name Class Branch

(i) mysql > INSERT INTO COLLEGE (Roll_No, Name, Class, Branch) VALUES (2, ‘VIKAS’, 12, ‘SCIENCE’ );
(ii) mysql > INSERT INTO COLLEGE (Rol 1 _No, Name, Class, Branch) VALUES (3, ‘RAJ’, 10, ‘SCIENCE’);

Section – D

Question 31.
Table: WORKER [4]

Based on above table WORKER, write the SQL queries for (i) to (iv).
(i) To display WNO, NAME, GENDER from the table WORKER in descending order of WNO.
(ii) To display the NAME of all the FEMALE workers from the table WORKER.
(iii) To display the WNO and NAME of those workers from the table WORKER, who are born between ‘1987-01-01’ and ‘1991-12-01’.
(iv) To count and display MALE workers who have joined after ‘1986-01-01’.
(iii) SELECT WNO, NAME FROM WORKER WHERE DOB BETWEEN ‘1987-01-01’ AND ‘1991-12-01’;

Question 32.
A DataFrame “States” contains data as follows: [4]

SName Covidcases
0 Punjab 2090
1 WB 1600
2 Kerala 4000

(a) Give the output of
(i) State s.loc[States.SName==’Punjab’](ii) States.tail (1)
(b) Write Python statement to write the DataFrame to CSV file covid.csv.
(c) Write Python statement to display the last state.
Or (Option for part (c) only)
Give syntax to access multiple columns of the DataFrame.
(i) 0 Punjab 2090
(ii) 2 Kerala 4000
(b) States.to_csv(‘c:\\covid.csv’)
(c) States.tail (1)


States.iloc[start_column: stop_column]

Section – E

Question 33.
Write SQL command for questions (i) to (v) on the basis of table Interiors. [5]Table: Interiors

(i) To show all information about the sofas from the Interiors table.
(ii) To list the Itemname which are priced at more than 10000 from the Interiors table.
(iii) To list Itemname and Type of those items, in which Dateofstock is be 22/01/02 from the Interiors table in descending order of Itemname.
(iv) To display Itemname and Dateofstock of items whose discount is more than 15.
(v) To insert a new row in the table with the following data:
14,” True Indian”, “Office Table”,{28/03/03}, 15000,20


Define the following terms:
(i) INSERT Command
(ii) SELECT Command
(iii) DELETE Command
(iv) DCL Command
(v) WHERE Clause
(i) SELECT * FROM Interiors WHERE Type= ‘Sofa’;
(ii) SELECT Itemname FROM Interiors WHERE Price>10000;
(iii) SELECT Itemname, Type FROM Interiors WHERE Dateofstock<’22/01/02′ ORDER BY Itemname DESC; (iv) SELECT Itemname, Dateofstock FROM Interiors WHERE Discount>15;
(v) INSERT INTO Interiors VALUES (14, ‘True Indian’, ‘Office Table’, ’28/03/03′, 15000, 20);


(i) INSERT Command It is used to add a single record or multiple records into a table.
Syntax INSERT INTO (cal1, cal2 …) VALUES (va11, val 2);
(ii) SELECT Command It is used to query or retrieve data from a table in the database.
Syntax SELECT column_list FROM table_name;
(iii) DELETE Command To discard unwanted data from a database, the DELETE command is used.
Syntax DELETE FROM WHERE /condition/;
(iv) DCL Command These commands are used to assign security levels in database which involve multiple user setups. They are used to grant defined role and access privileges to the users.
(v) WHERE Clause It is used when you want to retrieve specific information from a table excluding other irrelevent data.

Question 34.
Trine Tech Corporation (TTC) is a professional consultancy company. The company is planning to set up their new offices in India with its hub at Hyderabad. As a network adviser, you have to understand their requirement and suggest them the best available solutions. Their queries are mentioned as (i) to (v) below. [5]Physical locations of the blocks of TTC

Block to block distance (in metre)

Block (From) Block(To) Distance
Human Resource Conference 110
Human Resource Finance 40
Conference Finance 80

Expected number of computers to be in each block

Block Computers
Human Resource 25
Finance 120
Conference 90

(i) Which will be the most appropriate block, where TTC should plan to install their server?
(ii) Draw a block to block cable layout to connect all the buildings in the most appropriate manner for efficient communication.
(iii) Which of the following device will be suggested by you to connect each computer in each of the buildings?
(a) Switch
(b) Modem
(c) Gateway
(iv) What are the advantages of networking?
(v) State the use of repeater.
(i) TTC should install its server in finance block as it is having maximum number of computers.

The above layout is based on minimum cable length required, which is 120 metres in the above case.
(iii) (a) Switch
(iv) (a) Application sharing
(b) File sharing
(c) User communication
(v) Repeater is a device used to amplify the signals.

Question 35.
Write the Python code to plot the graph as shown below: [5]


Observe the following graph and write the Python code to get the desired graph.


import matplotlib.pyplot as pit
import numpy as np
# create data
x = np.arange(5)
y1 = [34, 56, 12, 89, 67]
y2 = [12, 56, 78, 45, 90]
y3 = [14, 23, 45, 25, 89]
width = 0.2
# plot data in grouped manner of bar type, yl, width, color="cyan"), y2, width, color="orange‘), y3, width, color="green')
plt.xticks(x, ['Team A', 'Team B', 'TeamC', 'TeamD', 'Team E'])
plt.legend(["Round 1", "Round 2", "Round 3"]) )


import matplotlib.pyplot as pit
movies=(‘Comedy‘,‘Action’,‘Romance’.'Drama V Fiction’)
x_pos=[1, 2, 3, 4, 5]
viewers=(12, 15, 2, 6, 9),viewers.color="magenta")
pit. ylabe1(‘Viewers‘)
plt.title('Movies Viewed') )

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