QP-Computer Science-12-Common Exam
QP-Computer Science-12-Common Exam
ERROR 1406 (22001): Data too long for column 'Ename' at row 1
How to you overcome the above error. And also write the SQL command to solve the
above error.
PASSENGER
PNO NAME GENDER
1001 Suresh MALE
1002 Anita FEMALE
1003 Nita FEMALE
FLIGHT
FNO START END F_DATE FARE
F104 KOLKATA MUMBAI 2021-12-20 4500
F105 DELHI BENGALURU 2021-01-12 5000
Page 1 of 9
5 Select the correct output of the code: 1
s="GOOD MORNing"
print(s.capitalize(),s.title(),s.casefold(),s.swapcase(),end="!")
Options:
a) Good morning Good Morning good morning good MORNing!
b) Good morning Good Morning good morning good mornING
c) Good morning! Good Morning! good morning! good mornING!
d) Good morning Good Morning good morning good mornING!
6 Name the transmission media best suitable for connecting to desert areas ? 1
7 Write an appropriate statement to check if value 200 exists in the following dictionary: 1
mydict={'a':100,'b':200,'c':300}
print( )
8 Consider the statements given below and then choose the correct output from the given 1
options:
x='IncredibleIndia'[-2:-7:-1]
print (x, x[2: -2],sep='$')
a) idnIIe$n
b) idnIe$n
c) idn Ien$
d) idnIen$
9 What will be the output of the following code? 1
X, Y =(1,2), (3,4)
Y, X=X, Y+(2,)
print(X, Y)
Options:
a) ['G','Green']:['G','Green']:['Y','Yellow']:
b) ['G','Green']:['B','Blue']:['G','Green']:
c) ['V','Violet']:['B','Blue']:['B','Blue']:
d) ['I','Indgo']:['B','Blue']:['B','Blue']:
Page 2 of 9
11 Fill in the blank: 1
is a communication methodology designed to deliver both
voice and multimedia communications over Internet protocol.
b=100
def CSSC(a):
#Missing statement
b=b+a
CSSC(20)
print(b)
Which of the following statements should be given in the blank for #Missing
Statement, if the output produced is 120?
Options:
a) global a
b) global b=100
c) global b
d) global a=100
13 State True or False . 1
‘r’ mode, opens a file for reading only. The file pointer is placed at the beginning of the
file. If the specified file does not exist, it will generate ‘File Not Found Error’.
Reason(R) : Mutability means a value can be changed in place without having to create
new storage for the changed value.
SECTION B
19 a) What any one difference between circuit switching and packet switching? 2
b) Write the full form: NIU,URL
OR
a) Write the full form : MODEM, GPRS
b) What is Web Hosting?
20 Ranjit has written a code to input a number and check whether it is even number or odd 2
number. His code is having errors. Rewrite the correct code and underline the correction
made.
Page 3 of 9
Def Check_No( N ):
status = N%2
return
# main code
num=int(input(“Input enter a number to check:))
K=Check_No(num)
if k = 0:
print(“This is EVEN
Number”) else:
print(“This is ODD Number”)
veh={vtype:[brand,model,year,price], vtype:[brand,model,year,price], … }
Write a program to accept the dictionary and counting the number of vehicles released in
2020. Also display all vehicles in alphabetical order with its brand name.
OR
Write a function INDEX_TUPLE(T), where T is the list of tuple elements passed as
argument to the function. The function returns another list named ‘indexList’ that stores
the indices of all Non-Zero Elements of T.
For example:
If L contains (12,4,0,11,0,56)
The indexList will have - [0,1,3,5]
L=[100,212,310]
print(L)
Qud_Mod(L)
print(L)
23 Answer the following: 2
a) Name the package imported for connecting Python with MySQL database.
b) What is the purpose of cursor object?
OR
a) Write the output of the code given below:
list= [10, 20, 30, 40, 50, 60, 70, 80]
print(list[ : : -2])
Page 4 of 9
b) Write the output of the code given below:
squares = {1: 1, 2: 4, 3: 9, 4: 16, 5: 25}
print(squares.pop(4))
24 a) Write a command to create the following table: 2
Table: Project_info
Field Datatype Size Constraints
Stud_roll integer 3 Not to be left empty and
unique
Name Variable character 15 Not to be left empty
Project_name Variable character 20 Not to be left empty
and unique
Number_of_students Integer 4 Should be more than 1
Date_of_submission Date Default date is
6th June,2022
OR
a) John is working in a database named GAME, in which he has created a
table named “Sports” containing columns SportId, SportName,
no_of_players, and category.
After creating the table, he realized that the attribute, ‘category’ has to be
deleted from the table and a new attribute ‘TypeSport’ of data type string
has to be added. This attribute ‘TypeSport’ cannot be left blank. Help John
write the commands to complete both the tasks. Write the complete SQL commands to
solve it.
25 Write the output of the code given below: 2
def IamERROR(denom=10):
try:
numerator=50
quotient=(numerator/denom)
print ("Division performed
successfully") except ZeroDivisionError:
print ("Denominator as ZERO is not
allowed") else:
print ("The result of division operation is ",
quotient) finally:
print ("OVER AND OUT")
IamERROR(5)
IamERROR()
IamERROR(0)
SECTION C
26 Predict the output of the Python code given below:
def Change_text(Text):
T=" "
for K in range(len(Text)):
if Text[K].isupper():
T=T+Text[K].lower();
elif K%2==0:
T=T+Text[K].upper()
else:
T=T+T[K-1]
print(T)
Text="Good go Head ?*& 489" #Each word is separated by single space.
Change_text(Text)
Page 5 of 9
27 Consider the following tables: BANK and BRANCH. 1+2
Table1: BANK
ACode Name Type
A01 Amrita Savings
A02 Parthodas Current
A03 Miraben Current
Table2: BRANCH
Acode City
A01 Delhi
A02 Mumbai
A01 Nagpur
b) Write the output of the queries (i) to (iv) based on the table, TECH_COURSE
given below:
Write a function Count_CAR() to count and display number of lines starting and ending
with same letter in “car.txt”. Also, calculate the average word size.
[Note: Each line end with full stop. Each word is separated by a single space or full stop]
Example:
File content: Ratha madam has a racecar.
She loves to drive the car.
Page 6 of 9
Note: Calculating word average as follows:
Line1: 5+5+3+1+7=21
Line2: 3+5+2+5+3+3=21 = (42/11)=3.8
29 Write the outputs of the SQL queries (a) to (c) base on the relations
Emp and Eaddress given below: 3
Table1: Emp
No Name Age Dept Salary Commission Gender
1 Anuj 23 Comp 4500 3000 M
2 Radha 34 Sales 5600 2000 F
3 Rekha 32 Admin 7600 2000 F
4 Leena 54 Advt 8000 5000 F
5 Rajan 43 Comp 9000 5000 M
6 Prakash 34 Sales 7500 1200 M
7 Mukesh 56 Admin 9500 2100 M
8 Poonam 31 Admin 2500 2500 F
9 Shweta 33 Advt 1200 5000 F
Table2: Eaddress
No Address City
1 24,ABC Enclave Chennai
5 27-k,Westend Mumbai
Table: FLIGHT
FNO START END F_DATE FARE
F101 MUMBAI CHENNAI 2021-12-25 4500
F102 MUMBAI BENGALURU 2021-11-20 4000
F103 DELHI CHENNAI 2021-12-10 5500
F104 KOLKATA MUMBAI 2021-12-20 4500
Page 7 of 9
F105 DELHI BENGALURU 2021-01-12 5000
Page 8 of 9
i) Write a query to display the NAME, corresponding FARE and
F_DATE of all passengers who have flight to start from “DELHI”.
iii) Write a query to delete the records of flights which ends at ”MUMBAI”.
SECTION – E
33 Indian School, in Mumbai is starting up the network between its different wings. 5
There are Four Buildings named as SENIOR, JUNIOR, ADMIN and HOSTEL as
shown below:
And also they have a Cricket ground 2000 KM away from the school wing.
SENIOR 130
JUNIOR 80
ADMIN 160
HOSTEL 50
1) Suggest the cable layout of connections between the buildings and the
topology thus formed (school wings only).
2) Suggest the most suitable place (i.e. building) to house the server of this
school, provide a suitable reason.
Page 9 of 9
4) The organization also has Inquiry office in another city about 50-60 Km away in a
Hilly Region. Suggest the suitable transmission media to interconnect the school
and Inquiry office out of the following
o Fiber Optic Cable
o Microwave
o Radio wave
What would be the type of network thus formed?
5) Which fast and very effective wireless transmission medium should preferably
be used to connect the school wing at MUMBAI with the Cricket ground for live
Telecast?
1+4
34 a) What is pickling and unpickling?
OR
OR
a) Define the term Degree and Cardinality with respect to RDBMS. Give one example
to support your answer.
b) Write a program to integrate Python with MySQL to create a table, insert the records
(two records) in to the table and display it.
Note: The values of fields Eno, Name and Salary has to be accepted from
the user.
END OF PAPER
Page 10 of
9