CSSC 23-24 QP Paper2
CSSC 23-24 QP Paper2
(General Instructions)
Please check that this question paper contains ___8___ printed pages.
Please check that this question paper contains 35 questions.
Please write down the serial number of the question before attempting it.
Reading time of 15 minutes is given to read the question paper alone. No writing
during this time.
The paper is divided into 5 Sections- A, B, C, D and E.
Section A, consists of 18 questions (1 to 18). Each question carries 1 Mark.
Section B, consists of 7 questions (19 to 25). Each question carries 2 Marks.
Section C, consists of 5 questions (26 to 30). Each question carries 3 Marks.
Section D, consists of 2 questions (31 to 32). Each question carries 4 Marks.
Section E, consists of 3 questions (33 to 35). Each question carries 5 Marks.
All programming questions are to be answered using Python Language only.
Q.No. Question Marks
SECTION – A
1. State True or False : (1)
“All elements in Python list must be of same data type”
2. In MYSQL database, if a table, SCHOOL has degree 4 and cardinality 5, and (1)
another table, STUDENT has degree 4 and cardinality 3, what will be the degree
and cardinality of the Cartesian product of SCHOOL and STUDENT?
(a) Aim$for$high$score
(b) AIM$FOR$score
(c) Aim$High$score
(d) Aim$FOR$score
5. Which is not a constraint in SQL ? (1)
1
CHENNAI SAHODAYA SCHOOLS COMPLEX
2
CHENNAI SAHODAYA SCHOOLS COMPLEX
(b) When 2 rows are added and 3 attributes are deleted from the table what is the
cardinality of the new table.
3
CHENNAI SAHODAYA SCHOOLS COMPLEX
(OR)
Ms.Sita has just created a table named “sweets” containing columns Sname,
Quantity and Price.
After creating the table, she realized that she has forgotten to add a primary key
column in the table. Help her in writing an SQL command to add a primary key
column SID of integer type to the table sweets. Thereafter, write the command to
insert the following record in the table:
SID- 999
Sname- Kaju Katli
Quantity : 40
Price : 2
25. What possible outputs are expected to be displayed on screen at the time of (2)
execution of the program from the following code? Also specify the maximum
value that can be assigned to each of the variables L and U.
import random
Arr=[10,30,40,50,70,90,100]
L=random.randrange(1,3)
U=random.randrange(3,6)
for i in range(L,U+1):
print(Arr[i],"@",end="")
(OR)
What are the incorrect output(s) from the given options when the following
code is executed? Also specify the minimum and maximum values that can
be assigned to the variable VALUE.
import random
VALUE = random.randint (0,3)
SUBJECT=[“PHY”,”CHEM”,”MATHS”,”COMP”];
for I in SUBJECT:
for J in range(1, VALUE):
print(I, end=””)
print()
i) PHYPHY
CHEMCHEM
MATHSMATHS
COMPCOMP
ii) PHY
PHYCHEM
PHYCHEMMATHS
iii) PHY
CHEMCHEM
COMPCOMPCOMP
iv) PHY
CHEM
MATHS
COMP
4
CHENNAI SAHODAYA SCHOOLS COMPLEX
SECTION – C
26. Predict the output of the following code: (3)
def div5(n):
if n%5==0:
return n*5
else:
return n+5
def output(m=4):
for i in range(0,m):
print(div5(i),'@',end=' ')
print( )
output(5)
output()
output(3)
(1*3=3)
27. Write output of the queries (i) to (iii) based on the table Sportsclub
Tble Name: Sportsclub
Playerid pname Sports Country Rating Salary
10001 PELE SOCCER BRAXIL A 50000
10002 FEDERER TENNIS SWEDEN A 20000
10003 VIRAT CRICKET INDIA A 15000
10004 SANIA TENNIS INDIA B 5000
10005 NEERAJ ATHLETICS INDIA A 12000
10006 BOLT ATHLERIC JAMAICA A 8000
10007 PAUL SNOOKER USA B 10000
28. Write a function COUNTWORD( ), which counts all the words from the text file? (2*1 ½
=3)
Book.txt whose second last character is ‘r’
For example, if the Book.txt file contains
India is my country. They are studying.
then the output should be: 2
(OR)
Write a function countEU() in Python, which should reads each character of a text file.
IMP.TXT, should count and display the occurrence of alphabets E and U (including small
cases e and u too).
e. g. if the file content is as follows:
Pinaky has gone to his friend's house. His friend's name is Ravya. Her house is 12 km from
Pinaky's house.
5
CHENNAI SAHODAYA SCHOOLS COMPLEX
29. Consider the table FASHION given below, write SQL queries : (1*3=3)
Table: FASHION
ID PRODUCT PRICE QTY
F01 Kajal 970 10
F02 Foundation 2100 15
F03 Night Cream 1700 20
F04 Day Cream 1400 10
F05 Shampoo 1200 25
F06 Lipstick 850 32
SECTION – D
31. Consider the tables LAB and TRADER given below : (1*4=4)
Write SQL queries for the questions (i) to (iv)
LAB
LabNo ItemName CostPerItem Quantity Dateofpurchase Warranty
1 Computer 60000 9 21/05/1996 1
2 Printer 15000 3 21/05/1997 4
3 Scanner 18000 1 29/08/1998 1
4 Camera 21000 2 13/10/1996 1
5 Switch 8000 1 31/10/1999 2
6 UPS 5000 5 21/05/2000 1
7 Router 25000 2 11/01/2000 2
8 Repeater 12000 4 10/02/1998 2
TRADER
LNO TraderName City
3 Busy Store Corp Mumbai
1 Electronic show Chennai
5 Busy Store Corp Bangalore
8 Sale Corp Chennai
2 Electronic show Delhi
(i) To display all the itemName whose name starts with “C” in Chennai city.
(ii) To list the ItemName in ascending order of the date of purchase where
quantity is more than 3.
(iii) To update the ItemName to “Web Cam” where Itemname ends with ‘a’.
6
CHENNAI SAHODAYA SCHOOLS COMPLEX
32. Write a program in Python that defines the following user-defined functions: (4)
AddRecord() – To accept and add data of Mobile phones to a CSV file
‘Mobile.csv’. Each record consists of a list with field elements as
ModelNo, MobileName, Manufacturer and Price to store model number,
mobile name, manufacturer and price respectively.
Find() – To search the records of mobiles manufactured by Apple present in the
CSV file named ‘Mobile.csv’.
SECTION – E
33.
Sony has set up its Branch at Srinagar for its office and web-based activities. It (1*5=5)
has four zones of buildings as shown in the diagram:
ZONE ZONE
Z Y
ZONE
ZONE
X
U
Number of Computers :
Zone X 50
Zone Z 130
Zone Y 40
Zone U 15
(a) Suggest the most suitable cable layout or Networking Topology of connections
between the zones.
(b) Suggest the most suitable place (i.e., Zone) to house the Server of this
organization. Give a suitable reason with justification.
(c) Suggest the placement of the following devices with justification:
(i) Repeater (ii) Hub/Switch
(d) Which is the most economic type of cable for the selected topology?
(e) Suggest a device/software to be installed in each branch to take care of data
security.
7
CHENNAI SAHODAYA SCHOOLS COMPLEX
34. Write a Program in Python that defines the following user defined functions:
(i) ADD() – To accept and add data of an item to a binary file ‘events.dat’. Each
record of the file is a list
(5)
[Event_id, Description, Venue, Guests, Cost].
Event_Id, Description, and venue are of str type, Guests and Cost are of
int type.
(ii) COUNTR() – To read the data from the file ‘events.dat’, calculate and display
the average cost.
Preety has created a table named EMP with the following details.
Empcode – integer
35. EmpName – string (5)
EmpSalary – float
• Username is root
• Password is root@123
END OF PAPER