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

CBSE Sample Papers for Class 12 Informatics Practices Set 9 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 have 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 03 Long Answer type questions carrying 05 marks each.
  7. Section E has 02 questions carrying 04 marks each. One internal choice is given in Q35 against part c only.
  8. All programming questions are to be answered using Python Language only.

Section – A

Multiple Choice Questions

Question 1.
The data of any CSV file can be shown in which of the following software?
(A) MS Word
(B) Notepad
(C) Spreadsheet
(D) All of the above [1]
Answer:
(D) All of the above
Explanation: Since it is a simple text file it can be viewed in notepad, word processor or a spreadsheet software. [1]

Question 2.
Which method is used to delete row(s) from DataFrame?
(A) .drop( ) method
(B) .del( ) method
(C) .remove( ) method
(D) .delete() method [1]
Answer:
(A) .drop( ) method
Explanation: .drop( ) is used to delete row(s) in a dataframe. To delete row(s) index labels are used andto delete columns, column labels are used. [1]

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

Question 3.
Sandhya wants to display the last four rows of the dataframe df and she has written the following command: df.taill ( ) But the first 5 rows are being displayed. To rectify this problem, which of the following statements should be written?
(A) df.head( )
(B) df.last(4)
(C) df.tail(4)
(D) df.rows(4) [1]
Answer:
(C) df.tail(4)
Explanation: The tail function returns last n rows from a dataframe. The default value of n is 5. As Sandhya has not specified any value for n so by default last 5 rows are being displayed. [1]

Commonly Made Error:
Some students get confused between head( ) … and tail( ) functions

Answering Tip:
Students should learn all concepts individually with their syntax and examples.

Question 4.
Write the output of the following SQL command: select round(49.88);
(A) 49.88
(B) 9.8
(C) 49.0
(D) 50 [1]
Answer:
(D) 50
Explanation: ROUND(): Function is used to round up the number to the upwards or downwards whichever the nearest whole number. [1]

Question 5.
The substr( ) function in MySql is an example of ………
(A) Math function
(B) Text function
(C) Date Function
(D) Aggregate Function [1]
Answer:
(B) Text function
Explanation: SUBSTR extracts some characters from a string. [1]

Question 6.
To specify condition with a GROUP BY clause, _______ clause is used.
(A) USE
(B) WHERE
(C) HAVING
(D) LIKE [1]
Answer:
(C) HAVING
Explanation: A HAVING clause in SQL specifies that an SQL SELECT statement must only return rows where aggregate values met the specified conditions. After the aggregating operation, HAVING is applied, filtering out the rows that don’t match the specified conditions. [1]

Question 7.
For web pages where the information is changed frequently, for example, stock prices, weather information which out of the following options would you advise?
(A) Static webpage
(B) Dynamic webpage
(C) Both A and B
(D) None of the above [1]
Answer:
(B) Dynamic webpage
Explanation: A dynamic web page is a web page that displays different content each time it’s viewed. For example, the page may change with the time of day, the user that accesses the webpage, or the type of user interaction. There are two types of dynamic web pages: Client-side Scripting and Server-side Scripting. [1]

Question 8.
Which network topology has a central device, which brings all the signals together?
(A) Bus
(B) Star
(C) Ring
(D) Hybrid
Answer:
(B) Star
Explanation: A star topology is a topology for a Local Area Network (LAN) in which all nodes are individually connected to a central connection point, like a hub or a switch. [1]

Question 9.
_____ deals with the protection of an individual’s information which is implemented while using the Internet on any computer or personal device.
(A) Digital agony
(B) Digital privacy
(C) Digital secrecy
(D) Digital protection [1]
Answer:
(B) Digital privacy
Explanation: The concept of digital privacy can best be described as the protection of the information of private citizens who use digital mediums. [1]

Commonly Made Error:
Some students get confused between data privacy and data secrecy and they write about data secrecy instead of data privacy

Answering Tip:
Reading and proper understanding of the question is very important.

Question 10.
Which of the following is not ‘open source software?
(A) Linux
(B) Ubuntu
(C) Open office
(D) windows 10 [1]
Answer:
(D) windows 10
Explanation: Open-source software is computer software that is released under a license in which the copyright holder grants users the rights to use, study, change, and distribute the software and its source code to anyone and for any purpose. [1]

Question 11.
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.
(A) Central Pollution Control Board (CPCB)
(B) Department of Information Technology (DIT)
(C) Electrical and Electronic Equipment (WEEE)
(D) Information Communication Technology (ICT) [1]
Answer:
(A) Central Pollution Control Board (CPCB)
Explanation: CPCB is responsible for the control and monitoring of air and water quality in India. [1]

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

Question 12.
Which of the following is one of the impacts of e-waste on the environment?
(A) Global Warming
(B) deforestation
(C) soil erosion
(D) emission of gases [1]
Answer:
(D) emission of gases
Explanation: When this e-waste is not properly handled and simply thrown out with the garbage, ultimately ending up in landfill, it means both human health and the environment are at risk. [1]

Question 13.
What is/are component of IT Act 2000 ?
(A) Legal Recognition to Digital Signatures
(B) Regulation of Certification Authorities
(C) Digital Certificates
(D) All the above
Answer:
(D) All the above
Explanation: The primary objectives of the IT Act, 2000 are: Granting legal recognition to all transactions done through electronic data exchange, other means of electronic communication or e-commerce in place of the earlier paper-based communication. [1]

Question 14.
Find the output of
SELECT RIGHT (‘School, 2);
(A) Sc
(B) ch
(C) ol
(D) Sch [1]
Answer:
(C) ol
Explanation: The RIGHTO function extracts a given number of characters from the right side of a specified character string. [1]

Question 15.
Which of the following option is correct output for below statement?
SELECT LEFT (‘Programʻ, 4);
(A) Prog
(B) gram
(C) rogr
(D) None
Answer:
(A) Prog
Explanation: LEFT( ): It is used to return a specified number of characters from the left of the string. The number of characters returned is determined by the second argument. [1]

Question 16.
If column “Point” contains the data set (5,8,7,5,8), what will be the output after the execution of the given query?
SELECT MIN (DISTINCT Point) FROM School;
(A)7
(B) 8
(C) 5
(D) Error [1]
Answer:
(C) 5
Explanation: DISTINCT statement is used to return only distinct (different) values. [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): To create a series from array, we have to import the NumPy module and then use array ( ) method.
Reason (R): NumPy is an open-source numerical Python library. NumPy contains a multi-dimensional array and
matrix data structures.
Answer:
(A) Both assertion (A) and reason (R) are true and reason (R) is the correct explanation of assertion (A).
Explantation: NumPy, which stands for Numerical Python, is a library consisting of multidimensional array objects and a collection of routines for processing those arrays. Using NumPy, mathematical and logical operations on arrays can be performed NumPy is a Python package. For most data types, pandas uses NumPy arrays as the concrete objects contained with a Index, Series, or DataFrame. [1]

Question 18.
Assertion (A): Cookies are plain text files. Reason (R): Cookies store the Profile picture on Social Media.
Answer:
(C) Assertion (A) is true but reason (R) is false.
Explanation Cookies are plain text files which store the browsing-related information on user’s computer. These enable you to save password for the website and all the customer setting for the website in the browser for later visits. You can enable or disable cookies from browser settings. You can either allow or block third-party cookies on your browser. [1]

Section – B

Question 19.
Expand the following terms related to computer networks:
(a) HTTP
(b) HTML
(c) POP3
(d) IP [2]
OR
Aman, a freelance web site developer, has been assigned a task to design few web pages for a book shop. Help Aman in deciding out of static web page and dynamic web page, what kind of web pages should be designed by clearly differentiating between static and dynamic web pages on at least two points [2]
Answer:
(a) Hypertext Transfer Protocol
(b) Hypertext Markup Language
(c) Post Office Protocol version 3
(d) Internet Protocol. [2]
OR
Differences between static and dynamic web pages:

Static Web Page Dynamic Page
1. Content of this type of webpage cannot be chaged at run time. 1. Content of this type of webpage can be changed at run time.
2. No interaction with server’s in case of static web pages. 2. Interaction with server database is possible in case of dynamic web page.

Question 20.
Explain COUNT( ) function with an example. [2]
Answer:
COUNT (expr): This function returns a count of the number of not-NULL values of expr in the rows retrieved by a SELECT statement. COUNT() returns O if there are no matching rows. e.g SELECT COUNT(student_name) FROM student;

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

Question 21.
Consider the table Hotel given below:

EmpID Category Salary
E101 Manager 60000
E102 Executive 65000
E103 Clerk 40000
E104 Manager 62000
E105 Executive 50000
E106 Clerk 35000

Mr. Vinjay wanted to display average salary of each category. He entered the following SQL statement. Identify error(s) and rewrite the correct SQL statement.
SELECT Category, Salary FROM Hotel GROUP BY Category; [2]
Answer:
Correct statement:
SELECT Category, AVG(Salary) FROM Hotel GROUP BY Category: [2]

Question 22.
Which library is used for plotting in Python language?
Answer:
The answer to this question varies based on the requirements for plotting data. Matplotlib is the library used for plotting in Python language, but it needs a lot of fine tuning to ensure that the plots look shiny. Data scientists prefer Seaborn to create statistically and aesthetically appealing meaningful plots. [2]

Question 23.
Define the following terms with respect to IPR :
(a) Legal and Legislative Framework
(b) Enforcement and Adjudication
OR
Write a short note on netiquettes. [2]
Answer:
(a) Legal and Legislative Framework: To have strong and effective IPR laws, which balance the interests of right owners with larger public.
(b) Enforcement and Adjudication: To strengthen the enforcement and adjudication mechanisms for combating IPR infringements. [2]
OR
Netiquette is a way to communicate over Internet. In the real world, we use a manner to talk so that the exact meaning could successfully convey to the listener. On internet, this manner is known as netiquette which helps the user exact idea of what is said. In virtual world, if we are talking to anybody can understand what we are saying by seeing facial expression, way of talking, posture etc. But on Internet, it’s not possible because there is only non verbal communication [2]

Question 24.
List any two key features of Pandas. [2]
Answer:
The two key features of Pandas are :

  1. It can process a variety of data sets in different formats: time series, tabular heterogeneous arrays and matrix data.
  2. It facilitates loading and importing data from various sources such as CSV and DB/SQL. [2]

Question 25.
What is Pandas? [2]
Answer:
The Pandas is a high performance open source library for data analysis in Python developed by Wes McKinney in 2008. Over the years, it has become the de-facto standard library for data analysis using Python. [2]

Section – C

Question 26.
Consider the table FLIGHT given below. Write SQL command for (i), (ii) and output for (iii).

FLCode Start Destination No_Stop No_Flights
IC101 Delhi Agartala 1 5
IC102 Mumbai Sikkim 1 3
IC103 Delhi Jaipur 0 7
IC105 Kanpur Chennai 2 2
IC107 Mumbai Kanpur 0 4
IC431 Indore Chennai 3 2
IC121 Delhi Ahmedabad 2 6
  1. Display flight codes, starting place, destination, number of flights in descending order of number of flights.
  2. Display flight codes and starting place whose destination is Jaipur
  3. SELECT MAX(NO_FLIGHTS) FROM FLIGHT; [3]

Answer:
1. SELECT FLCODE, START, DESTINATION,
NO FLIGHTS FROM FLIGHT ORDER BY
NO FLIGHTS DESC;

2. SELECT FLCODE, START FROM FLIGHT WHERE DESTINATION=”JAIPUR”;

3. 7 [3]

Question 27.
Define the head( ) and tail( ) functions. [3]
Answer:
head( ) function is used to get the first n rows.
Syntax Series.head (n=5)
Here, n is the selected number of rows. It is an int type and has default value 5. tail( ) function returns last n rows from the object based on position. It is useful for quickly verifying data. Syntax Series.tail(n=5) Here, n is the selected number of rows whose default value is 5. [3]

Question 28.
Write code for selecting a column from the DataFrame. [3]
Answer:
Import pandas as pd
d={ ‘One’ : pd. Series ([1, 2, 3], index = [‘a’, ‘b’, ‘c’]),
‘Two’ pd. Series (12, 2, 3, 4], index = [‘a’, ‘b’, ‘c’, ‘d’])}
df-pd. DataFrame (d)
print (df)
print df (‘one’)
Output 1

One TWO
a 1.0 1
b 2.0 2
C 3.0 3
d NaN 4

Output 2

One
a 1.0
b 2.0
C 3.0
d NaN

Name: one, dtype: float 64

Question 29.
How our private information can be stolen? [3]
OR
What is e-waste management? Explain how can we control e-waste?
Answer:

We sometime share our personal information with our family and friends in emergency and hurdle. They can misuse our personal information and we can be victim of identity theft.

1. The attacker can steal our information by accessing our documents like bills, our bank documents, our PAN card, driving license etc., if we are using weak passwords.

2. Our private information can be stolen if someone uses our personal computer or our phone because when we allow them to use our personal computer means we are giving permission to make uses of our personal data

3. Our personal data can be stolen by the attacker by making fake call or sending fake e-mails.

4. An attacker can steal our information by keeping an eye on you when we are entering our information. For example, when we are logging our networking site by entering our user id and password then someone could see it if we are not careful about it. [3]
OR
E-waste management is also known as urban mining. It is a technique in which the part of products which are dumped in as the e-waste can be either sold out or reuse. This technique should be opted, in order to avoid disposal of heavy metals, plastics and glass generated from e-waste.

As this can pollute the air or seep into waterways. Thus by recycling e-waste the demand for mining heavy metals and reduction in the greenhouse gas emissions from materials can be decreased significantly. Since, India is one of the largest country producing 350000 tons of e-waste every year. Thus by adapting proper e-waste management technique, huge amount of metals and plastic can be saved each year. The following are the methods to control e-waste,

  1. By Recycling the e-waste.
  2. By Reusing the e-waste.
  3. By Proper Disposal of e-waste.
  4. By purchasing environmentally friend electronics
  5. By donating the e-waste to e-cycling centers.

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

Question 30.
Write the output of the following SQL queries :

  1. SELECT MID (VisitIndia’, 6, 5);
  2. SELECT round (89.387, 2);
  3. SELECT POWER (5, 4);

OR
Considering the string “Programming”
Write SQL commands to display:

  1. The position of the substring’gram’ in the string “Programming”
  2. The first 5 letters of the given string
  3. The last 3 letters of the given string

Answer:

  1. India
  2. 89.39
  3. 625 [3]

OR

  1. SELECT INSTR(‘Programming, gram”);
  2. SELECT LEFT(‘Programming ,5),
  3. SELECT RIGHT(‘Programming’, 3);

Section – D

Question 31.
What is mathematical function? Explain any two mathematical functions with an example.
OR
Tejasvi Sethi, a car dealer has stored the details of all cars in her showroom in a table called CARMARKET. The table CARMARKET has attributes CARCODE which is a primary key, CARNAME, COMPANY, COLOR, COST (in lakh rupees) of the car and DOM which is the Date of Manufacture of the car. Answer. any four questions based on the table CARMARKET from the below mentioned questions
Table: CARMARKET

CARCODE CARNAME COMPANY COLOR COST DOM
CO1 BALEND SIZUKI BLUE 5.90 2019-11-07
CO2 INDIGO TATA SILVER 12.90 2020-10-15
CO3 GLC MERCEDES WHITE 62.38 2020-01-20
CO4 A6 AUDI RED 58.55 2018-12-29
CO5 INNOVA TOYOTA BLACK 32.82 2017-11-10
CO6 WAGON-R SUZUKI WHITE 12.11 2016-11-11
CO7 BREZZA SUZUKI GOLDEN 9.80 2016-10-03

Write SQL commands for the statements (i) to (iv) and answer the question for (v)

  1. Display the carname along with the charges rounded off to 1 digit after decimal place.
  2. Display the carname, color and position of the character ‘E’ in the color of all the cars
  3. Display the carname, name of the company in lower case of all cars whose year (of dom) is 2020.
  4. Display the number of cars manufactured each year.
  5. What is the cardinality and degree of the table CARMARKET?

Answer:
There are various built-in functions include in MySQL for mathematical calculations. These mathematical functions accept numeric value, perform some operations on it and also return numeric value in result. Some mathematical functions used in MySQL are as follows.

• POWER( ): This function is used to get the power of the given values. Syntax: POWER (m, n) This function returns m raised to the nth power.
• ROUND( ): This function is used to round up the number to the upwards or downwards whichever the nearest whole number.
Syntax: ROUND(number) If you want to get number with certain number of decimal places, you can also pass that number and use following syntax: ROUND(number, decimal place); [5]
OR
(i) Select carname, round(cost, 1) from carmarket
(ii) select carname, color, instr(color,’E’) from carmarket;
(iii) select carname,lcase(company) from carmarket
where year(dom) = 2020;
(iv) select count(*),year(dom) from carmarket
group by year(dom);
(v) Cardinality = 7 and Degree = 6

Question 32.
Delhi Public School in Meerut is starting up the network between its different wings. There are four building named as SJ, A and H. The distance between various buildings is as follows:

A to S 200 mt
A to J 150 mt
A to H 50 mt
S to J 250 mt
S to H 350 mt
I to H 350 mt

Number of computers in each building :

S 130
J 80
A 160
H 50

1. Suggest the cable layout of connections between the buildings.
2. Suggest the most suitable place (i.e. building) to house the server of this school, provide a suitable reason.
3. Suggest the placement of the following devices with justification.

  • Repeater
  • Hub/switch

4. The organization also has enquiry office in another city about 50-60 km away in hilly region. Suggest the suitable transmission media to inter-connect school and enquiry office out of the following:

  • Fibre optic cable
  • Micro wave
  • Radio wave

5. The school is planning to connect its A building in the closest big city, which is more than 400 km from school. Which
type of network out of LAN, MAN or WAN will be formed? Justify your answer. [5]
Answer:

  1. CBSE Sample Papers for Class 12 Informatics Practices Set 9 Img 2
  2. Server can be placed in the A buildings as it has the maximum number of computers.
  3. Repeater can be placed between A and S and A and J buildings as the distance is more than 110 mt. Hub/Switch in A building as it is hosting the server.
  4. Radio waves can be used in hilly region as they can travel through obstacles.
  5. WAN as it is outside the city.

Question 33.
Define the DataFrame.Write a code for adding a new column to an existing dataframe.[5]
OR
Write the code which will represent the following plot.
CBSE Sample Papers for Class 12 Informatics Practices Set 9 Img 1
Answer:
DataFrame is a two dimensional labelled array. Its
columns types can be heterogeneous i.e., of varying types. It is similar to structured arrays in NumPy with mutability added. It is conceptually analogous to a table or spreadsheet of data. import pandas as pd d= { ‘one’ : pd. Series {[1, 2, 3). index=[‘a’, ‘b’, ‘c’l),
Two’ pd. Series ([1, 2, 3, 4], index-[‘a’, ‘b’, ‘e’, ‘d’])) af-pd. DataFrame (a) print(“Adding a new column by passing as series :”) df [Three’ ] -pd. Series ([10, 20, 30). index = [‘a’, ‘b’,’S’)) print (df) print(“Adding a new column using the existing columns in Data Prame”) df (‘Four’)=df [‘One’) + df (‘Three’l print (df)

OR
from matplotlib import pyplot as plt
x = (2,6,11]
y = [4,6,9]
x= [6, 4, 12]
y = [6,7,16]
plt.plot(x, y, ‘g, label = ‘line one”, linewidth = 5)
plt.plot(x,y?, C, label = ‘line two’, linewidth = 5)
plt.title(‘Information)
plt.ylabel(‘Y-axis)
plt.xlabel(“X-axis)
plt.legendo
plt.grid (True, color = ‘K)
plt.show( )

commonly Made Error:
Some students are good in theory but not in programming, so they did mistake in coding.

Answering Tip:
Students should practice the program and coding practically so that their concepts could be clear.

Section – E

Case based Subjective Questions

Question 34.

Consider the following table and answer the given questions
Table Name: Library

Acsp_no B name DOB Price Chapter City
101 Abcd 2000-11-01 98 19 Delhi
102 Rxyz 1999-10-02 65.8 18 Kolkata
103 Azxc 2000-05-00 99 20 Delhi
104 Sven 1998-10-12 69.8 17 NULL

(1) What will be the output of the following query? SELECT MID(City,4,3) FROM LIBRARY WHERE Acsn_ no=102; [1]

(2) What will be the output of the following query? [1]
SELECT UCASE(City) FROM LIBRARY WHERE Acsn_no=103;

(3) What will be the output of the following query? Also, define the LEFT( ) function. [2]
SELECT LEFT(City,3) FROM LIBRARY WHERE Chapter=18;
OR (Option for part iii only)

What will be the output of the following query? Also, define the LENGTH() function. [2]
SELECT LENGTH(B_name) FROM LIBRARY WHERE B_name LIKE ‘%b%’;
Answer:

  • Kat [1]
  • DELHI [1]
  • Output

Kol
LEFT( ) function in MySQL is used to extract a specified number of characters from the left side of a given string. It uses its second argument to decide, how many characters it should return. Syntax : LEFT (str, len) [2]
OR
Output
4
The MySQL LENGTH function returns the length of the specified string (measured in bytes). Syntax
LENGTH( string)

35. Mr. Ankit is working in an organisation as data analyst. He uses Python Pandas and Matplotlib for the same. He got a dataset of the passengers for the year 2010 to 2012 for January, March and December. His manager wants certain information from him, but he is facing some problems. Help him by answering few questions given below:

Year Month Passengers
0 2010 Jan 25
1 2010 Mar 50
2 2012 Jan 35
3 2010 Dec 55

Code to create the above data frame:
import pandas as ______ #Statement 1
data={“Year”:[2010,2010,2012,2010],”Month”:/“Jan”,”Mar”,”Jan”,”Dec”],”Passengers”:[25,50,35,55]}
df=pd. ____(data) #Statement 2
print(df)
(a) Answer the question

  • Choose the right code from the following for statement 1 [1]
  • Choose the right code from the following for the statement 2 [1]

(b) He wants to print the details of “January” month along with the number of passengers. Identify the correct statement: [2]

Month passengers
0 Jan 25
1 Jan 35

OR (Option for part iii only)
Mr. Ankit wants to change the index of the Data Frame and the output for the same is given below. Identify the correct statement to change the index.

Year Month Passengers
Air India 2010 Jan 25
Indigo 2010 Mar 50
Spicejet 2012 Jan 35
Jet 2010 Dec 55
Emirates 2012 Dec 65

Answer:
(a)

  • pd [1]
  • DataFrame [1]

(b) df[[‘Month’,’Passengers’]]
[df[Month’]=’Jan’]
OR
df.index=[“Air India”, “Indigo”, “Spicejet”, “Jet”, “Emirates”)