Sample Paper 1 7
Sample Paper 1 7
1.This question paper contains two parts A and B. Each part is compulsory.
2.Both part A and part B have choices.
3. Part-A has 2 sections:
Table:COACH
Pcode Name Acode
1 Ahmed Hussain 1001
2 Ravinder 1008
3 Janila 1001
4 Naaz 1003
(i) To display the names of all activities with their Acodes in descending order. 1
(ii) To display sum of PrizeMoney for the Activities played in each of the Stadium 1
separately.
(iii) To display the coach’s names and Acodes in ascending order of Acode from the table 1
COACH.
(iv) To display the content of all activities for which ScheduleDate is earlier than 01-01- 1
2004 in ascending order of ParticipantsNum.
(v) Which column in Table:COACH is treated as Foreign key. 1
23 Consider the following DataFrame df and answer any four questions from (i)- (v)
a. df1=df[df[‘rollno’]==4]
print(df1)
b. df1=df[rollno==4]
print(df1)
c. df1=df[df.rollno=4]
print(df1)
d. df1=df[df.rollno==4]
print(df1)
(iii) 1
Which of the following statement/s will give the exact number of values in
each column of the dataframe?
i. print(df.count())
ii. print(df.count(0))
iii. print(df.count)
iv. print(df.count(axis=’index’))
Choose the correct option:
a. both (i) and (ii)
b. only (ii)
c. (i), (ii) and (iii)
d. (i), (ii) and (iv)
(iv) Which of the following command will display the column labels of the 1
DataFrame?
a. print(df.columns())
b. print(df.column())
c. print(df.column)
d. print(df.columns)
(v) Ms. Sharma, the class teacher wants to add a new column, the scores of Grade 1
with the values, ‘ A’, ‘B’, ‘A’, ‘A’, ‘B’, ‘A’
choose the command to do so:
a. df.column=[’A’,’B’,’A’,’A’,’B’,’A’]
b. df [‘Grade’]=[’A’,’B’,’A’,’A’,’B’,’A’]
c. df.loc[‘Grade’]= [’A’,’B’,’A’,’A’,’B’,’A’]
d. Both (b) and (c) are correct
Part-B
Section-I
This contain short answer questions of 2 marks each in which two questions
have internal options.
24 Given are two objects, a list object namely lst1 and a series object namely ser1, both 2
are having similar values i.e., 2,4,6,8. Find out the output produced by following
statements:
i)print(lst1*2) ii)print(ser1*2)
OR
Consider the below given two code fragments. Will they produce the same output?
Why/why not?
i)fst=[9,10,11] ii)fst=pd.Series(data=[9,10,11])
ob1=pd.Series(data=fst*2) ob2=pd.Series(data=fst*2)
print(ob1) print(ob2)
25 Give difference between char and varchar. 2
OR
Sivani is working in MySQL.Differentiate her between the Where and having
clause
26 As a citizen of india, what advise you should give to others for e-waste disposal? 2
27 Write command to create given table. 2
Columne Type SIZE Constraint Description
38 5
drinkcode dname price calories
101 lime and lemon 20.00 120
102 apple drink 18.00 120
103 nature nectar 15.00 115
104 green mango 15.00 140
105 aam panna 20.00 135
106 mango juice 12.00 150
v)To add column quantity data type int size 3.
OR
i) Write query to concat drinkcode and dname as drinkcodename having price
of Rs.20 of above table.
ii) Display drink name of above table in capital letters.
iii) Write query to remove leading spaces of string ‘ kendriya’.
iv) Display the position of occurance of string ‘OL’ in string
“rollnoinschool”. v)Display institute code “uss” from string “uss/23/67/09”.
Block A 25
Block B 50
Block C 125
Block D 10
Shortest distances between various blocks in meters:
Block A to Block 60m
B
Block B to Block 40m
C
Block C to Block 30m
A
Block D to Block 50m
C
(i) Draw layout for given setup.
(ii) Suggest the most suitable place to house the server with suitable reason.
(iii)The company is planning to link all the blocks through a secure and high speed
wired medium. Suggest a way to connect all the blocks.
(iv)Suggest the type of network to connect all the blocks with suitable reason.
(v)Company wants to protect their connection from outside network suggest
hardware/software for given purpose.