You are on page 1of 11

ARMY PUBLIC SCHOOL, AMRITSAR

PREBOARD EXAM THREE (Jan 2024)


CLASS – XII
ANSWER KEY - INFORMATICS PRACTICES (065)
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

1 Which of the following activity is an example of leaving Active digital footprints?


a. Surfing internet b. Visiting a website 1
c. Posting comments on social media d. None of these
2 Fill in the blanks : 1
The command used to draw line graph is
a. plt.show() b. plt.plot() c. plt.line() d. plt.title()
3 Write the output of the following SQL command. 1
select round(999.88,-1);
a. 900 b. 990 c. 1000 d. 999.9
4 Pandas drop() function can be used to delete___ 1
a. Row b. Column
c. Row & Column d. None of these
5 Using Python Matplotlib can be used to count how many 1
values fall into each interval
a. line plot b. bar graph c. histogram d. None of these

6 Which of the following is true about the MAX() and MIN() functions? 1
a. Both can be used for any data type b. MAX() returns the maximum value.
c. MIN() returns the smallest value. d. All are true.

7 method in Pandas can be used to change the 1


label of rows and columns of a Series or DataFrame:
a. replace() b. rename()
c. reindex() d . none of these
8 Seema Tour and Travels company has set up its new branch office in 1
Udaipur where different buildings are spanned over in the radius of 800
meters in Udaipur. Name the type of network formed in the following
situations :
(i) The branch office is connected with the regional office in New Delhi.
a. LAN b. MAN c. WAN d. PAN
(ii) All the buildings of branch office are connected to each other.
a. LAN b. MAN c. WAN d. PAN
9 The result of an arithmetic operation between Series of different index will result in 1
a. Error b. None c. NaN d. NULL

Page 1 of 11
10 The practice of taking someone else's work or ideas and passing them of as one's 1
own is known as ___________
a. Copyright b. Theft c. Plagiarism d. None of these

11 The output type of Instr() function in MySql is: . 1


a. String b. date c. Numeric d. None of these
12 Which network topology requires a central controller or hub? 1
a. Mesh b .Star c .Bus d.Ring
13 Which of the following is not an intellectual property? 1
a. A poem written by a poet
b. An original painting made by a painter
c. Trademark of a Company
d. A remixed song
14 Mr. Suresh is not able to identify the Domain Name in the given URL. Identify and 1
write it for him.
URL is:- “https//www.cbse.gov.in/main/aboutus.htm”

a. cbse.gov.in b. www.cbse.gov.in/main
c. aboutus.htm d. main
15 NULL value in SQL means : 1
a. 0 value b. “ ” value
c. No value d . None of the these
16 network device is known as an intelligent hub . 1
a. Bridge b. Passive Hub c. Active Hub d. Switch
Directions (Q No. 17-18) In the questions given below there are two statements
marked as Assertion (A) and Reason (R) . Read the statements and choose the
correct option.

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.
17 Assertion (A): Series object is size mutable. 1
Assertion
Reason (R):(A): DataFrame
A series object is size
is value mutable.
mutable.
Reason
d. (A) is(R): A data
false, but frame
(R) is is value mutable.
true.
18 Assertion (A): Stealing money from someone’s wallet is a type of 1
cybercrime.
Reason (R): Cybercrime is a crime that involves a computer and a network.
d. (A) is false, but (R) is true.

SECTION –B
19 Explain the terms Web page and Home Page. 2
webpage-a document using http and that resides on a web-site is known as a web page.
Home page-it is the top level web page of a web site. this is the page that gets displayed
first of all when a web site is opened.
OR
Mention any four networking goals.
• Resource sharing.
• Reliability.
• Cost-effective.
• Fast data sharing.

Page 2 of 11
20 Rashmi, a database administrator needs to display house wise total 2
number of records of ‘Red’ and ‘Yellow’ house. She is encountering
an error while executing the following query:

SELECT HOUSE, COUNT (*) FROM STUDENT GROUP BY HOUSE


WHERE HOUSE=’RED’ AND HOUSE= ‘YELLOW’;

Help her in identifying the reason of the error and write the correct
query by suggesting the possible correction (s).

SELECT HOUSE, COUNT (*) FROM STUDENT GROUP BY HOUSE


HAVING HOUSE=’RED’ OR HOUSE= ‘YELLOW’;

Alternative answer

SELECT HOUSE, COUNT (*) FROM WHERE HOUSE=’RED’ OR HOUSE=


‘YELLOW’ STUDENT GROUP BY HOUSE;
21 It’s an era of online financial transactions. Help Neena in identifying any two 2
challenges which a common man may face for the same.
Identity theft, fraud, use of weak passwords, phishing attacks, unsecure networks and
devices, ignorance, insider threats, and system flaws.
OR
What do you understand by Net Etiquettes? Explain any two such etiquettes.
No copyright violation. Share your expertise with others on the internet. Avoid cyberbullying.
Respect others' privacy and diversity.

22 Vinu writes the following commands with respect to table student 2

Command1 : Select sum(marks) from student; Gives Output as: 400


Command2: Select avg(marks) from student; Gives Output as: 40

i) What will be the cardinality of the table if there is no NULL value for
marks?
Cardinality - 10
ii) Write the command to find out the no. of rows in this table.
SELECT COUNT(*) FROM STUDENT;
23 Give the output for following statement: 2

import pandas as pd
a = pd.DataFrame([1, 2, 5, None], index=['a', 'b', 'c', 'd'],columns=['one'])
print(a)
one
a 1.0
b 2.0
c 5.0
d NaN

Page 3 of 11
24 Consider the tables given below: 2

Table: Party
PartyId Description CostPerItem
P101 Birthday 400
P102 Wedding 700
P103 Farewell 350
P104 Engagement 450
Table: Client
ClientId ClientName Phone NoOfGuests PartyId
C101 A.K.Antony 99101956 80 P101
C102 Fauzia Aria 893466448 500 P102
C103 Rashi Khanna 981166568 50 P101
C104 S.K. Chandra 65877756 100 P104
(i) Name the Foreign key along with its table name
PartyId in table Client
(ii) Write SQL command to display Clientname,Phone, description and
Costperitem
SELECT Clientname,Phone, description, Costperitem FROM Party, Client
WHERE PARTY.PARTYID = CLIENT.PARTYID;
25 Write a python code to create an empty Dataframe. 2
import pandas as pd
df= pd.DataFrame()
print(df)
OR
Consider a given Series , SR:

a 50
b 40
c 55
d 45

Write a program in Python Pandas to update the index to E,F,G,H and delete the
first element.
#To change index
SR.index=[‘E’, ‘F’,’G’,’H’]
OR
SR.rename({‘a’:’E’,’b’:’F’,’c’:’G’,’d’:’H’})
#To delete first element
SR.drop(‘E’)

SECTION – C
SECTION – 1
Attempt any 15 questions from questions 1 to 21

Page 4 of 11
26 Write SQL command for(i) and output for (ii) &(iii) from the following queries: 3

TABLE: SPORTS
StudentNo Class Name Game1 Grade1 Game2 Grade2
10 7 Sameer Cricket B Swimming A
11 8 Sujit Tennis A Skating C
12 7 Kamal Swimming B Football B
13 7 Veena Tennis C Tennis A
14 9 Archana Basketball A Cricket A
15 10 Arpit Cricket A Athletics C
(i) Display the names of the students who have grade ‘A’ in either Game1
or Game2 or both.
SEELCT NAME FROM SPORTS WHERE GRADE1=’A’ OR GRADE2=’A’;
Give the output of the following SQL Statements
(ii) SELECT MAX(Name) FROM SPORTS;
Veena
(iii) SELECT GAME1,COUNT(*) FROM SPORTS GROUP BY Game1;
CRICKET 2
TENNIS 2
SWIMMING 1
BASKETBALL 1

Page 5 of 11
27 Write a python program to draw a bar chart with the following information: 3

Birds Population
Peacock
2600
Parrot
3000
Mona 1000
Flycatcher 5000

Crow 1200

The barchart should have the following features:


a) X-axis label should be ‘Birds’ and Y-axis label should be
‘Population’
b) The title of the chart should be ‘Bird Population’
c) The Graph should be saved with name “Birds.png”
Use proper import statements in the program.
import matplotlib.pyplot as plt
Birds=[‘Peacock’, ‘Parrot’, ‘Mona’, ‘Flycatcher’, ‘Crow’]
Population=[2600,3000,1000,5000,1200]
plt.bar(Birds,Population)
plt.xlabel(‘Birds’)
plt.ylabel(‘Population’)
plt.title(‘Bird Population’)
plt.savefig(‘Birds.png’)
plt.show()

OR
Write a python program to draw a histogram with following information:
10 15 10 10 15 10 20 20 20 20 20 25 25
The histogram should have following information
a) X-axis label should be “Score” and Y-axis should be “Frequency”
b) The title should be “Frequency of Score”
c) The Graph should be saved with name “Score.png”
Use proper import statements in the program
import matplotlib.pyplot as plt
Score=[10,15,10,10,15,10,20,20,20,20,20,25,25]
plt.hist(Score)
plt.xlabel(‘Score’)
plt.ylabel(‘Frequency’)
plt.title(‘Frequency of score’)
plt.savefig(‘Score.png’)
plt.show()

Page 6 of 11
28 Based on table STUDENT given here, write suitable SQL queries for the 3
following:

Roll No Name Class Gender City Marks


1 Abhishek XI M Agra 430
2 Prateek XII M Mumbai 440
3 Sneha XI F Agra 470
4 Nancy XII F Mumbai 492
5 Himnashu XII M Delhi 360
6 Anchal XI F Dubai 256
7 Mehar X F Moscow 324
8 Nishant X M Moscow 429

(i) Display gender wise highest marks.


SELECT GENDER,MAX(MARKS) FROM STUDENT GROUP
BY GENDER;
(ii) Display city wise lowest marks.
SELECT CITY, MIN(MARKS) FROM STUDENT GROUP BY CITY;
(iii) Display total number of male and female students.
SELECT GENDER,COUNT(*) FROM STUDENT GROUP BY GENDER;

29 Mr. Anderson is a software developer who spend most of the time with computers. 3
Give him two advises to avoid health issues due to excess use of computers.
You can help avoid computer-related injuries with proper furniture, better posture and
good working habits. Parents should put sensible time limits on their children's computer
use and video-game playing. Your child should take regular breaks from using a
computer and should do some physical activities each day.
(ii) Briefly explain Intellectual Property Rights.
Intellectual property rights (IPR) refers to the legal rights given to the inventor or
creator to protect his invention or creation for a certain period of time.
OR
(i) Which of the following comes under Cyber Crime and Why:
a) Theft of a brand new sealed laptop
b) Access to a bank account for an unauthorized money transaction
c) Photocopying a printed confidential report
d) Modification in a company’s data with unauthorized access
(ii) Name any two measures to recycle e-waste.
1. Postpone upgrading for as long as you can. Think twice about getting
your phone or other devices upgraded.
2. Find opportunities for reuse.
3. Try returning the item to the manufacturer.
4. Take them to a dedicated e-waste recycling facility.
30 Consider the above given dataframe MARKS and write Python code for the 3
Following:

MATHS SCIENCE
SMITH 12 11
BIKRAM 16 17
CHANDAN 20 19

i. Add a new record of Daman with elements 18 & 19


MARKS[‘Daman’]=[18,19]
ii Delete column SCIENCE permanently from Dataframe.
MARKS.drop(‘SCIENCE’, axis=1,inplace=’True’)
iii. Display the records of those students who have scored more than 15
marks in MATHS subject.
print(MARKS[MARKS[‘MATHS’]>15])

SECTION – D

Page 7 of 11
31 4
Consider the EMPLOYEES table having the following records.

+----+------------+-------+-----------+----------+--------------+
| ID | NAME | AGE | ADDRESS | SALARY |
+----+------------+-------+-----------+----------+--------------+
| 1 | Ramesh | 32 | Ahmedabad | 2000.00 |
| 2 | Khilan | 25 | Delhi | 1500.00 |
| 3 | kamlesh | 27 | Kota | 2000.00 |
| 4 | Chaitali | 25 | Mumbai | 6500.00 |
| 5 | Hardik | 27 | Bhopal | 8500.00 |
| 6 | Komal | 22 | MP | NULL |
| 7 | Muffy | 22 | Indore | 10000.00 |
Write SQL Query for:-
i) To delete the record of the employee(s) whose salary is between
2000 and 8000.
DELETE FROM EMPLOYEES WHERE SALARY BETWEEN 2000
AND 8000;
ii) To display employees having salary more than 5000 in
descending order of age.
SELECT * FROM EMPLOYEES WHERE SALARY>5000
ORDER BY AGE DESC;
iii) To display details of all employees having defined salary (i.e
salary is known).
SELECT * FROM EMPLOYEES WHERE IS SALARY IS NOT
NULL;
iv) Increase the salary of the employees living in Delhi and Mumbai
city by 10%.
UPDATE EMPLOYEES SET SALARY=SALARY*1.10 WHERE
ADDRESS IN(‘DELHI’,’MUMBAI’);
OR
What will be the result of the SQL Query:-
i) Select Name from employees where Address like ‘_ _ m%’;
Ramesh
Chaitali
ii) Select Age, Sum(Salary) from employees group by Age;
32 2000
25 8000
27 10500
22 10000
iii) Select Salary, Salary*0.1 As “Bonus” from employees;
Salary Bonus
2000 200
1500 150
……. ……..
iv) Select “Mr./Mrs” , name from employee where salary is NULL;
Mr./Mrs Komal

Page 8 of 11
32 Ekam, a Data Analyst with a multinational brand has designed the DataFrame df
that contains the four quarter’s sales data of different stores as shown below:
Store Qtr1 Qtr2 Qtr3 Qtr4
0 Store1 300 240 450 230
1 Store2 350 340 403 210
2 Store3 250 180 145 160
Answer the following questions:
i. Predict the output of the following python statement: 2
a. print(df.size)
15
b. print(df[0:2]) 1
Store Qtr1 Qtr2 Qtr3 Qtr4
0 Store1 300 240 450 230 1
1 Store2 350 340 403 210
ii. Delete the last row from the DataFrame.
df.drop(2)
iii. Write Python statement to add a new column Total_Sales which is the
addition of all the 4 quarter sales.
df[‘Total_Sales’]=df.Qtr1+ df.Qtr2+ df.Qtr3+ df.Qtr4
OR
(Option for part iii only)
Write Python statement to export the DataFrame to a CSV file named data.csv
df.to_csv(“data.csv”)

SECTION – E
33 What will be the output of the following: 5
import pandas as pd
arr = [100,200,300, 400,150, 160, 170]
s=pd.Series(arr)
i) print(s.tail())
6 170
ii) print(s.loc[3:5])
3 400
4 150
5 160
iii) print(s.iloc[:3])
0 100
1 200
2 300
iv) print(s.ndim)
1
v) print(s[0:6:3])
0 100
3 400

Page 9 of 11
34 Ayurveda Training Educational Institute is setting up its centre in Hyderabad with four 5
specialised departments for Orthopedics, Neurology and Pediatrics along with an
administrative office in separate buildings. The physical distances between these
department buildings and the number of computers to be installed in these
departments and administrative office are given as follows. Answer the queries as
raised by them in (i) to (v).

Shortest distances between various locations in metres :

Number of Computers installed at various locations are as follows :

a) Suggest the most suitable location to install the main server of this
institution to get efficient connectivity.
Administrative office
b) Suggest the best cable layout for effective network connectivity of the
building having server with all the other buildings.

c) Suggest the devices to be installed in each of these buildings for


connecting computers installed within the building out of the
following : Gateway, switch, Modem

d) Suggest the topology of the network and network cable for efficiently
connecting each computer installed in each of the buildings out of
the following :
Topologies: Bus Topology, Star Topology
Network Cable: Single Pair Telephone Cable, Coaxial Cable, Ethernet Cable
e) The university is planning to connect its admission office in Delhi,
which is more than 1250km from university. Which type of network out of
LAN, MAN, or WAN will be formed? Justify your answer.

Page 10 of 11
35 Write the SQL functions which will perform the following operations. 5
Also give example:

a. Function to find the power of a number


POWER()- POWER(2,3) OUTPUT AS 8
b. Function to find the day of month of a given date
DAY()- DAY(“2024-01-24”) OUTPUT AS 24
c. Function to find the number of characters in a string.
LENGTH()- LENGTH(“INDIA SHINING”) OUTPUT AS 13
d. Function to remove trailing spaces from a string.
RTRIM()- RTRIM(“ HELLO ”) OUTPUT AS HELLO
e. Function to extract date part of date time string.
DATE()- DATE(“2024-01-24 12:15:18”) 2024-01-24

OR
Mr. Manav, a database administrator in “Global Educational and Training
Institute” has created following table named “Training” for the upcoming training
schedule:
Training
TrId Name Gender Topic City Fee
ND01 Rajan M Cyber Security New Delhi 10000
GU01 Urvashi F ICT in Education Guru gram 15000
FD01 Neena F Cyber Security Faridabad 12000
ND02 Vinay M ICT in Education New Delhi 13000
GU02 Naveen M Cyber Crime Guru gram NULL

Help him in writing SQL query for the following purpose:


i. To count how many female candidates will be attending the training.
SELECT GENDER,COUNT(*) FROM TRAINING GROUP BY
GENDER;
ii. To display list of free trainings.(where the fees is not known)
SELECT TOPIC FROM TRAINING WHERE FEE IS NULL;
iii. To display all the cities where Cyber Security training is scheduled
along with its fee.
SELECT CITY,FEE FROM TRAINING WHERE TOPIC=”CYBER
SECURITY”;
iv. To find the total fees paid by trainees gender-wise.
SELECT GENDER,SUM(FEE) FROM TRAINING GROUP BY
GENDER;
v. List the Trainee(s) who is having 5 characters in his/her name.
SELECT NAME FROM TRAINING WHERE LENGTH(NAME)
=5;
Alternative answer
SELECT NAME FROM TRAINING WHERE NAME) LIKE “_ _ _
_ _” ;

Page 11 of 11

You might also like