0% found this document useful (0 votes)
46 views16 pages

XII Sample Paper Complete Syllabus-1 Answer Key

Ghn

Uploaded by

santro9776
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views16 pages

XII Sample Paper Complete Syllabus-1 Answer Key

Ghn

Uploaded by

santro9776
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Part – A

Section – I
Attempt any 15 questions from questions 1 to 21
1. Which is not valid for Series Data Structure? 1
a) Series uses data as scaler values.
b) We cannot create empty Series object.
c) Series can be created using dictionary.
d) Series can be created using list of integers.

2. Choose correct statement for Series Data Structure 1


a) It is two dimensions.
b) It is only one dimension.
c) It can be one dimension or 2 dimensions.
d) It can have any dimension.

3. Write Python code to import required module for plotting. 1

Ans: import matplolib.pyplot as plt

4. Which of the following is not a valid plotting function of pyplot? 1


a) bar( )
b) hist( )
c) histh( )
d) barh()

5. Given a Pandas series called S, the command which will display the last 4 rows is . 1
a) print(S.tail(4))
b) print(s.Tail())
c) print(s.tails(4))
d) print(s.tail(4))

6. The network device which is used to avoid the loss of signals in case of long 1
distances is called .
a) Router
b) Repeater
c) Modem
d) Bridge

7. Write the output of the following SQL command: 1


Select round(6758.3874,2);
Ans:
+--------------------+
| round(6758.3874,2) |
+--------------------+
| 6758.39 |
+--------------------+

8. Network topology which has a centralized control of all nodes connected in the network 1
is_________.
a) Tree topology
b) Mesh Topology
c) Star topology
d) Bus Topology

9. When you visit a website, a small text file called ............. is stored on your computer that 1
keeps track of your visits and activities on a specific website.
Ans: Cookie

10. Which of the following is a broadcast device? 1


Bridge, Gateway, Hub, Switch
Ans :Hub

11. All of us have some discarded electronic devices like Television, PC, mobile phones 1
etc. at our home / office. What is the most suitable term to refer them?

Ans: Electronic Waste

12. The max() function in MySQL is an example of ................................... 1


a) Math Function
b) Text Function
c) Date Function
d) Aggregate Function

13. Manish wants to select all the records from a table named “Students” where the value of 1
the column “FirstName” ends with an “a”. Which of the following SQL statement will
do this?
a) SELECT * FROM Students WHERE FirstName = “a”;
b) SELECT * FROM Students WHERE FirstName LIKE “a%”;
c) SELECT * FROM Students WHERE FirstName LIKE “ %a”;
d) SELECT * FROM Students WHERE FirstName = “%a%‟;

14. T20 match analysis in Dubai is to be plotted. The command used to give title to y-axis as 1
‘Total Score’ of each team in a graph is ............. .
a) plt.show()
b) plt.plot("Total Score")
c) plt.ylabel("Total Score")
d) plt.title("Total Score")

15. Write the output of the following SQL command. 1


Select round(67834.238,-3);
a) 68000
b) 67000
c) 67834.000
d) 70000

16. A set of rules that governs data communication in computer networks is called________. 1
a) Topology
b) Protocol
c) Domain Name Resolution
d) Network Security

17. Fill in the blanks : 1


The ______command can be used to modify structure of a table in SQL.
Ans: alter table

18. Fill in the blanks : 1


_______protocol is used to send email messages over the internet.
Ans: SMTP—Simple Mail Transfer Protocol

19. Fill in the blanks : 1


_____________is a term referring to a brand, invention, design or other kind of creation
which a person or business has legal rights over.
Ans. Intellectual Property (IP)

20. Fill in the blanks : 1


Pyplot’s ___________function is used to create line charts.
Ans:plot()

21. Write output of following code: 1


import pandas as pd
data = [['Ram',10],['Shyam',12],['Rima',13]]
df = pd.DataFrame(data,columns=['Name','Age'],dtype=float)
print( df)

Ans:
Name Age
0 Ram 10.0
1 Shyam 12.0
2 Rima 13.0
Part A
Section -II

Both the case study-based questions (22 & 23) are compulsory. Attempt any four sub parts
from each question. Each sub question carries 1 mark.

22. Assume a data frame df1 that contains data about climatic conditions of various cities with
C1, C2, C3, C4 and C5 as indexes shown below and give the output of any four
questions from a) to e)
City MaxTemp MinTemp RainFall
C1 Delhi 40 32 24.1
C2 Bengaluru 31 25 36.2
C3 Chennai 35 27 40.8
C4 Mumbai 29 21 35.2
C5 Kolkata 39 23 41.8

a) df1.shape 1

Ans: (5,4)

b) df1[1:2] 1

Ans:
City MaxTemp MinTemp RainFall
Bengaluru 31 25 36.2

c) df1.loc['C1':'C3','City'] 1

Ans:
C1 Delhi
C2 Bengaluru
C3 Chennai

d) df1.iloc[2] 1

Ans:
City Chennai
MaxTemp 35
MinTemp 27
RainFall 40.8

e) df.city 1

Ans:
Delhi
Bengaluru
Chennai
Mumbai
Kolkata
23. Consider the following table given below:
Table: PharmaDB
RxID DrugID DrugName Price Pharmacy Name PharmacyLocation
R1000 5476 Amlodipine 100.00 RxPharmacy Pitampura,Delhi
R1001 2345 Paracetamol 15.00 RajMedicos Bahadurgarh,Haryana
R1002 1236 Nebistar 60.00 MyChemist Rajouri Garden,Delhi
R1003 6512 VitaPlus 150.00 MyChemist Gurgaon,Haryana
R1004 5631 Levocitrezine 110.00 RxPharmacy SouthExtension,Delhi

a) To increase the price of “Amlodipine” by 50. 1


Ans:
Update PharmaDB set price= price+50 where DrugName=“Amlodipine”;

b) To display the Drug ID, Drug Name and Pharmacy Name of all the records in descending 1
order of their price.
Ans:
Select DrugID, DrugName, PharmacyName from PharmaDB order by Price desc;

c) Delete the field name DrugId. 1


Ans:
Alter table PharmaDB DROP dateofpurchase;

d) State the command to display all the details of the drugs where the name starts with ‘M’ 1
and has ‘Ch’ somewhere in the name.
(i) Select * from PharmaDB where DrugName LIKE "M%ch%;
(ii) Select * from PharmaDB where DrugName LIKE "m_ch%";
(iii) Select * from PharmaDB where DrugName LIKE "m ch%";
(iv) Select * from PharmaDB where DrugName LIKE "%ch%m"
Choose the correct option:
(a) Only (i) (b) Both (ii) and (iv)
(c) Both (i) and (iii) (d) Only (iii)
Ans. (a) Only (i)

e) Help Sachin to display drugname in capital letters along with price rounded off to 1
nearest integer.
(i) select upper(DrugName), round(Price,0) from PharmaDB;
(ii) select toupper(DrugName), round(Price,0) from PharmaDB;
(iii) select upper(DrugName), truncate(Price,0) from PharmaDB;
(iv) select DrugName, round(Price,1) from PharmaDB;
Ans:
(i) select upper(DrugName),round(Price,0)from PharmaDB;

Part - B
Section – I
24. Consider two objects A and B. A is a List whereas B is a Series. Both have values 2
30,40,50.60.
a) print(A+ 2)
b) print(B +2)
What will be the output of the following two statements considering that the above objects
have been created Justify your answer.
Ans:
a) TypeError: can only concatenate list (not "int") to list
b) 0 32
1 42
2 52
3 62
dtype: int64

In the first case, adding integer value to a list is not permitted. You can add list to another
list but not an integer value to a list. This is because list does not allow broadcasting
operation, i.e., performing arithmetic operation to each element is not permitted.

But in second case, series can very well implement broadcasting operation. Thus, adding an
integer value to pandas series is permitted and is perfectly fine; hence the output is so
obtained.
1 Mark for correct output for both parts & 1 Mark for explanation

25. Write two measures to be adopted to manage digital footprints. 2

Ans:
1- Double-check privacy settings, don't trust unsafe sites( sites without https prefix)
2- Create strong and memorable passwords.
3- Review the mobile usage, delete unwanted and obsolete(.tmp-temporary) files from
your device.
4- Keep all the softwares up to date.
2 marks for any of the 2 measures correctly explained

26. Considering the string str as “Corporate world”. 2


Write SQL commands to display:
a) the position of the substring ‘or’ in the string “Corporate world”
b) the last 4 letters of the string
Ans:
a) Select instr(“Corporate world”,”or”);
b) Select right(“Corporate world”,4);

2 marks for correct output

27. State any two differences between instr() and substr() functions in SQL with examples. 2
OR

What is the difference between where and having clause when used along with the select
statement. Explain with an example.

Ans:
INSTR function searches string for sub-string and returns an integer indicating the
position of the character in string that is the first character of this occurrence whereas
SUBSTR function returns a portion of string, beginning at character position,
substring_length characters long.
For example,
select instr(“India is my country”,‘my’);
Output->10
Select substr(“We are indians”,4,3);
Output -> are

1 Mark for correct difference & 1 Mark for correct example

OR
WHERE is used to filter records before any groupings take place whereas HAVING is used
to filter values after they have been groups.
For example, select * from student where marks>85;
For example, select stream, avg(marks) from student group by stream having stream IN
(“Commerce”,”Humanities”);
1 Mark for correct difference & 1 Mark for correct example

28. Gunjan has entered the following SQL command on Table ‘Result’ that has TotalMarks as 2
one of the columns:
SELECT count(TotalMarks) from RESULT;
The output displayed is 43.

Then, Gunjan enters the following command:


Select count(*) from RESULT;
Now the output displayed is 50.
What could be the possible reason for different outputs? How many total records are there
in the table Result?

Ans.
count(TotalMarks) counts all the rows present in a column excluding Null values.
The output is 43 as Null values are not counted, so there are 7 rows that have NULL
values (50-7=43). Whereas count(*) counts the total number of rows in a column
including Null values;
that is why the output returns 50.
So there are total 50 records in the table Result.

2 Marks for correct explanation.

29. Consider the variable var having value 5649.7438 Write the SQL statement to: 2
a) round it off to 02 decimal places.
b) round it to 02 places before the decimal.

Ans.
a) select round(5649.7438 ,2);
b) select round(5649.7438 ,-2);
OR
What will be the output of the following SQL Statements:
a) Select instr(“This is my wrist watch”,“is”);
b) Select right(“Informatics Practices”,5);
Ans:
a)
+--------------------------------------+
| instr("This is my wrist watch","is") |
+--------------------------------------+
| 3 |
+--------------------------------------+
b)
+----------------------------------+
| right("Informatics Practices",5) |
+----------------------------------+
| tices |
+----------------------------------+
1 mark each for correct output

30. Expand the following terms related to Computer Networks: 2


a) MAC
b) TCP
c) HTTP
d) IPv6

Ans:
a) Media Access Control
b) Transmission Control Protocol/Internet Protocol
c) Hypertext Transfer Protocol Secure
d) Internet Protocol version 6
0.5 marks for each correct full form

31. Rinku writes the following commands with respect to table sales having fields itemno, 2
iname, sales_made, commission.
Command1 :
Select sum(sales_made) from sales;
Gives Output as: 1200
Command2:
Select avg(sales_made) from sales;
Gives Output as: 300
What will be the cardinality of the table if there is no NULL value for sales_made?
Also give the command to find out the no. of rows in this table.

Ans:
The cardinality of the table sales is: 4 since 1200/300 =4
Select count(*) from sales;
2 Marks for correct explanation.

32. Deepanjali received an SMS from her bank querying a recent transaction that she made 2
online and asking for the pin number.
Answer the following questions as to what she should do on receiving this SMS.
a) Should she SMS her pin number to the given contact number?
b) Should she call the bank helpline number to recheck the validity of the SMS received?

Ans.
a) No, she should not respond to the message. If she responds by sending her pin number,
then there is an absolute chance of her bank account being hacked, which can result
in a huge financial loss to her.
b) Yes, she should call the bank helpline number to check the validity of the SMS
received as this is an act of cybercrime.
2 Marks for correct explanation.

33. A dictionary ‘toys’ contains the following: 2


toys={‘Name’:[ ‘Talking Tom’, ‘Blocks’,‘Number game’, ‘ludo’],
‘Price’:[ 400,250, 300,150] }
Write statements for the following:
a) Create a Dataframe named “stock” & Add a column called ‘discount’ with the
following data: [ 30, 40, 15, 25]
b) Delete column discount with all values.

Ans.
a) stock= pd.DataFrame(toys)
stock[“discount”]=[30,40,15,25]
b) stock.drop(“discount”, axis=1)

1 mark for each correct output


Part B
Section – II
34.
Consider the following dataframe and answer the following questions: 3

Code Item DatePurchase UnitPrice Discount


A21 Frock 2016-01-23 700 10
B26 Cot 2015-09-23 5000 25
B35 Soft Toy 2016-06-17 800 10
C80 Baby Socks 2014-10-16 100 7
A30 Baby Suit 2015-09-20 500 5

a) Write a program to create the above mentioned dataframe using the index values as
10,20,30,40 and 50.
b) Write code to insert a column named “Vname” to store the following vendor names-
Godrej, P&G, Godrej, Tata, Godrej ( corresponding to every row)
c) Write a command to insert a column named “color” with the following values
['red','blue','green','red','orange'] at the 4th column position ( column index =3)

Ans:
a) import pandas as pd
dict1={'icode':['a21','b26','b35','c80','a30'],
'item':['frock','cot','soft toy','baby socks','baby suit'],
'dp':['2016-01-23','2015-09-23','2016-06-17','2014-10-16','2015-09-20'],
'up':[700,5000,800,100,500],
'disc':[10,25,10,7,5]}
item1=pd.DataFrame(dict1,index=[10,20,30,40,50])
print(item1)
b) item1['vname']=['Godrej','P&G','Godrej','Tata','Godrej']
c) item1.insert(loc=3,column='color',value=['red','blue','green','red','orange'])

1 mark each for correct output


35. What will be the output of the following code? 3
import matplotlib.pyplot as p
city=["Delhi","Mumbai","Bengaluru","Kolkata"]
accident=[60,40,55,30]
p.bar(city,accident, color="orange", edgecolor="black")
p.title('Accident Tally of 4 Metropolitan cities')
p.xlabel('City')
p.ylabel('Accidents')
p.show()

Ans:

3 Marks will be awarded if colour is mentioned along with labels and title.

OR

Write code to plot the following graph:


Ans:
import matplotlib.pyplot as plt
import pandas as pd
dict1={'name':['Riya','Rishabh','Isha','David'],
'age':[15,18,20,12],
'gender':['F','M','F','M'],
'phy':[67,89,40,90],
'chem':[90,89,78,22],
'eng':[45,60,30,80]
}
df=pd.DataFrame(dict1,index=[100,101,102,103])
print(df)
a=df.name
b=df['phy']
c=df['chem']
d=df.eng
plt.plot(a,b)
plt.plot(a,c)
plt.plot(a,d)
plt.title("Mid Term Marks Comparison")
plt.xlabel("Names")
plt.ylabel("Marks")
plt.grid(True)
plt.show()

3 marks will be awarded if correct code is written.

36. Write the SQL functions which will perform the following operations: 3

a) To display the string (“information technology”) in Uppercase.


b) To remove spaces from the beginning and end of a string, “ Informatics ”.
c) To display the name of the day, e.g., Friday or Sunday from your date of birth, dob.
d) To display the starting position of your first name(fname) from your whole
name(name).
e) To compute the remainder of division between two numbers, n1 and n2.
Ans:

a) Select UPPER("information technology") ;


or
Select Ucase("information technology");
b) Select trim(" Informatics ");
c) Select dayname(date(dob));
d) Select instr(name, fname);
e) Select mod(n1,n2);

37. a) Ms Sheena has many electronic gadgets which are not usable due to outdated hardware 1
and software. Help her to find any one way to dispose the used electronic gadgets.
Ans.
i. Give Your Electronic Waste to a Certified E-Waste Recycler.
ii. Donate Your Outdated Technology.
iii. Give Back to the Electronic Companies and leave at Drop-off Points.
1 mark for any one correct valid point.

2
b) How is internet affecting one's daily life? Give one example each of positive and negative
aspects of internet.
Ans:
The internet is a global network of inter-linked networks that mainly provide wireless
interactive, communication. about 95% of all information available has been digitized and
made accessible via the internet. So it has affected and penetrated the society in the
following manner:
Positive Impact- It provides effective communication using emailing and instant messaging
services to any part of the world
Negative Impact- Addiction to social networks can disrupt an individual’s life, both
personally and professionally.

Part B
Section III
38. Consider the following table:

a) Create the dataframe using values from above table 1


Ans:

import pandas as pd
first={"Name":['Aman','Suman','Ravi','Kishan'],
"Term1":[354,423,315,335],
"Term2":[400,354,335,410]}
df=pd.DataFrame(first)
print(df)
1 mark for correct output

b) Add marks of both the terms of a Student and assign to column “Total” 2
Ans:
# Add marks of both the terms
df['Total']=df['Term1']+df['Term2']
df
1 mark for correct output

c) Replace the content of marks of Term 1 as 354 and Term2 as 423, keeping rest of 2
the data same for the Name “Suman” using iloc.

Ans:
df.iloc[1]=['Suman',354,423,777]
df
1 mark for correct output

39. Write the SQL functions which will perform the following operations.

a) To display the name of the month of the '2020-05-12' . 1


Ans:
select monthname('2020-05-12');

a) To remove spaces from the right hand side of a string, “Indian”. 1


Ans:

select rtrim('Indian "); iii)

b) To display the name of the day eg, Friday or Sunday from current date. 1
Ans:
select dayname(curdate());

c) To display the last name from your name. 1


Ans:
select right(name,number);

d) To compute the exponent of a given number i.e. m to the power n. 1


Ans:
e) select pow(4,3); or select power(4,3);

OR
Ashwini has her own studio where she has to maintain the details of the products. She
wants to use SQL to store the data. The details of the database are as follows:
 Name of the database – prodstore
 Name of the table- PRODUCTS
 The attributes of PRODUCTS are as follows:
o PID – numeric
o PNAME – character of size 30
o QTY – numeric
o PRICE – numeric
o COMPANY – character of size 30
o SUPCODE – character of size

PID PNAME QTY PRICE COMPANY SUPCODE


101 DIGITAL CAMERA 120 12000 RENIX S01
14X
102 DIGITAL PAD 11i 100 22000 DIGI POP S02
103 PEN DRIVE 16 GB 500 1100 STOREKING S01
104 LED SCREEN 32 70 28000 DISPEXPERTS S02
105 CAR GPS SYSTEM 60 12000 MOVEON S03

a) Identify the attribute best suitable to be declared as a Primary Key. 1


Ans:
PID is suitable for Primary Key
1 mark for correct answer

b) Write the degree and cardinality of the table PRODUCTS. 1


Ans:
Degree=6
Cardinality=5
1 mark for correct answer

c) Insert the following data into the attributes PID, PNAME and QTY with 1
the following values: PID=106, PNAME=IPAD, QTY=200.
Ans:
insert into products values(106,”IPAD”,200,NULL,NULL,NULL);
0.5 mark for correct insert and 0.5 mark for values
d) Now the PRICE of the product should increase by 500 of those products whose QTY is 1
more than 100.
Ans:
Update products set Price=price+500 where qty>100;
0.5 mark for correct update and 0.5 mark for where clause
e) How to display the contents of the table in the order of highest price to lowest price. 1
Ans:
select * from products order by price desc;
0.5 mark for correct select and 0.5 mark for order by clause
40. Cognizant technologies has set up their new center at Cochin for its office and web based
activities. They have 4 blocks of buildings named Block A, Block B, Block C and Block D.
Name of Block No. of Computers
Block A 25
Block B 50
Block C 125
Block D 10

Distance between the Blocks Block A to Block B


Block A to Block B 50 m
Block B to Block C 150 m
Block C to Block D 25 m
Block A to Block D 170 m
Block B to Block D 125 m
Block A to Block C 90 m
1
a) Suggest the most suitable place (i.e. block) to house the server of this organization
with a suitable reason.
Ans:
The most suitable place to install the server is Block C as this place has maximum
number of computers.

1
b) Suggest an ideal layout for connecting these blocks/centres for a wired connectivity.
Ans:

1
c) Which device will you suggest to be placed/installed in each of these blocks/centres
to efficiently connect all the computers within these blocks/centres?
Ans:
switch
1 mark for correct answer

1
d) The organization is planning to link its Block E situated in the same city. Which type of
network out of LAN, WAN, MAN can be considered?
Ans:
MAN
1 mark for correct answer

e) Suggest the placement of a Repeater in the network with justification.


Ans:
Repeater may be placed when the distance between 2 buildings is more than 70 metres,
i.e.,
Block B to Block C
Block A to Block D
Block B to Block D
1 mark for correct answer

You might also like