CS QP
CS QP
(i)
Instructions :
This question paper
(ii) contains 37 questions.
a questions are compulsory. However, internal
provided in some guestions Altemnt only one of thechoices
have been
choices in such
questions.
(iii) The paper is divided into 5
Seetions -A, B, C, D and E.
(0) Section A, consists of 21 oustions (1 to 21).
Imark. Each question carries
(U) Section B, consists of 7 guestions (22 to 28). Each
2 marks. question carries
(UL) Section C, consists of 3 questions (29 to 31).
Each question carries
3 marks.
(uii) Section D, consists of 4
questions (32 to 35). Each question carries
f marks.
(viii) Section E, consists of 2 questions (36 & 37).
5 marks.
Each question carries
(ix) All programming questions are to be answered using Python
only. Language
() In case of MCQs, lext of the correct answer should also be written.
4
Which of the following is the correct
identifier ?
(A) global (B) Break
(C) def (D) with
9.
While creating a table, which constraint does not allow insertion of
duplicate values in the table?
(A) UNIQUE (B) DISTINCT
(C) NOT NULL
(D) HAVING
10
Consider the statements given below and then choose the correct output
from the given options :
def Change (N):
N=N+10
print (N, end='$$')
N=15
Change (N)
Print (N)
(A) 25$$15 (B) 15$$25
(C) 25$$25 (D) 2525$$
11. Consider the statements given below and then choose the correct output
from the given options:
N='5'
try:
print ('WORD' + N, end='#')
except:
print ('ERROR' , end='#")
finally:
print('OVER' )
(A) ERROR# (B) WORD5|OVER
(C) NORD5# (D) ERROR#OVER
91 Page 7 of 32 P.T.0.
12. Which of the following built-in function/method returns a dictionary ? 1
(A) dict () (B) keys ()
(C values () (D) items ()
14. Which aggregate function in SQL displays the number of values in the
specified column ignoring the NULL values ?
(A) len () (B) count ()
(C) number () D) num ()
If table A has 6 rows and 3 columns, and table B has 5 rows and
2 columns, the Cartosian product of A and B will have 30 rows and
5 columns.
Q. Nos. 20 and 21l are Assertion (A) and Reason (R) ba sed
questions. Mark
the correct choice as
(A) Both Assertion (A) and Reason (R) are true and
Reason (R) is the
correct explanation for Assertion (A).
(B) Both Assertion (A) and Reason (R) are true and Reason (R)
is not the
correct explanation for Assertion (A).
(C) Assertion (A) is true but, Reason (R) is false.
(D) Assertion (A) is false but, Reason (R) is
true.
20. Assertion (A) : For a binary file opened using rb mode, the
pickle.dump () method will displav an error
Reason (R) : The pickle.dump () method is used to read from a
binary fle.
21, Assertion (A) : We can retrieve records from more than one table in
MYSQL.
Reason (R) Foreign key is used to establish a relationship between
two tables.
91 Page 1l of 32
P.T.0,
SECTION - B (7x 2 = 14)
22. What does the return statement do in a function ? Explain with the help
of an example. 2
25. What possible output Erom the given options is expected to be displayed
when the following code is executed ? 2
import random
Cards=["Heart","Spade","Club","Diamond"]
for i in range (2) :
Print (Cards (random. randint (1, i+2) ] , end="#")
(A) SpadeDiamond# (B) Spade#Heart#
(C)
Diamond#club# (D) Heart#Spadet
91 Page 13 of 32 P.T.0.
26
The code given below accepts N as an integer argument and returns the
sum of all integers from 1 to N. Observe the following code carefully and
rewrite it after removing all syntax and logical errors. Underline all the
Corrections made.
def Sum (N)
for I in range (N) :
S=S+I
return S
(ii) display all (myStack) : The function should display all the
elements of the stack myStack, without deleting them. If the
stack is empty, the function should display the message
'Empty Stack'.
count = 0
fox i in nystr:
if count$2 ! 0:
P.T.0.
Page 19 of 32
G
Ll=(]
L2=[]
Change (D)
print(L1)
print (L2)
Print (D)
(1x 4= l6)
SECTION- D
to
WORKER with a set of records
created a table named
32. Suman has sites, which consists
of WID,
of the
construction
maintain the data creating the table,
TYPE, and SITEID. After
WAHE WAGE, HOURS,
she entered data in it, which is as follows :
TYPE
SITEID
WID WNAME WAGE HOURS
200 Unskilled 103
wO1 Ahmed J 1500
100 Skilled 101
W11 Naveen 520
101
WO2 Unskilled
Jacob A 780 95
Semiskilled NULL
Nihal K 560 110
W10
Skilled 103
|Anju 1200 130
91 P.T.0.
Page 21 of 32
Based on the data given above, answer the
(a)
(i) Write the SQl statement to following questions
display the names and
hase workers whose Wages are between 800 and 1500 wages of
..Write the SQl. statement to display the record of workers
know.
whose SITEID is not
:y Wite the SQL. statement to display WNAME, WAGE and HOURS of
all those workers whose TYPE is Ski1led:
bv) Write the SQl. stutement to change the WAGE to 1200 of the
workers where the TYPE is "Semiskilled".
OR
Considering the above given table WORKER, write the output on
commands:
execution of the following SQL
SELECT WNAME, WAGE*HOURS FROM WORKER WHERE
SITED 103;
WORKER:
(ii) SELECT COUNT (DISTINCT TYPE) FROM
(iii) SELECT AX (WAGE), MIN (WAGE), TYPE FROM WORKER
GROUP BY TYPE:
FROM WORKER WHERE
(iv) SELECT WNAME, SITEID BY HOURS;
TYPE="Unskilled" ORDER
Table : Artists
Email DOB
A Code Name Phone
----
Field TYpe
char (5)
Th ID
varchar (15)
iName varchar (15)
City
Location varchar (15)
Seats
| int
Th ID from
wWeite a function Delete Theatre (), lo input the value of
corresponding record from the table
be user and permanently delete the
Python-Database connectivity:
Assume the following for
Password: Ex2025
Host : local host, User: root,
SECTION - E (2 x 5= 10)
where : type)
PNR Passenger Number (string
type)
PName Passenger Name (string
(string type)
BRDSTN Boarding Station Name
(string type)
DESTN Destination Station Name
journey (float type)
FARE Fare amount for the
following tasks :
Write user defined functions in Python for the binary
for passengers and write it in the
(i) Create () to input data
file PASSENGERS.DAT.
from the file PASSENGERSDA
eatchDestn (D) - to read contents matches
of those Passengers whose DESTN
splay the details
with the value ofD. by 5%
and
passengers
(i)) to increase the fare of
all
UpdateFare()-
wte the updated records into the file
PASSENGERS.DAT.
91 P.T.0.
Page 27 of 32
Swabhaav' is a
big NGO working in the field of
Nagpur.Psychol
It isogical Treat rnent
Head ofce
37 Counselling. having its in
up a center in
Vijayawada. "The
PSYCHIATRY.
Vijavawada Center will have four blocks -planning to set
ADMIN, PSYCHOLOGY, and ICU. You, as a
Expert. need to
suggst the best Network
network-related solutions for then
D h issues/problems mentioned in questions (i) to
to (v), keening the
following paranneters in mind
5x1=5
ADMIN
PSYCHOLOGY
Block Block
Vijayawada Center
PSYCHIATRY ICU
Block Block
PSYCHIATRY ICU 50 m
PSYCHOLOGY ICU 50 m
Distance of Nagpur Head Offee fron Viuvawada Center = 700 km
Number of Computers in each block is as tollows :
Block No. of Computers
ADMIN 16
PSYCHIATRY 4C
PSYCHOLOGY 19
TCU
20
91 P.T.0.
Page 29 of 32
of the server inside the
Suuggest the most apPpropriate location
choice.
(i)
Viiayawada Center. Justify your
hardware device will you suggest to connect all the
(ii)
Which Vijayawada Center 2
each block of
computers within
efficiently connect various blocks within the
Gii) Draw acable layout to
Vijayawada Center.
placed to provide internet to all the
be
iv) WVhere should the router
the Vijayawada Center ?
computers in access the computer
wants to remotely
at Nagpur be used for
(v) (a) The Manager Vijayawada. Which protocol will
in Admin block in
this ?
OR
LAN, MAN or WAN) will be set
(PAN,
(b) Which type of Network connected with Vijayawada Center?
computers
up among the