Bhopal Set 1 - QP
Bhopal Set 1 - QP
Page 1 of 9
XII/PB/2021/CS/SET-1
15. Name the Transmission media which consists of an inner copper core and a second
1
conducting outer sheath.
16. Identify the valid statement for list L=[1,2,”a”]:
(i) L.remove("2")
(ii) L.del(2) 1
(iii) del L[2]
(iv) del L[“a”]
17. Find and write the output of the following python code:
x = "Python"
1
print(x[ : :-1])
print(x)
18. In SQL, write the query to display the list of databases stored in MySQL. 1
Page 2 of 9
XII/PB/2021/CS/SET-1
19. Write the expanded form of GPRS? 1
20. Which is not a constraint in SQL?
a) Unique
b) Distinct 1
c) Primary key
d) check
21. Define Bandwidth? 1
Section-II
Both the Case study based questions are compulsory. Attempt any 4 sub parts from
each question. Each question carries 1 mark
22. Observe the following table and answer the question (a) to (e) (Any 04)
TABLE: VISITOR
VisitorID VisitorName ContactNumber
V001 ANAND 9898989898
V002 AMIT 9797979797
V003 SHYAM 9696969696
V004 MOHAN 9595959595
(a) Write the name of most appropriate columns which can be considered as
1
Candidate keys?
(b) Out of selected candidate keys, which one will be the best to choose as Primary
1
Key?
(c) What is the degree and cardinality of the table? 1
(d) Insert the following data into the attributes VisitorID, VisitorName and
ContactNumber respectively in the given table VISITOR. 1
VisitorID = “V004”, VisitorName= “VISHESH” and ContactNumber= 9907607474
(e) Remove the table VISITOR from the database HOTEL. Which command will he
used from the following:
a) DELETE FROM VISITOR;
1
b) DROP TABLE VISITOR;
23. Priti of class 12 is writing a program to create a CSV file “emp.csv”. She has written
the following code to read the content of file emp.csv and display the employee record
whose name begins from “S‟ also show no. of employee with first letter “S‟ out of total
record. As a programmer, help her to successfully execute the given task.
Consider the following CSV file (emp.csv):
Page 3 of 9
XII/PB/2021/CS/SET-1
1,Peter,3500
2,Scott,4000
3,Harry,5000
4,Michael,2500
5,Sam,4200
Page 4 of 9
XII/PB/2021/CS/SET-1
28 Rewrite the following Python program after removing all the syntactical errors (if
any), underlining each correction:
def checkval:
x = input("Enter a number")
if x % 2 =0:
2
print (x, "is even")
elseif x<0:
print (x, "should be positive")
else;
print (x, "is odd")
29 What possible outputs(s) are expected to be displayed on screen at the time of
execution of the program from the following code? Also specify the maximum values
that can be assigned to each of the variables FROM and TO.
import random
AR=[20,30,40,50,60,70]
FROM=random.randint(1,3) 2
TO=random.randint(2,4)
for K in range(FROM,TO):
print (AR[K],end=”#“)
def Search(eno):
#Assume basic setup import, connection and cursor is created 2
query="select * from emp where empno=________".format(eno)
mycursor.execute(query)
results = mycursor._________
print(results)
32 Differentiate between DDL and DML with one Example each. 2
Page 5 of 9
XII/PB/2021/CS/SET-1
Section-II
34 Write code in Python to calculate and display the frequency of each item in a list. 3
35 Write a function COUNT_AND( ) in Python to read the text file “STORY.TXT” and
count the number of times “AND” occurs in the file. (include AND/and/And in the
counting)
3
OR
Write a function DISPLAYWORDS( ) in python to display the count of words starting
with “t” or “T” in a text file ‘STORY.TXT’.
36 Write a output for SQL queries (i) to (iii), which are based on the table: SCHOOL and
ADMIN given below:
TABLE: SCHOOL
CODE TEACHERNAME SUBJECT DOJ PERIODS EXPERIENCE
1001 RAVI SHANKAR ENGLISH 12/03/2000 24 10
1009 PRIYA RAI PHYSICS 03/09/1998 26 12
1203 LISA ANAND ENGLISH 09/04/2000 27 5
1045 YASHRAJ MATHS 24/08/2000 24 15
1123 GANAN PHYSICS 16/07/1999 28 3
1167 HARISH B CHEMISTRY 19/10/1999 27 5
1215 UMESH PHYSICS 11/05/1998 22 16
TABLE: ADMIN
CODE GENDER DESIGNATION 3
1001 MALE VICE PRINCIPAL
1009 FEMALE COORDINATOR
1203 FEMALE COORDINATOR
1045 MALE HOD
1123 MALE SENIOR TEACHER
1167 MALE SENIOR TEACHER
1215 MALE HOD
Page 6 of 9
XII/PB/2021/CS/SET-1
RNo integer
Name String
Age integer
def isEmpty(stk):
if stk == [ ]:
return True
else:
return False
def stk_push(stk, item):
# Write the code to push student details using stack.
OR
def isEmpty(stk):
if stk == [ ]:
return True
else:
return False
def stk_pop(stk):
# Write the code to pop a student using stack.
Section-III
38 PVS Computers decided to open a new office at Ernakulum, the office consist of Five
Buildings and each contains number of computers. The details are shown below.
Building-2 5
Building-1 Building-3
Building-5 Building-4
Page 7 of 9
XII/PB/2021/CS/SET-1
Distance between the buildings
Building No of computers
Building 1 and 2 20 Meters
1 40
Building 2 and 3 50 Meters
2 45
Building 3 and 4 120 Meters
3 110
Building 3 and 5 70 Meters
4 70
Building 1 and 5 65 Meters
5 60
Building 2 and 5 50 Meters
Computers in each building are networked but buildings are not networked so far. The
Company has now decided to connect building also.
(i) Suggest a cable layout for connecting the buildings
(ii) Do you think anywhere Repeaters required in the campus? Why
(iii) The company wants to link this office to their head office at Delhi
(a) Which type of transmission medium is appropriate for such a link?
(b) What type of network would this connection result into?
(iv) Where server is to be installed? Why?
(v) Suggest the wired Transmission Media used to connect all buildings efficiently.
39 Write SQL queries for (i) to (v), which are based on the table: SCHOOL and ADMIN
TABLE: SCHOOL
CODE TEACHERNAME SUBJECT DOJ PERIODS EXPERIENCE
1001 RAVI SHANKAR ENGLISH 12/03/2000 24 10
1009 PRIYA RAI PHYSICS 03/09/1998 26 12
1203 LISA ANAND ENGLISH 09/04/2000 27 5
1045 YASHRAJ MATHS 24/08/2000 24 15
1123 GANAN PHYSICS 16/07/1999 28 3
1167 HARISH B CHEMISTRY 19/10/1999 27 5
1215 UMESH PHYSICS 11/05/1998 22 16 5
TABLE: ADMIN
CODE GENDER DESIGNATION
1001 MALE VICE PRINCIPAL
1009 FEMALE COORDINATOR
1203 FEMALE COORDINATOR
1045 MALE HOD
1123 MALE SENIOR TEACHER
1167 MALE SENIOR TEACHER
1215 MALE HOD
Page 8 of 9
XII/PB/2021/CS/SET-1
Sl,name,salary
1,Peter,3500
2,Scott,4000
3,Harry,5000
4,Michael,2500
5,Sam,4200
Write Python function DISPEMP( ) to read the content of file emp.csv and display only
those records where salary is 4000 or above
*************************************************************************
Page 9 of 9