XII IP MS (1)

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 9

KENDRIYA VIDYALAYA SANGATHAN, LUCKNOW REGION

SECOND PREBOARD EXAMINATION 2022 - 23


CLASS XII
INFORMATICS PRACTICES (065)
MARKING SCHEME
TIME: 3 HOURS
M.M.70
All the answers given in this Marking Scheme are suggestive in nature, Similar and correct
answers may also be considered.

SECTION A
1 Given a Pandas series called p, the command which will display the last 4 rows is 1
__________________.
Ans c. print (p.tail(4))
2 In Pandas, the Dataframe can store ____________ type of values 1
Ans: b) Heterogeneous
3 The command used to display the title for x-axis to a graph is _________ 1
Ans :c. plt.xlabel()
4 Write the output of the following SQL command. 1
select substr(“COMPUTER”,4,2);
Ans
c. PU
5 __________________ refers to the proper manner and behaviour we need to exhibit 1
while being online.
Ans:
b.Netiquettes
6 The ______is the Digital trail of your activity on the internet. 1
Ans:
b) Digital footprint
7 Select CHAR(65, 65.1); will display the output: 1
Ans
(d) AA
8 What is the correct syntax to return both the first row and the second row in a Pandas 1
DataFrame df?
Ans
a. df.loc[[0,1]]
9 Which amongst these is not an example of web server? 1
Ans
d. Chrome
10 A computer network created by connecting the computers of your school’s computer lab is 1
an example of
Ans. a.LAN
11 OSS stands for 1
Ans: d) Open source software
12 Legal term to describe the right of creator of original creative or artistic work is called____. 1
Ans: a.Copyright
13 Stealing someone else’s intellectual work and representing it as own is called 1
____________
Ans: c. Plagiarism
14 Pramit wants to display the month from the given date and time. Which function should 1
he use?
Ans: d)month()
15 Which function will be used to read data from a CSV file into pandas data frame? 1
Ans: c. read_csv()
16 ___________ is a network device which segments networks into different sub networks 1
called subnets or LAN segments.
Ans:
b.Switch
Q17 and 18 are ASSERTION AND REASONING based questions. Mark the correct
choice as
a. Both A and R are true and R is the correct explanation for A
b. Both A and R are true and R is not the correct explanation for A
c. A is True but R is False
d. A is false but R is True
17 Assertion (A):- While creating a dataframe with a nested or 2D dictionary, Python interprets 1
the outer dictionary keys as the columns and the inner keys as the row indices.
Reasoning (R):- A column can be deleted using remove command.
Ans c. A is True but R is False
18 Assertion (A): - Internet cookies are text files that contain small pieces of data, like a 1
username, password and user’s preferences while surfing the internet.
Reasoning (R):- To make browsing the Internet faster & easier, its required to store certain
information on the server’s computer.
Ans c. A is True but R is False
SECTION B
19 List any four advantages of computer networks. 2
Ans
Resource Sharing. Cost efficient way of communication. Collaborative user interaction.
Time Saving. Provides better and reliable storage solutions.
(1/2 mark for each advantage)
20 What is the purpose of IS NULL and IS NOT NULL operators? Give examples 2

Ans
IS NULL and IS NOT NULL operators are used for filtering tuples from the table having
or not having NULL values in a specific attribute. E.g. SELECT * FROM STUDENT
WHERE DOB IS NULL; SELECT * FROM STUDENT WHERE CLASS IS NOT NULL;
1 Mark for purpose and 1 mark for example
21 What is the use of LIKE operator in SQL? Give example 2
Ans
Like operator is used for matching patterns of character values on specific attributes
and filter out the tuples on the basis of the given patterns. It uses two wildcard
characters % and _ (Underscore) for specifying patterns.
1 Mark for use and 1 mark for example
22 Write a program to create the following series named M1 and index as following 2

Ans:
import pandas as pd
M1=pd.Series([45,65,24,89],index=[‘Term1’,’Term2’,’Term3’,’Term4’],
columns=[‘Marks’])
print(M1)
23 List any four benefits of e-waste management. 2
OR
What is IPR? Why should it be protected?
Ans
The e-waste management-
i. Saves the environment and natural resources
ii. Allows for recovery of precious metals
iii. Protects public health and water quality
iv. Saves landfill space
½ mark for each benefit
OR
Intellectual property rights are the rights given to persons over the creations of their
minds like creativity concepts, inventions, industrial models, trademarks, songs,
literature, symbols, names, brands,....etc. They also entitle him/her to prevent others
from using, dealing or tampering with his/her product without prior permission from
him/her.
It should be protected since:
1. New innovations in all IPR domains lead to Human progress and advancement.
2. Legal protection of new innovations encourages safe spending on other
innovations.
3. Caring for and protecting IPR contribute to achieving economic and social
development.
24 Write the output of the following code: 2
import pandas as pd
s3=pd.Series(50,index=['r1','r2','r3','r4','r5'])
print(s3)
Ans

25 Write the output of the following : 2


import pandas as pd
d1={"one":33, "two":44}
d2={"one":55, "two":66}
d3={"one":77, "two":88}
list_of_d =[d1,d2,d3]
df3=pd.DataFrame(list_of_d, index=["r1","r2","r3"])
print(df3)

Ans

SECTION C
26 Consider the following table Club : 3

Give the answer of the following questions on the basis of the above table.
(i) Write a query to display the substring of 3 characters of the name of each coach,
starting from second character, with their age.
(ii) Write a query to display coach name and year of joining
(iii) Write a query to display 3 characters from left of coach name.
Ans
(i) SELECT SUBSTR (COACHNAME,2,3) , AGE FROM Club;
(ii) SELECT COACHNAME,YEAR(DATE_OF_JOINING) FROM CLUB;
(iii) SELECT LEFT (COACHNAME,3) FROM Club;

27 Consider the Dataframe Humanoid 3

i. Write a command to display the records of the dataframe which have


amount greater than equal to 5000.
ii. How will you change the index from H_1,H_2,H_3 to 101,102,103
iii. Add a column called Sale_Price with the following data:
[6000,3700,2800]
Ans:
i. Humanoid[Humanoid[‘Amount’]>=5000]
OR
Humanoid[Humanoid.Amount>=5000]
ii. Humanoid.rename({‘H_1’:101,’H_2’:102,’H_3’:103})
iii Humanoid[‘Sale_price’]= [6000,3700,2800]
28 Write the output of the queries (a) to (c) based on the table, Staff 3
given below:
Table: Staff
Id Name DOJ Dept Gender Exp
1 Aman 12-01-2006 Finance M 15
2 Dima 03-05-2016 Personnel F 5
3 Christin 15-11-2009 Sales F 12
a
4 Shem 20-12-2006 Sales M 15
5 Roshan 13-10-2013 Finance M 8
6 Danish 11-09-2013 Personnel M 8
7 Habeen 16-08-2011 Sales F 10
a
(a) Select avg(exp) from staff where gender = ‘F’;
(b) Select * from staff where gender =’M’ and dept like ‘P%’;
(c )Select upper(Name) from Staff where year(DOJ) < 2010 ;
Ans:
(a)
Avg(exp)
9
(b)
Id Name Doj Dept Gend Exp
er
6 Danish 11-09- Personne M 8
2013 l
(c)Name
AMAN
CHRISTINA
SHEM
29 Indu received an email from her bank stating that there is a problem with her account. 3
The mail provides instructions and a link, by clicking on that link she can login to her
account and fix the problems.
i) Which cybercrime happened with her?
ii) What immediate action should she take to handle it?
iii) Is there any law in India to handle such issues. Discuss briefly
OR
What do you understand by plagiarism? Why is it a punishable offence? Mention any
two ways to avoid plagiarism.
Ans:
i)Phishing.
ii)Never Click on any unknown links and report to cyber cell.
iii)Indian IT Act
OR
Plagiarism is presenting someone else's work or ideas as your own, with or without their
consent, by incorporating it into your work without full acknowledgement.
Plagiarism is essentially theft and fraud committed simultaneously. It is considered theft
because the writer takes ideas from a source without giving proper credit to the author.
 paraphrase with care
 iGive credit where credit is due.
 Beware of cutting and pasting Footnote
3 marks for correct answer
30 What is the purpose of GROUP BY clause in MySQL? How is it different from ORDER 3
BY clause?
Ans.
The GROUP BY clause can be used to combine all those records that have identical
value in a particular field or a group of fields. Whereas, ORDER BY clause is used to
display the records either in ascending or descending order based on a particular field.
For ascending order ASC is used and for descending order, DESC is used. The default
order is ascending order.

OR

Consider a MySQL table ‘product’.Write the command for the following:


P_I
PROD_NAME PROD_PRICE PROD_QTY
D
P01 Notebook 85 500
P02 Pencil Box 76 200
P03 Water Bottle 129 50
P04 School Bag 739 70
(i) Display minimum PROD_QTY.
(ii) Display the value of each product where the value of each product is calculated
as PROD_PRICE * PROD_QTY
(iii) Display average PROD_PRICE.

Ans
(i) SELECT MIN(PROD_QTY) FROM product;
(ii) SELECT PROD_PRICE*PROD_QTY AS ‘Value’ FROM product;
(iii) SELECT AVG(PROD_PRICE) FROM product;

SECTION D
31 Consider a table “Salesman” with the following data: 5
Write SQL queries using SQL functions to perform the following operations.
(i) Display salesman name and bonus after rounding off to zero decimal places.
(ii) Display the position of occurrence of the string “ta” in salesman names.
(iii) Display the four characters from salesman name starting from second character.
(iv) Display the month name for the date of join of salesman.
(v) Display the name of the weekday for the date of join of salesman.

Ans
a. SELECT Sname, ROUND(Bonus,0)FROM Salesman; (
b. SELECT INSTR(Sname, “ta”) FROM Salesman;
c. SELECT MID(Sname,2,4) FROM Salesman;
d. SELECT MONTHNAME(DOJ) FROM Salesman;
e. SELECT DAYNAME(DOJ)FROM Salesman;

OR
Write the SQL functions which will perform the following operations:
i) To display the day of month of current date.
ii) To remove spaces from the beginning and end of a string, “ Informatics Practices
“.
iii) To display the name of the day eg. Friday or Sunday from your date of birth, dob.
iv) To convert your name into Upper case.
v) To compute the mode of two numbers num1 and num2.

Ans
i. SELECT DAYOFMONTH(CURDATE());
ii. SELECT TRIM(“ Informatics Practices “);
iii. SELECT DAYNAME(“2015-07-27”);
iv. SELECT UPPER(Name);
v. SELECT MOD(num1,num2);

32 University of India is starting its first campus in a small town Parampur of central India 5
with its centre admission office in Delhi. The university has three major buildings
comprising of Admin Building, Academic Building and Research Building in the 5 km
area campus. As a network expert, you need to suggest the network plan as per (i) to
(v) to the authorities keeping in mind the distances and other given parameters.
(i) Suggest the authorities, the cable layout amongst various buildings inside the
university campus for connecting the building.
(ii) Suggest the most suitable place (i.e. building) to house the server of this
organisation, with a suitable reason.
(iii) Suggest an efficient device from the following to be installed in each of the buildings
to connect all computers. (a) Gateway (b) Modem (c) Switch
(iv) Write the name of protocol for establishing an online face to face communication
between the people in the ADMIN office of Parampur campus and Delhi Admission
Office?
(v)Which device can be installed for network security

Ans

1 Mark of any correct answer


(ii) The most suitable place (i.e. block) to house the server of this university is Academic
Block, because there are maximum number of computers in this block and according to
80-20 rule 80% of traffic in a network should be local.
(iii) (c)The efficient device to be installed in each of the blocks to connect all the
computers is switch.
(iv) Voice over internet protocol
(v) Firewall
33 Sharma is working in a game development industry and he wants to compare the given 5
chart on the basis of the rating of the various games available on the play store. Write a
Python code to get the following bar chart. Save the chart in png format.
Ans

import matplotlib.pyplot as plt --- ½ marks


Games=["Funbrain","Ludo","MineCraft","BattleShip","NeoPets"]--- ½ marks
Rating=[4.2,4.8,5.0,3.8,4.1] --- ½ marks
plt.bar(Games,Rating) --- 1 marks
plt.xlabel("Games")--- ½ marks
plt.ylabel("Rating")--- ½ marks
plt.title("Online Games")--- ½ marks
plt.savefig("OnlineGames.png")--- ½ marks
plt.show()--- ½ marks

OR
Write a Python code to get the following Line chart. Save the chart in png format.

Ans
import matplotlib.pyplot as plt--- ½ marks
x=["Canva","Headspace","Notability","Skillshare","WhiteNoise"]--- ½ marks
y=[400,800,720,120,310] --- ½ marks
plt.plot(x,y) ---1 marks
plt.xlabel("App Name")--- ½ marks
plt.ylabel("Price")--- ½ marks
plt.title("App prices")--- ½ marks
plt.savefig("App price.png")--- ½ marks
plt.show()--- ½ marks

SECTION E
34 Shreya, a database administrator has designed a database for a clothing shop. Help her by 1+1+2
writing answers of the following questions based on the given table:
Table: Cloth
i. Write a query to display total number of cloths of Green color.
ii. Write a query to display the cloth name along with Day of purchase i.e. Monday,
Tuesday
iii. Write a query to display size-wise total price of cloths.
OR (for option iii only)
Write a query to display name of cloths which are purchased in month of November
and whose price is less than 1200.

i. Select color, count(*) from cloths where color =’green’;


ii. Select cname, dayname(dop) from cloth;
iii. Select sum(Price),size from cloth Group by size ;
OR
Select cname from cloth where month(dop) = 11 and price < 1200

35
1+1+2

A. Predict the output of the following python statement:


i. df.shape
ii. df.size
B. Write Python statement to print the Target of zoneA and zone B

Ans
A.
i. (4,2)
ii. 8
B. drintf(df.loc[“zoneA”:”zoneB”,”Target”:”Target”]

OR (Option for part B only)


Write Python statement to compute and display the difference of data of Target column
and Sales column of the above given DataFrame.

Ans
print(df.Target-df.Sales)

You might also like