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

Practicing the CBSE Sample Papers for Class 12 Informatics Practices Set 1 allows you to get rid of exam fear and be confident to appear for the exam.

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

Time: 3 hrs
Max. 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

Question 1.
______ is a cyber crime in which a target or targets are contacted by E-mail, telephone or text message by someone posing as a legitimate institution to lure individuals into providing sensitive data such as personally identifiable information, banking and credit card details and passwords. [1]
(a) Plagiarism
(b) Phishing
(c) Cyber stalking
(d) Hacking
Answer:
(b) Phishing

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

Question 2.
Linux, MySQL and Mozilla Firefox software come under ______ category. [1]
(a) proprietary
(b) FOSS
(c) freeware
(d) shareware
Answer:
(b) FOSS (Free and Open Source Software)

Question 3.
Type(s) of law that can help to restrict software piracy is/are [1]
(a) copyright
(b) patent
(c) trademark
(d) All of these
Answer:
(d) All of these

Question 4.
______ may also be defined as discarded computers, office electronic equipment, mobile phones, television sets etc. [1]
(a) Electronic devices
(b) e-Waste
(c) Electronic worm
(d) None of these
Answer:
(b) e-Waste

Question 5.
The correct output of SELECT TRIM (LEADING *&’ FROM ‘&&& India &&&&’); is [1]
(a) India &&&
(b) India &&&&
(c) && India
(d) &&& India
Answer:
(b) India &&&&

Question 6.
Which of the following import statement is not correct? [1]
(a) import pandas as class 12
(b) import pandas as 1 pd
(c) import pandas as pd 1
(d) import pandas as pd
Answer:
(b) import pandas as 1 pd

Question 7.
Which of the following is an example of copyleft license? [1]
(a) GPL
(b) BSD
(c) MIT
(d) All of these
Answer:
(a) GPL

Question 8.
loc takes two single operators separated by [1]
(a) dot(.)
(b) semicolon(;)
(c) colon(:)
(d) comma(,)
Answer:
(d) comma(,)

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

Question 9.
Which of the following is/are library function(s) used to load data from CSV files into DataFrame? [1]
(a) read_csv( )
(b) to_csv( )
(c) Both (a) and (b)
(d) None of these
Answer:
(c) Both (a) and (b)

Question 10.
The function which returns the name of the week day from a date specified as an argument. [1]
(a) DAY( )
(b) DAYNAME( )
(c) MONTHNAME ( )
(d) DAY_NAME( )
Answer:
(b) DAYNAME( )

Question 11.
Network formed between computers which are spread across the continents is called [1]
(a) LAN
(b) WAN
(c) MAN
(d) WLAN
Answer:
(b) WAN

Question 12.
Which amongst the following is not a Text function in MySQL? [1]
(a) UCASE( )
(b) RIGHT( )
(c) DAY( )
(d) LENGTH( )
Answer:
(c) DAY( )

Question 13.
In which topology, network components are connected to the same cable? [1]
(a) Star
(b) Ring
(c) Bus
(d) Mesh
Answer:
(c) Bus

Question 14.
Which of the following SQL statement will give output as 200.6 after execution? [1]
(a) SELECT R0UND(200.56,0);
(b) SELECT R0UND(200.56.-1 );
(c) SELECT ROUND(200.56,2);
(d) SELECT ROUND(200.56,1);
Answer:
(d) SELECT ROUND(200.56,1);

Question 15.
Which of the following keyword sorts the records in ascending order by default? [1]
(a) GROUP BY
(b) HAVING
(c) ORDER BY
(d) None of these
Answer:
(c) ORDER BY

Question 16.
Which one of the following is not an aggregate function? [1]
(a) ROUND( )
(b) MAX( )
(c) MIN( )
(d) AVG( )
Answer:
(a) ROUND( )

Question 17.
Assertion (A) Pandas is an open-source Python library which offers high performance, easy to use data structures and data analysis tools. [1]
Reason (R) Professionals and developers are using the Pandas library in data science and machine learning.
(a) Both A and R are true and R is the correct exj. lanation of A.
(b) Both A and R are true but R is not the correct i -planation of A.
(c) A is true but R is false.
(d) A is false but R is true.
Answer:
(a) PANDAS (PANel DAta) is a high level data manipulation tool used for analysing data. It is very easy to import and export data using Pandas library which has a very rich set of functions. In data science and machine learning, professionals and developers are using the Pandas library.

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

Question 18.
Assertion (A) An Internet troll is a person who deliberately sows discord on the Internet by starting quarrels or upsetting people. [1]
Reason (R) We can download and use any material available on the Internet.
(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.
Answer:
(c) A troll is a person who sows discord on the Internet by starting arguments or upsetting people by posting inflammatory, extraneous or off topic messages in an outline community. We cannot download and use any material on the Internet.

Section – B

Question 19.
What do you mean by cyber stalking? [2]
Answer:
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.
Or
List some factors which have led in rise of cyber crimes?
Answer:
Some factors which have led in rise of cyber crimes are as follows
(i) Spread of computers
(ii) Increasing use to broadband
(iii) Increasing financial motivation for computer crime

Question 20.
Write a code to create a series object using a dictionary that stores the salary of employees in ABC organisation. [2]
Answer:
import pandas as pd
Emp=i ‘a ’ : 10000, ‘b’ : 15000, ‘c’ : 12000}
sr = pd. Series (Emp)
print(sr)

Question 21.
How to access multiple columns in DataFrame? [2]
Answer:
Data Frame JDbject.1oc[:,startcolumn:stopcoi umn]

Question 22.
Carefully observe the following code: [2]
import pandas as pd
One=i ’ P ‘ -.5000, ’Q’ -.8000, ’ R ’ : 12000, ‘S’ : 18000}
Two=(‘A’ :13000,’B’:14000,‘O:12000}
totSales={1:One,2:Two}
df=pd.Data Frame}totSales )
print (df)
Answer the following:
(i) List the index of the DataFrame df
(ii) List the column names of DataFrame df.
Answer:
(i) The index labels of df will include P, Q, R, S, A, B, C.
(ii) The column names of DataFrame df will be 1,2.

Question 23.
What is the purpose of ORDER BY clause in SQL? Explain with the help of suitable example. [2]
Answer:
The ORDER BY clause is used to sort the result set in ascending or descending order.
e.g. The following SQL statement displays all the customer’s names in alphabetical order.
SELECT Cname FROM Customers ORDER BY Cname;

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

Question 24.
A character expression name contains ‘try yourself’. Write a command to pick the following set of characters from it. [2]
(i) First 3 characters
(ii) From 3rd to 7th character
Answer:
(i) mysql>SELECT LEFT (‘try yourself’, 3);
(ii) mysqDSELECT SUBSTR (‘try yourself’, 3, 5):

Question 25.
list some benefits of networking. Name any two components required for networking. [2]
Answer:
Some of the benefits of networking are
(i) File sharing
(ii) Hardware sharing
(iii) Application sharing
(iv) User communication
(v) Access to remote database

Two components required for networking are Switch/hub and repeaters.
Or
Give an example of each static web page and dynamic web page.
Answer:
Static web page A page that contains school or company information. The content of this page will not change every day unless the HTML file is manually edited by a programmer who maintains it. Dynamic web page When you login to your Yahoo E-mail account to check and to send E-mails. Moreover, the list of E-mail messages changes as it arrives or as the list is deleted or is moved to another folder.

Section – C

Question 26.
Rahul has recently shifted to a new college and hostel. He does not know many people in his new college and hostel. But all of a sudden, someone is posting negative, demeaning comments on his social networking profile etc. He is also getting repeated mails from unknown people. Every time he goes online, he finds someone chasing him online. [3]
(i) What is this happening to Rahul?
(ii) What immediate action should he take to handle it?
(iii) Is there any law in India to handle such issues? Discuss briefly.
Answer:
(i) Rahul has become a victim of cyber bullying and cyber stalking.
(ii) He must immediately bring it into the notice of his parents and school authorities. And he must report this cyber crime to local police with the help of his parents.
(iii) Yes. The Information Technology Act, 2000 (also known as ITA-2000, or the IT Act) is the primary law in India dealing with cybercrime and electronic commerce.
Or
What is software licensing ? Name two types of software licensing with an example of each. Ans. A software license is a license agreement that given an individual, a company or an organisation permission to use a software program. It typically provides end users with the right to one or more copies of the software without violating copyrights. Software licenses typically are the either proprietary or free and open source.
(i) Proprietary software Microsoft Windows.
(ii) Free and open source software license MySQL, Python

Question 27.
Write a small Python code to create a DataFrame with headings (a and b) from the list given below [3]
[[10, 20], [30, 40], [50, 60], [70, 80]]
Answer:
import pandas as pd
df1=pd.DataFrame ([[10, 20], [30, 40]],
columns = [‘a’, ‘b’])
df2=pd.DataFrame ([[50, 60], [70, 80]],
columns = [‘a’, ‘b’])
df = df1.append (df2)

Question 28.
Given a DataFrame df as shown below [3]

A B C
0 21 12 69
1 45 45 84
2 23 86 70
3 17 33 78

What will be the result of the following code statements?
(i) df [ ‘ D ’ ]=np. NaN
(ii) df [ ‘ D’ ] = [23, 41, 32]
(iii) df [ ‘ D ’ ] = [23, 41, 32, 9]
Answer:

A B C D
0 21 12 69 NaN
1 45 45 84 NaN
2 23 86 70 NaN
3 17 33 78 NaN

(ii) ValueError Length of values does not match with the length of index.
(iii)

A B C D
0 21 12 69 23
1 45 45 84 41
2 23 86 70 32
3 17 33 78 9

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

Question 29.
Give the output of following commands. [3]
(i) mysql>SELECT TRUNCATE (200.91,1);
(ii) mysql>SELECT LEFT (‘Swati’, 4);
(iii) mysql>SELECT LENGTH (“Information”);
Answer:
(i) 200.9
(ii) Swat
(iii) 11

Question 30.
Consider the table EXAM given below. Write the queries for (i) to (iii). [3]
Table: EXAM

Name Stipend Subject Average Division
Karan 400 English 68 Ist
Aman 680 Mathematics 72 Ist
Javed 500 Accounts 67 Ist
Bishakh 200 informatics 55 Ilnd
Sugandha 400 History 35 Illrd
Suparna 550 Geography 45 Illrd

(i) To list the names of those students, who have obtained division as 1st in ascending order of Name.
(ii) To count the number of students, who have either Accounts or Informatics as Subject.
(iii) To display a report listing Name, Subject and annual Stipend received assuming that the Stipend column has monthly stipend.
Answer:
(i) SELECT Name FROM EXAM WHERE Division = “1st” ORDER BY Name;
(ii) SELECT COUNT (*) FROM EXAM WHERE Subject = “Accounts” OR Subject = “Informatics”;
(iii) SELECT Name, Subject, Stipend * 12 “Stipend” FROM Exam;
Or
Reena is working with functions of MySQL. Explain her following
(i) What is the purpose of NOW() function?
(ii) How many parameters does it accept?
(iii) What is the general format of its return type?
Answer:
(i) The NOW( )function returns the current date and time.
(ii) 0 parameters
(iii) “YYYY-MM-DD HH-MM-SS”

Section – D

Question 31.
A bar graph is used to show individual figures at a specific time or to compare different items. Similarly, a bar graph which is showing the marks of different subjects. You have to write the code that will represent the given graph. [5]
CBSE Sample Papers for Class 12 Informatics Practices Set 1 Img 1
Answer:
import matplotlib.pyplot as pit
x = [‘Math’, ‘SST’, ‘Hindi’, ‘Science’, ‘Computer’, ‘English’]
marks = [85, 75, 88, 80, 77, 67]
x_pos = [i for i, _ in enumerated)]
plt.xlabel(“Subjects”)
pit.ylabei(“Marks”)
plt.title(“Marks of different subjects”)
plt.xticks(x_pos, x)
width = [0.1,0.2,0.5,1.1,0.2,0.3]
y_pos = [0,.8,1.5,3,5,6]
p1t.bar(y_pos, marks, width=width)
plt.xticks(y_pos, x)
pi t.minorticks_on( )
pit.grid(which=‘major’, 1 inestyle=‘-’, linewidth=‘0.5’, color=‘black’)
pit.grid(which=‘minor’, iinestyie=‘:’, linewidth=‘0.5’, coior=‘magenta’)
pit.show( )
Or
Write a Python code to create a line graph for the data given below based on Games apps rated by the users.
Games=[“Subway Surfer “,”Temple Run”, “CandyCrush”, “Bottle Shot”, “Runner Best”]
Rating=[4.2,4.8,5.0,3.8,4.1]
Answer:
import matpiotlib.pyplot as plt
Games=[“Subway Surfer”,“Tempie Run”,“CandyCrush”,“Bottie Shot”,“Runner Best”]
Rating=[4.2,4.8,5.0,3.8,4.1]
pit.plot(Games,Rating)
pit.titie(“Games apps”)
plt.xlabel(“Games”)
plt.yiabel(“Rating”)
pi t.show( )

Question 32.
Write down the syntax format of the following functions, with one example of each. [5]
(i) LCASE(str)
(ii) UCASE(str)
(iii) RIGHT(str,n)
(iv) POWER(m,n)
(v) RTRIM(str)
Answer:
(i) Syntax LCASE (str)
e.g. mysql >SELECT LCASE(‘MySQL’);
Output mysql

(ii) Syntax UCASE (str)
e.g. mysql>SELECT UCASE(‘Mystring’);
Output MYSTRING

(iii) Syntax RIGHT (str.n)
e.g. mysql>SELECT RIGHT! ‘ America ’ ,3);
Output ica

(iv) Syntax POWER (m,n)
e.g. mysql>SELECT POWER(2,2);
Output 4

(v) Syntax RTRIM (str)
e.g. mysql >SELECT RTRIM! ‘##Ari hant#’);
where # denotes space.
Output ##Arihant
Or
Consider the table DOCTOR given below. Write commands in SQL for (i) to (iv) and answer the question for (v).
Table: DOCTOR

DOCName Department DOJ Gender Salary
Amit Kumar Orthopaedics 1993-02-12 M 35000
Anita Hans Paediatrics 1998-10-16 F 30000
Sunita Maini Gynaecology 1991-08-23 F 40000
Joe Thomas Surgery 1994-10-20 M 55000
Gurpreet Kaur Paediatrics 1999-11-24 F 52000
Anandini Burman Oncology 1994-03-16 F 31000
Siddharth Dang Surgery 1995-09-08 M 47000

(i) Display the names and salaries of doctors in descending order of salaries.
(ii) Display names of each department along with total salary being given to doctors of that department.
(iii) Display the number of doctors in each department.
(iv) To display all the female doctors from the given data.
(v) Identify the primary key from the table DOCTOR.
Answer:
(i) SELECT DOCName, Salary FROM DOCTOR ORDER BY Salary DESC;
(ii) SELECT Department, SUM (Salary) FROM DOCTOR GROUP BY Department;
(iii) SELECT Department, COUNT!*) FROM DOCTOR GROUP BY Department;
(iv) SELECT DOCName FROM DOCTOR WHERE Gender=’F’;
(v) ID

Question 33.
Green Valley Public School has 4 buildings in its campus . Distance between the buildings and the number of computers in each is given below [5]
CBSE Sample Papers for Class 12 Informatics Practices Set 1 Img 2

Building Number of Computers
A 150
B 10
C 25
D 30
Building Distance
A-B 10 m
A-C 1250 m
A-D 25 m
B-C 30 m
B-D 2000 m

(i) Which building is best suitable for placement of server? .
(ii) If building A to D is to be connected, which device will be required for strong signals?
(iii) Which building would need a switch/hub?
(iv) Which topology would you suggest for connecting computers in each building?
(v) Suggest and draw cable layout to efficiently connect various buildings within the school campus for a wired connectivity.
Answer:
(i) Building A, as it has maximum number of computers.
(ii) A repeater would be required, as signals become weak in long distances which can be amplified by a repeater.
(iii) Hub/switch would be required in all the buildings as they connect multiple computers.
(iv) Star topology would be the best as it has multiple positive features.
(v) Cable layout
CBSE Sample Papers for Class 12 Informatics Practices Set 1 Img 3

Section – E

Question 34.
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: [1+1+2]

Year Month Passengers
2010 Jan 25
2010 Mar 50
2012 Jan 35
2010 Dec 55
2012 Dec 65

(a) What will be the output of the following statements?
(i) df.shape( )
(ii) df. index= [“AirIndia”, “Indigo”, “Spicejet”, “Jet”, “Emirates”]

(b) Write the code to get following output:

Month Passengers
Jan 25
Jan 35

Or (Option for Part (b) only)
Suppose a DataFrame df contains information about student having columns rollno, name, class and section. Write the code to transpose DataFrame.
Answer:
(a) (i) (5,3)
(ii)

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

(b) df[‘Month’,’Passengers’]][df[‘Month’]==’Jan’]
Or
df.T

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

Question 35.
Tejasvi Sethi, a car dealer has stored the details of all cars in her showroom in a table CARMARKET. The table CARMARKET has attributes CARCODE which is a primary key, CARNAME, COMPANY, COLOR, COST (in lakh) of the car and DOM which is the Date of Manufacture of the car. [1+1+2]
Table: CAR MARKET

CARCODE CARNAME COMPANY COLOR COST DOM
C01 BALENO SUZUKI 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
C06 WAGON-R SUZUKI WHITE 12.11 2016-11-11
C07 BREZZA SUZUKI GOLDEN 9.80 2016-10-03

Help her by writing answers of the following guestions based on the given table.
(i) Display the carname along with the charges rounded off to 1 digit after decimal place.
(ii) Display the carname ,name of the company in lower case of all cars whose year (of dom) is 2020.
(iii) Display the number of cars manufactured each year.
Or (Option for part (iii) only)
Display the carname, color and position of the character ‘E’ in the color of all the cars.
Answer:
(i) SELECT CARNAME, ROUND!COST, 1) FROM CARMARKET;
(ii) SELECT CARNAME, LCASE (COMPANY) FROM CARMARKET WHERE YEAR! DOM) = 2020;
(iii) SELECT COUNT!*) ,YEAR(D0M) FROM CARMARKET GROUP BY YEAR! DOM) ;
Or
SELECT CARNAME, COLOR,INSTR!COLOR,’E’ ) FROM CARMARKET;