MSSC -CS QP
MSSC -CS QP
General Instructions:
All questions are compulsory. However, internal choices have been provided
my_dict={‘X’:48,’XI’:50,’XII’:89}
A. my_dict.get(48)
B. my_dict.get('X')
C. my_dict.update({'XII':95})
D. my_dict.pop()
3 1
Which SQL command can change the cardinality of an existing relation?
A. ALTER
B. UPDATE
C. INSERT INTO
D. SELECT
4 What will be the output of the following code? 1
A='ncert.nic.in'
print(A.title())
A. 'Ncert.Nic.In'
B. 'Ncert.nic.in'
C. 'NCERT.NIC.IN'
D. ‘Ncert.Nic.IN’
5 Identify the output of the following code snippet: 1
2**2+5**2+10//2.0
A. 34
B. 34.0
C. 19
D. 19.0
A. 15#5$21
B. 15#5$15
C. 15#5$20
D. 16#4$21
A='MSSC - MDU'
b=A.split('S')
print(b)
tables.
A) Telephone network.
B) Internet.
D) Wi-Fi networks.
15 Which of the following data types is more efficient in terms of storage when 1
the length of the string is highly variable?
A) CHAR
B) VARCHAR
C) TEXT
D) DATE
16 Which of the following is true about the with open() statement in Python? 1
Reason (R): A default argument is used only when the caller does not
provide a value for that argument.
Q No. Section-B (7 x 2 = 14 Marks) Marks
22 What advantages do tuples have over lists? 2
23 Difference between identity operator and membership operator. Give some 2
examples.
24 If D1={‘Rollno’:’A12’,’Class’:12,’Gender’:’F’} and 2
D2={‘Grade’:’A’,’Mark’:450}
I) Find the output from the following code:
a) A=D1.get('12','Class') What is the value of A?
b) B=D1.popitem() What is the value of B?
OR
II) If L1=[1,2,3,2,1,2,4,2, . . . ], and L2=[10,20,30, . . .], then
a) Write a statement to insert all the elements of L2 at the end of
L1.
b) Write a statement to sort the elements of list L1 in ascending
order.
25 Identify the incorrect output(s) of the following code. Also write the minimum 2
and the maximum possible values of the variable b.
import random
City=['Chennai','Madurai','Trichy','Coimbatore']
pop=[12000,25000,32000,23000]
a=random.randint(1,2)
b=random.randrange(0,4)
for i in range(a,b):
print(City[i],pop[a],sep='#')
a. Trichy#32000
b. Madurai#25000
Trichy#25000
c. Madurai#32000
d. Madurai#25000
26 Rewrite the following code in Python after removing all the syntax errors. 2
Underline each correction done in the code.
def factorial(n)
f=+i
return f
n=5
f1=factorial(5)
Print(f)
27 I. 2
A) What constraint should be applied on a table column so that duplicate
values are not allowed in that column, but NULL is allowed.
B) Write an SQL command to remove the Primary Key constraint from
a table, named MOBILE. M_ID is the primary key of the table.
OR
II.
A) Write an SQL command to make the column M_ID the Primary Key
of an already existing table, named MOBILE.
B) What constraint should be applied on a table column so that NULL is
not allowed in that column, but duplicate values are allowed.
28 (i) Write the full forms of the following: 2
(a) SMTP
(b) VOIP
(ii) Which protocol is used in creating a connection with a remote machine?
Q No Section-C (4 x 3 = 12 Marks) Marks
29 Write a function COUNT() in Python to read from a text file 'Anthem.txt' and 3
display the count of the letter 'a' in each line.
Example: If the file content is as follows:
Table : Sports
ROLLNO GAMENAME GRADE Fees
11A05 CRICKET A 15000
11A06 FOOTBALL B 25000
11A05 NULL NULL 12000
I. To display the Natural join of these two tables.
II. To increase students age of all students by 3 which have mobile
no ends with 4;
III. To display names (SName and FName) of students their
Gamename is not known.
IV. To display the details of students whose fees is in the range of
15000 to 20000 (both values included).
or
Write the output for SQL query:
SELECT SNAME,DOB,GRADE FROM STUDENT,SPORTS WHERE
STUDENT.ROLLNO=SPORTS.ROLLNO;
35 Aarya has created a table named Emp in MySQL: 4
EmpNo – integer
EmpName – string
Age– integer
Salary – integer
Note the following to establish connectivity between Python and MYSQL:
• Username - root
• Password - tiger
• Host - localhost
The Emp table exists in a MYSQL database named company. The details of
Emp table (EmpNo, EmpName, Age and Salary) Aarya wants to display All
Records of Emp relation whose age is greater than 55.
Help Aarya to write program in python.
Q No. Section-E (3 x 5 = 15 Marks) Marks
36 Surya is a manager working in a recruitment agency. He needs to manage 5
the records of various candidates. For this, he wants the following
information of each candidate to be stored:
- Candidate_ID – integer
- Candidate_Name – string
- Designation – string
- Experience – float
- Salary - int
You, as a programmer of the company, have been assigned to do this job
for Surya.
(I) Write a function to input the data of a candidate and append it
in a binary file.
(II) Write a function to update the data of candidates whose
experience is more than 10 years and to increase their salary
by 5%.
(III) Write a function to read the data from the binary file and to
display the candidates whose experience is more than 10
years.
37 OMS International School, Madurai has different wings Administrative Block, 5
Sai Block, Krishna Block and Amritha Block as shown in the diagram.
K
Amrita
Block R
A I
D DELHI
M S BRANCH
I
Sai Block N H
The school also has a branch in Delhi. The school management wants to
connect all the blocks as well as all the computers of each block.