Professional Documents
Culture Documents
General Instructions:
(i) Please check this question paper contains 35 questions.
(ii) The paper is divided into 5 Sections- A, B, C, D and E.
(iii) Section A, consists of 18 questions (1 to 18). Each question carries 1 Mark.
(iv) Section B, consists of 7 questions (19 to 25). Each question carries 2 Marks.
(v) Section C, consists of 5 questions (26 to 30). Each question carries 3 Marks.
(vi) Section D, consists of 3 questions (31 to 33). Each question carries 5 Marks.
(vii) Section E, consists of 2 questions (34 to 35). Each question carries 4 Marks.
(viii) All programming questions are to be answered using Python Language only.
Q1. Which of the following symbols are used for comments in Python? [1]
(a) // (b) & (c) /**/ (d) #
Q2. Suppose str = “computer science with python”. What will be the output of
print(type(str))? [1]
(a) int (b) bool (c) string (d) str
Q3. The RDBMS terminology for a row is [1]
(a) Tuple (b) relation (c) attribute (d) degree
Q4. ________ spans over less than a Kilometer [1]
(a) MAN (b) LAN (c) WAN d) All of the above
Q5. The act which governs the cyber transactions in India is__________. [1]
(a) IT Act 2000 (b) IT Act 2008 (c) IT Act 2003 (d) None of these
Q6. A network device used to divide a single computer network into various sub-networks. [1]
(a) Router (b) Switch (c) Hub (d) Repeater
Q7. With SQL, how do you select all the records from a table named “Persons” where the value of the
column “FirstName” ends with an “a”? [1]
(a) SELECT * FROM Persons WHERE FirstName=’a’;
(b) SELECT * FROM Persons WHERE FirstName LIKE ‘a%’;
(c) SELECT * FROM Persons WHERE FirstName LIKE ‘%a’;
(d) SELECT * FROM Persons WHERE FirstName=’%a%’;
Q8. Which of the following is not a DDL command? [1]
(a) UPDATE (b) TRUNCATE (c) ALTER (d) None of these
Q9. To include the use of functions which are present in the random library, we must use the option: [1]
(a) import random (b) random.h (c) import.random (d) random.random
Q10. How many values can be returned by a function in Python? [1]
(a) 0 (b) 1 (c) more than one (d) 2
Q11. print (id(x)) will print_______. [1]
(a) Value of x (b) Datatype of x (c) Size of x (d) Memory address of x
Q12. Which of the following command is used to change the VALUES OF rows that already exist in a
table? [1]
(a) Insert (b) Union (c) Update (d) Select
(a) List the names of those students who obtained Division 1 sorted by NAME.
(b) Display a report, listing NAME, Stipend, Subject and amount of stipend received in a year
assuming that the Stipend is paid every month.
(c) Give the output of the following SQL statements based on table GRADUATE :
1. SELECT MIN(Average) FROM GRADUATE WHERE Subject= “Physics”;
2. SELECT SUM(Stipend) FROM GRADUATE WHERE Div=1;
Q31. Considering the following definition of dictionary MULTIPLEX, write a method in python to search
and display all the content in a pickled file CINEMA.DAT, where MTYPE key of the dictionary is
matching with the value "Comedy". [5]
MULTIPLEX = {'MNO': _____, 'MNAME": _____, 'MTYPE': _____}
OR
R =150
S= 100
R=Change(R, S)
print(R,"@",S)
S=Change (S)
(b) The books table of test database contains the records shown below:-
Title ISBN
Die to Live 78127873915
Again? 23686286243
Ushakaal 12678987036
Ushakiran 42568987036
What will be the output produced by following code:
import mysql.connector as sqltor
conn = sqltor.connect (host = "localhost", user = "learner",
passwd = "fast", database = "test")
cursor = conn.cursor()
Q34. Write SQL commands for the queries based on a table COMPANY and CUSTOMER. [4]
Table : COMPANY
CID NAME CITY PRODUCTNAME
111 SONY DELHI TV
222 NOKIA MUMBAI MOBILE
333 ONIDA DELHI TV
444 SONY MUMBAI MOBILE
555 BLACKBERRY MADRAS MOBILE
666 DELL DELHI LAPTOP
Table : CUSTOMER
CUSTID NAME PRICE QTY CID
101 ROHAN SHARMA 70000 20 222
102 DEEPAK KUMAR 50000 10 666
103 MOHAN KUMAR 30000 50 111
104 SAHIL BANSAL 35000 3 333
105 NEHA SONI 25000 7 444
106 SONAL AGRAWAL 20000 5 333
107 ARUN SINGH 50000 15 666
1) Identify the most appropriate Primary key for Tables COMPANY and CUSTOMER.
2) To display those company name which are having prize less than 30000.
3) To increase the price by 1000 for those customer whose name starts with S?
4) Delete the records from table customer whose name has KUMAR.
OR
4) Insert a new record in table COMPANY where CID : 777, Name : APPLE City KOCHI and
PRODUCTNAME is LAPTOP
Q35. Aradhana is creating a binary file student.dat that has structure (rollno, name, class, percentage). She
wrote a program to updating a record in the file requires roll number to be fetched from the user whose
name is to be updated. She has few doubts in the code. Help her to complete the task. She uses
intermediate file for working temp.dat
import______ # Statement 1
import os
f1=open(‘student.dat','rb')
f2=open(“temp.dat”,”______”) # Statement 2
r=int(input(“enter rollno which you want to search”))
try:
while True:
e = pickle.load(f1)
if e[0]==r: