Professional Documents
Culture Documents
Cs Xii Pb2 Silchar Ms
Cs Xii Pb2 Silchar Ms
Q.N. Section-A: This section consists of 18 MCQ (Multiple Choice Questions) of 1 mark each.
Given an object L= [[1,2,3],4,5, [6,7,8]] What will be the output of print (L [3][1]])?
2
a. [6,7,8] b. 6 c. 5 d. 7
Which of the following statement(s) would give an error after executing the following code?
S1="Hello All" # Statement 1
print(S) # Statement 2
S2=S1+3 # Statement 3
3 print(S2) # Statement 4
S3=S1+"Welcome to my class" # Statement 5
The _____ method of a file object flushes any unwritten information and closes the file object.
7
a. flush() b. close() c. clear() d. flushall()
Syntax of seek function in Python is fileObj.seek(offset, position) where fileObj is the file
9 object. What is the default value of position?
a. 0 b. 1 c. 2 d. 3
Pickling in python means _______________________
a. Python object is converted into a byte stream,
10 b. Python byte stream is converted into python object
c. both statements are true
d. None of the above are true
Which of the following commands will delete the table from MYSQL database?
11
a. DELETE TABLE b. DROP TABLE c. REMOVE TABLE d. ALTER TABLE
_________ is an attribute, which serves the purpose of uniqueness of records in a relation in SQL.
12
a. Primary Key b. Foreign Key c. Candidate Key d. Alternate Key
The SELECT statement when combined with __________ clause, returns records in ascending order of
13 column name.
a. group by b. where c. order by d. like
Which function is used to display the total of values of column from table in a database?
14
a. sum(*) b. total(*) c. count(*) d. return(*)
What will the output if following expression be evaluated to in Python?
15 42+4-3**2//19-3
a. 43.25 b. 43.0 c. 43 d. 43.5
An IPv4 address consists of …………………… bits.
16
a. 4 b. 16 c. 32 d. 128
17 (b) Both A and R are true and R is not the correct explanation for A
18 (a) Both A and R are true and R is the correct explanation for A
Q.N. Section B consists of 7 VSA (Very Short Answer) Questions (19-25) of 2 marks each.
20 22.8
Requires point to point connections Sends data in small blocks, called packets.
during calls. Packets reassembled in proper sequence at
the receiver end.
Required dedicated connection Not required dedicated connection
Circuit-switched networks were used Packet-switched networks are used for data
for phone calls transfers
22
HyperText Markup Language. eXtensible Markup Language.
HTML is case insensitive. XML is case sensitive.
HTML is used for designing a web-page XML is used basically to transport data between
to berendered on the client side. the application and the database.
HTML has its own predefined tags. Uses custom tags defined by the user.
XML is about carrying information hence
HTML is about displaying data, hence
static. dynamic.
Inside the function
X : 25
23 Name Asha
Outside the function
X : 25
24 b. ii , iv
Create table Department (DEPTNO int PRIMARY KEY, DNAME varchar(14) NOT NULL, LOC varchar(13),
25 Salary decimal);
Q.N. Section C consists of 5 SAT (Short Answer Type) Questions (26-30) of 3 marks each.
26 11
27 iIlOVEepYTHON
Write a function in Python POP_OUT(Stk), where Stk is a stack implemented by a list of numbers. The
function returns the value which is deleted/popped from the stack.
TEACHERNAME SUBJECT
UMESH PHYSICS
YASHRAJ MATHS
PRIYA RAI PHYSICS
30 RAVI SHANKAR ENGLISH
LISA ANAND ENGLISH
HARISH B CHEMISTRY
(v) SELECT TEACHERNAME, DESIGNATION FROM SCHOOL, ADMIN WHERE SCHOOL.CODE = ADMIN.CODE;
TEACHERNAME DESIGNATION
RAVI SHANKAR VICE PRINCIPAL
PRIYA RAI COORDINATOR
LISA ANAND COORDINATOR
YASHRAJ HOD
HARISH B SENIOR TEACHER
UMESH HOD
(vi) SELECT * FROM SCHOOL WHERE DOJ BETWEEN ‘01/01/1999’ and ‘31/12/2000’;
CODE TEACHERNAME SUBJECT DOJ PERIOD EXPERIENCE
1001 RAVI SHANKAR ENGLISH 12/03/2000 24 10
1203 LISA ANAND ENGLISH 09/04/2000 27 5
1045 YASHRAJ MATHS 24/08/2000 24 15
1167 HARISH B CHEMISTRY 19/10/1999 27 5
Q.No. Section-D: This section 3 LAT (Long Answer Type) Questions (31-33) of 5 marks each.
a.
import mysql.connector as pymysql
dbcon=pymysql.connect (host=”localhost”, user=”root”, passwd=”sia@1928”)
if dbcon.isconnected()==False:
print(“Error in establishing connection:”)
cur=dbcon.cursor()
query=” select * from stmaster”
cur.execute(query)
resultset=cur.fetchmany(3)
for row in resultset:
31
print(row)
dbcon . close ()
(b)
import mysql.connector as mysql
def sql_data():
con1=mysql.connect(host="localhost",user="root", password="root@123",
database="management")
mycursor=con1.cursor() #Statement 1
print("Employees with salary greater than 53500 are : ")
Q = “Select * from employee where salary > 53500” #Statement2
data=cur.execute(Q) #Statement 3
for i in data:
print(i)
print()
(i) Identify the suitable code for blank space in the line marked as Statement-1.
csv
(ii) Identify the missing code for blank space in the line marked as Statement-2.
w
32 (iii) Choose the object name to be passed i n the line marked asStatement-3.
fw=csv.writer(f)
(iv) Identify the suitable code for the blank space in Statement-4.
fw.writerow(data[i])
(v) Write the suitable code for blank space in Statement-5.
c=c+1
(i) Suggest a cable layout of connections between the buildings.
Drawing of layout based on star or bus topology.
(ii) What is the most suitable block to install server?
Human Resource Block.
(iii) What will be the best possible connectivity out of the following to connect its new office in
33 Bengaluru with its London-based office?
a) Infrared b) Satellite c) Ethernet Cable
(iv) Which of the devices will you suggest to connect each computer in each of the above blocks?
a) Gateway b) Switch c) Modem
(v) Differentiate between LAN and WAN.
Any two differences
(i) Display details of those students whose NAME starts with ‘R’ or ‘P’.
Select * from Graduate where Name like ‘R%’ or Name like ‘P%’
(ii) To display NAME and STIPEND of students who are either PHYSICS or COMPUTER SC graduates.
Select Name, Stipend from Graduate where Subject in (‘Physics’, ‘Comp. Sc.’)
34
(iii) Increase the value of stipend of students of computer science by 500.
Update Graduate set stipend = stipend+500 where Subject = ‘Comp.Sc.’
(iv) Display NAME and SUBJECT of those students who have AVERAGE in the range of 65 and 75.
Select Name, Subject from Graduate where Average between 65 and 75
a.
f=open("test.txt","w") #Statement 1…round brackets to be used
L = ["My name\n", "is\n", "Amit"] #Statement 2
f.writeline (L) #Statement 3…No writeline attribute is there.
f.close() #Statement 4
b. This code will print contents of file1.txt in reverse order. That is: TAERG SI AIDNI
OR
35
# Function to print words which contains letter ‘S’ or ‘s’ anywhere in the word in “STORY.txt”
def DisplayWords():
f=open("D://STORY.txt","r")
s=f.read()
for w in s.split():
if "s" in w or "S" in w:
print(w)
f.close()