Nothing Special   »   [go: up one dir, main page]

13th 14th and 15th Paper

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 24

SAMPLE PAPER SET 13

CLASS – XII SUBJECT: Computer Science-083


Total Time- 3 Hours Total Marks- 70
------------------------------------------------------------------------------------------------------------------------------------------
General Instructions:
1. This question paper contains five sections, Section A to E.
2. All questions are compulsory.
3. Section A have 18 questions carrying 01 mark each.
4. Section B has 07 Very Short Answer type questions carrying 02 marks each.
5. Section C has 05 Short Answer type questions carrying 03 marks each.
6. Section D has 03 Long Answer type questions carrying 05 marks each.
7. Section E has 02 questions carrying 04 marks each. One internal choice is given in Q35 against part
c only.
8. All programming questions are to be answered using Python Language only.

SECTION-A
1. Name the Python library module needed to be imported to invoke following functions: 1
a. floor ( )
b. randomint ( )

2. To use function of any module, we have to use (command) before the use 1
of function of a module
3. Identify the key and values from the dictionary given below? 1
a. D = {“Rohan”:{“Manager”:427, “SBI”, 05884 } }
4. Which of the following is/are not assignment operator? 1
a) **= b) /= c) == d) %=
5. Find the output of the code: 1
num = 7
def func ( ) :
num = 27
print(num)
6. Which statement is used to retrieve the current position within the file: 1
a. fp.seek( ) b. fp.tell( ) c. fp.loc d. fp.pos
7. Clause used in select statement to collect data across multiple records and group the 1
results by one or more columns:
a. order by
b. group by
c. having
d. where
8. Which keyword eliminates redundant data from a SQL query result? 1
9. What does the following code print to console? 1
if True:
print(50)
else:
print(100)
a. True b. False c.50 d.100
10. Fill in the blank: 1
No. of rows in a relation is called ………………….. .
(a) Degree b. Domain c. Cardinality d. Attributes
11. Which of the following is not a correct Python statement to open a test file “Students.txt” 1
to write content into it :
a. f= open(“Students.txt”, ‘a’)
b. f= open(“Students.txt”, ‘w’)
c. f= open(“Students.txt”, ‘w+’)
d. f= open(“Students.txt”, ‘A’)

12. Fill in the blank: 1


The....................clause, places condition with aggregate functions .
a. HAVING b. WHERE c. IN d.BETWEEN
13. Write the full forms of: 1
a. PPP
b. VOIP
14. Find the output: 1
tuple1 = (10,12,14,16,18,20,22,24,30)
print( tuple1[5:7] )

15. Which of the following is not an aggregate function? 1


a. AVG b. MAX c. JOIN d.COUNT
16. Name the module used to establish a MySQL database connection with a python program. 1

Q17 and 18 are ASSERTION AND REASONING based questions. Mark the correct choice as
(a) Both A and R are true and R is the correct explanation for A
(b) Both A and R are true and R is not the correct explanation for A
(c) A is True but R is False
(d) A is false but R is True
17. Assertion(A): Dictionaries are enclosed by curly braces { } 1
Reason(R): The key-value pairs are separated by commas ( , )
18. Assertion(A): The random module is a built-in module to generate the pseudo-random 1
variables.
Reason(R): The randrange() function is used to generate a random number between the
specified range in its parameter.
SECTION-B
19. Yuvika has to complete her computer science assignment of demonstrating the use of if-else 2
statement. The code has some error(s). Rewrite the correct code underlining all the
corrections made.
marks = int(“enter marks”)
temperature = input(“enter temperature”)
if marks < 80 and temperature >= 40
print(“Not Good”)
else
print(“OK”)
20. Write a short note on web hosting. 2
OR
What is work of TCP / IP explain.
21. Write the output after evaluating he following expressions: 1
a) k= 7 + 3 **2 * 5 // 8 – 3
print(k)
b) m= (8>9 and 12>3 or not 6>8)
print(m) 1
22. What do you understand by table constraint in a table? Give a suitable example in support 2
of your answer.
23. Expand the following terms: 2
a. PAN b. HTML c. URL d. POP
24. Predict the output of the Python code given below: 2
def func(n1 = 1, n2= 2):
n1= n1 * n2
n2= n2 + 2
print(n1, n2)

func( )
func(2,3)
OR

Predict the output of the Python code given below:


T= [“20”, “50”, “30”, “40”]
Counter=3
Total= 0
for I in [7,5,4,6]:
newT=T[Counter]
Total= float (newT) + I
print(Total)
Counter=Counter-1
25. Rohit wants to increase the size of the column FeeAmount by 5, which is possible 2
category out of DML / DDL of command he has to use to:
(Write DDL or DML alongwith command / query)
Display the structure of table (DDL or DML)
Increase the size of column FeeAmount by 5 (DDL or DML)
OR
Differentiate between char(n) and varchar(n) data types with respect to databases.
SECTION C

26. (a) Observe the following table and answer the question accordingly 1+2
Table:Product
Pno Name Qty PurchaseDate
101 Pen 102 12-12-2011
102 Pencil 201 21-02-2013
103 Eraser 90 09-08-2010
109 Sharpener 90 31-08-2012
113 Clips 900 12-12-2011
What is the degree and cardinality of the above table?
(b) Write the output of the queries (i) to (iv) based on the table, STUDENT given
below: S.NO NAME STIPEND SUBJECT AVERAGE DIV
1 KARAN 400 PHYSICS 68 I
2 DIWAKAR 450 COMP Sc 68 I
3 DIVYA 300 CHEMISTRY 62 I
4 REKHA 350 PHYSICS 63 I
5 ARJUN 500 MATHS 70 I
6 SABINA 400 CHEMISTRY 55 II
7 JOHN 250 PHYSICS 64 I
8 ROBERT 450 MATHS 68 I
9 RUBINA 500 COMP Sc 62 I
10 VIKAS 400 MATHS 57 II
(i) Select MIN(AVERAGE) from STUDENT where SUBJECT=”PHYSICS”;
(ii) Select SUM(STIPEND) from STUDENT WHERE div=’II’;
(iii) Select AVG(STIPEND) from STUDENT where AVERAGE>=65;
(iv) Select COUNT(distinct SUBJECT) from STUDENT;

27. Write a definition of a function calculate () which count the number of 3


digits in a file “ABC.txt”.
OR

Write a function count( ) in Python that counts the number of “the” word present in a text
file “STORY.TXT”.
If the “STORY.TXT” contents are as follows:
This is the book I have purchased. Cost of the book was Rs. 320.
Then the output will be : 2

28. (a) Write the outputs of the SQL queries (i) to (iii) based on the tablesEmp: 3

EmpCode Ename Salary JoinDate


E001 Raman 55000 2019-10-11
E002 Neha 65000 2019-11-20
E003 Priya 60000 2020-01-28
E004 Raghav 58000 2020-02-16
(i) Select ename, salary from emp where name like ‘_r%’
(ii) Select count(salary) from emp where joindate>’2019-11-28’
(iii) Select max(joindate), min(joindate) from emp
(b) Write the command to list all the databases in MySQL.

29. Write definition of a Method MSEARCH(STATES) to display all the state names from a 3
list of STATES, which are starting with alphabet M.
For example:
If the list STATES contains[“MP’,”UP”,”MH”,”DL”,”MZ”,”WB”]
The following should get displayed
MP
MH
MZ
30. Write a function in Python push(S,item), where S is stack and item is element to be 3
inserted in the stack.
OR
Write a function in Python pop(S), where S is a stack implemented by a list of items. The
function returns the value deleted from the stack.
SECTION-D
31. A software organization has to set up its new data center in Chennai. It has four blocks of
buildings – A, B, C and D.

Distance Between Blocks No. of Computers

Block A to Block B 50m Block A 25


Block B to Block C 150m Block B 50
Block C to Block D 25m Block C 125
Block A to Block D 170m Block D 10
Block B to Block D 125m
1
Block A to Block C 90m 1
(i) Suggest a cable layout of connection between the blocks (Diagram).
1
(ii) Suggest the most suitable block to host the server along with the reason.
1
(iii) Where would you place Repeater devices? Answer with justification.
1
(iv) The organization is planning to link its front office situated in the city

in a hilly region where cable connection is not feasible, suggest

an economic way to connect it with reasonably high speed.

(v) Where would you place Hub/Switch? Answer with justification.

32. (a) Find and write the output of the following python code: 2+3

def change(s):
k=len(s)
m=" "
for i in range(0,k):
if(s[i].isupper()):
m=m+s[i].lower()
elif s[i].isalpha():
m=m+s[i].upper()
else:
m=m+'is'
print(m)
change('kv@onTHEtop')

(b) The given program is used to connect with MySQL abd show the name of the all the
record from the table “stmaster” from the database “oraclenk”. You are required to
complete the statements so that the code can be executed properly.
import .connector pymysql
dbcon=pymysql. (host=”localhost”, user=”root”,
=”kvs@1234”)
if dbcon.isconnected()==False
print(“Error in establishing
connection:”) cur=dbcon. ()

query=”select * from stmaster”


cur.execute( ) resultset=cur.fetchmany(3)
for row in resultset:
print(row)
dbcon. ()

OR
(a) Write output of the following
code: def func(a):
s=m=n=0
for i in (0,a):
if i%2==0:
s=s+i
elif i%5==0:
m=m+i
else:
n=n+i
print(s,m,n)
func(15)

(b) Avni is trying to connect Python with MySQL for her project. Help her to write
the python statement on the following:-
(i) Name the library, which should be imported to connect MySQL with Python.
(ii) Name the function, used to run SQL query in Python.
(iii) Write Python statement of connect function having the arguments values
as: Host name :192.168.1.101
User : root
Password:
Admin
Database : KVS
33. Divyanshi writing a program to create a csv file “a.csv” which contain user id and 5
name of the beneficiary. She has written the following code. As a programmer help
her to successfully execute the program.

import #Line 1
with open('d:\\a.csv','w') as
newFile:
newFileWriter = csv.writer(newFile)
newFileWriter.writerow(['user_id','beneficiary'])
newFileWriter. ([1,'xyz']) #Line2
newFile.close()

with open('d:\\a.csv','r') as newFile:


newFileReader = csv.
(ne
wFile) #Line 3
for row in newFileReader:
print (row) #Line 4
newFile. #Line 5

a) Name the module he should import in Line 1


b) Fill in the blank in line 2 to write the row.
c) Fill in the blank in line 3 to read the data from csv file.
d) Write the output while line 4 is executed.
e) Fill in the blank in line 5 to close the file.
OR
ANSHU is writing a program to search a name in a CSV file “MYFILE.csv”. He has
written thefollowing code. As a programmer, help him to successfully execute the
given task.
import # Statement 1
f = open("MYFILE.csv", ) # Statement 2
data = ( f ) # Statement 3
nm = input("Enter name to be searched: ")
for rec in data:
if rec[0] == nm:
print (rec)
f. ( ) # Statement 4

(a) Name the module he should import in Statement 1.


(b) In which mode, MOHIT should open the file to search the data in the file
in statement 2?
(c) Fill in the blank in Statement 3 to read the data from the file.
(d) Fill in the blank in Statement 4 to close the file.
(e) Write the full form of CSV.
SECTION-E
34. Dinesh creates a table COMPANY with a set of 06 records. 1+1+2

C_ID F_ID Cname Fees


C21 102 Grid Computing 40000
C22 106 System Design 16000
C23 104 Computer Security 8000
C24 106 Human Biology 15000
C25 102 Computer Network 20000
C26 105 Visual Basic 6000
Based on the data given above answer the following questions:

(a) Identify the most appropriate column, which can be considered as


Primary key.
(b) If 3 columns are added and 2 rows are deleted from the table result,
what will be the new degree and cardinality of the above table?
(c) Write the statements to:
(i) delete a record which has C_ID as C24
(ii) Increase the Fee of all by 500.
OR (Option for part (C) only)
(i) Add a column PLACE in the table with datatype as varchar with
20 Characters.
(i) Query to display all the records.

35. (a) What is the difference between 'w' and 'a' modes? 1+1+2
Anshuman is a Python learner, who has assigned a task to write python
Codes to perform the following operations on binary files. Help him in writing codes to
perform following tasks (b) & (c):
(b) Write a statement to open a binary file named SCHOOL.DAT
in read mode. The fileSCHOOL.DAT is placed in D: drive.
(c) Consider a binary file “employee.dat” containing details such
as empno:ename:salary (separator ':'). Write a python function
to display details of those employees who are earning between 20000 and 30000 (both
values inclusive).
SAMPLE PAPER SET 14
CLASS – XII SUBJECT: Computer Science-083
Total Time- 3 Hours Total Marks- 70
------------------------------------------------------------------------------------------------------------------------------------------

General Instructions:
1. This question paper contains five sections, Section A to E.
2. All questions are compulsory.
3. Section A have 18 questions carrying 01 mark each.
4. Section B has 07 Very Short Answer type questions carrying 02 marks each.
5. Section C has 05 Short Answer type questions carrying 03 marks each.
6. Section D has 03 Long Answer type questions carrying 05 marks each.
7. Section E has 02 questions carrying 04 marks each. One internal choice is given in Q35 against part c only.
8. All programming questions are to be answered using Python Language only.

Question Part A Marks


No.
Select the most appropriate option out of the options given for each question.
Attempt any 15 questions from question no 1 to 21.
1 Find the invalid identifier from the following: 1
A. MyName B. true C. 2ndName D. My_Name

2 Given the lists L=[1,3,6,82,5,7,11,92],the output of print(L[2:5])is 1


A. [3,6,82] B. [6,82,5] C. [6,5,11] D. [6,82,5,7]

3 Write a statement in Python to open a text file “ABC.TXT” in reading mode. 1

4 What will be the output of: print (10>20)? 1

5 Suppose a tuple T is declared as T = (10, 20, 30, 40), 1


what will be the output of print(T*2)
6 Write the output of following code: 1
d={'amit':19,'vishal':20}
print(d.keys())

7 A tuple is declared as T = (20,5,16,29,83) What will be the problem with the code 1
T[1]=100

8 Name the built-in mathematical function / method that is used to return greatest 1
common divisor of x and y.
9 Identify the data type of X: 1
X = tuple(list( (1,2,3,4,5) ) )

Dictionary (b) string (c) tuple (d) list


10 Name the protocol that is used to upload and download files on internet 1

11 Sunita executes following two statements but got the variation in result 6 and 5 why? 1
(i) select count(*) from user ;
(ii) select count(name) from user ;

12 What is the difference between where and having in SQL. 1

13 Write a command to add new column marks in table ‘student’ data type int. 1

14 Define: 1) Field 2) Record 1

15 What is Null Value. 1

16 Patterns in SQL are described using two special wild card


characters such as ………………………. And …………………

Directions: In the following Qs, A statement of Assertion (A) is followed by a 1


statement of Reason (R). Mark the correct choice as:
a) Both A and R are true and R is the correct explanation for A.
b) Both A and R are true and R is not correct explanation for A.
c) A is true but R is false.
d) A is false but R is true.
e) Both A and R are false

17 Assertion (A): writerow( ) function helps us to write multiple rows in a csv file at a 1
time.
Reason (R) : Writing one row at a time in a csv file is not possible, we must write
multiple rows at a time.

18 Assertion (A) : With statement can be used to open any file, be it csv file or 1
binary file and while using with statement to open any file there is no need to close the
file.

Reason (R) : With statement groups all the statements related to file handling and
makes sure to close the file implicitly. It closes the file even when any error occurs
during the execution of statements in a with statement.

Both the Case study based questions are compulsory.

Attempt any 4 sub parts from each question. Each question carries 1 mark
19 A school KV is considering to maintain their eligible students’ for scholarship’s data using SQL 4
to store the data. As a database administer, Abhay has decided that:
• Name of the database - star
• Name of the table - student
• The attributes of student table as follows:
No. - numeric
Name – character of size 20
Stipend - numeric
Stream – character of size 20
AvgMark – numeric
Grade – character of size 1
Class – character of size 3

Table ‘student’
No. Name Stipend Stream Avgmarks Grade Class
1 Karan 400.00 Medical 78.5 B 12B
2 Divakar 450.00 Commerce 89.2 A 11C
3 Divya 300.00 Commerce 68.6 C 12C
4 Arun 350.00 Humanities 73.1 B 12C
5 Sabina 500.00 Nonmedical 90.6 A 11A
6 John 400.00 Medical 75.4 B 12B
7 Robert 250.00 Humanities 64.4 C 11A
8 Rubina 450.00 Nonmedical 88.5 A 12A
9 Vikas 500.00 Nonmedical 92.0 A 12A
10 Mohan 300.00 Commerce 67.5 C 12C

A) Write query to create table.


B) Which column is suitable to be a primary key attribute.
C) What is the degree and cardinality of table student?
D) Display the details of student in ascending order of name.
E) Write query to change the grade of karan from ‘B’ to ‘A’
20 Ranjan Kumar of class 12 is writing a program to create a CSV file “user.csv” which will 4
contain user name and password for some entries. He has written the following code. As a
programmer, help him to successfully execute the given task.
import # Line 1
def addCsvFile(UserName,PassWord): # to write / add data into the CSV
file f=open(' user.csv',' ') # Line 2
newFileWriter = csv.writer(f)
newFileWriter.writerow([UserName,PassWord])
f.close()

#csv file reading code


def readCsvFile(): # to read data from CSV file
with open(' user.csv','r') as newFile:
newFileReader = csv. (newFile) # Line 3
for row in newFileReader: print (row[0],row[1])
newFile. # Line 4
addCsvFile(“Arjun”,”123@456”)
addCsvFile(“Arunima”,”aru@nima”)
addCsvFile(“Frieda”,”myname@FRD”)
readCsvFile() #Line 5
(a) Name the module he should import in Line 1.

(b) In which mode, Ranjan should open the file to add data into the file.

(c) Fill in the blank in Line 3 to read the data from a csv file.

(d) Fill in the blank in Line 4 to close the file.

(e) Write the output he will obtain while executing Line 5

21 Evaluate the following expression. 2

a) 6 * 3 + 4**2 // 5 – 8

b) 10 > 5 and 7 > 12 or not 18 > 3


22 What do you mean by keyword argument in python? Describe with example. 2
OR

What is scope of a variable in python and write basic scopes of variables in Python
23 Rewrite the following code in python after removing all syntax errors. Underline each 2
correction done in the code:

Def func(a):
for i in (0,a):
if i%2 =0:
s=s+1
else if i%5= =0
m=m+2
else:
n=n+i
print(s,m,n)
func(15)
24 What possible outputs(s) are expected to be displayed on screen at the time of execution of 2
the program from the following code. Select which option/s is/are correct import random
print(random.randint(15,25) , end=' ')
print((100) + random.randint(15,25) , end = ' ' )
print((100) -random.randint(15,25) , end = ' ' )
print((100) *random.randint(15,25) )
(i) 15 122 84 2500 (ii) 21 120 76 1500
(iii) 105 107 105 1800 (iv) 110 105 105 1900
OR
Predict the output of the following code.
def swap(P ,Q):
P,Q=Q,P
print( P,"#",Q)
return (P)
R=100
S=200
R=swap(R,S)
print(R,"#",S)

25 What is the significance of connect() and execute(). 2

26 Write the steps to perform an Insert query in database connectivity application. Table 2
‘student’ values are rollno, name, age (1,’AMIT’,22)
27 Define: 2
1. Repeater 2. Router
28 Differentiate between web server and web browser. Write name of any two browsers. 2
29 Write a function listchange(Arr)in Python, which accepts a list Arr of numbers, the function 3
will replace the even number by value 10 and multiply odd number by 5. Sample Input Data
of the list is:
a=[10,20,23,45]
listchange(a,4)
output : [10, 10, 115, 225]
30 Write a Python program to find the number of lines in a text file ‘abc.txt’. 3

OR

Write a Python program to count the word “if” in a text file abc.txt’.

31 Write the outputs of the SQL queries (i) to (iii) based on the relations Client and Product given 3
below:
Client:
C_ID ClientName City P_ID
01 Cosmetic Shop Delhi TP01
02 Total Health Mumbai FW05
03 Live Life Delhi BS01
04 Pretty Woman Delhi SH06
05 Dreams Delhi TP01

Products:
P_ID ProductName Manufacturer Price Discount
TP01 Talcum LAK 40
Powder
FW05 Face Wash ABC 45 5
BS01 Bath Soap ABC 55
SH06 Shampoo XYZ 120 10
FW06 Face Wash XYZ 95

A) SELECT count(discount) FROM Product ;


B) SELECT Manufacturer, Max(Price), Min(Price) FROM Product group by manufacturer;
C) SELECT ProductName, Client.ClientName FROM Product, Client WHERE Product.P_ID
= Client.P_ID AND Client.City=” Mumbai”;
32 Write a function in python, PushEl(e) to add a new element and PopEl(e) to delete a element 3
from a List, considering them to act as push and pop operations of the Stack data structure.
OR
Write a function in Python, Push(SItem) where , SItem is a dictionary containing the details of
stationary items– {Sname:price}. The function should push the names of those items in the
stack who have price greater than 75. Also display the count of elements pushed into the
stack.
For example: If the dictionary contains the following data:
Ditem={"Pen":106,"Pencil":59,"Notebook":80,"Eraser":25}
The stack should contain:
Notebook Pen
The output should be: The count of elements in the stack is 2

33 Differentiate between a text file, a binary file and a csv file. 3


34 The code given below inserts the following record in the table Student: 3

RollNo – integer
Name – string
Clas – integer
Marks – integer

Note the following to establish connectivity between Python and MYSQL:


• Username is root
• Password is tiger
• The table exists in a MYSQL database named school.
• The details (RollNo, Name, Clas and Marks) are to be accepted from the user.

Write the following missing statements to complete the code:


Statement 1 – to form the cursor object
Statement 2 – to execute the command that inserts the record in the table Student.
Statement 3- to add the record permanently in the database

import mysql.connector as mysql


def sql_data():
con1=mysql.connect(host="localhost",user="root",password="tiger",database="school")
mycursor= #Statement 1
rno=int(input("Enter Roll Number :: "))
name=input("Enter name :: ")
class=int(input("Enter class :: "))
marks=int(input("Enter Marks :: "))
querry="insert into student values({},'{}',{},
{})".format(rno,name,clas,marks)
#Statement 2
# Statement 3
print("Data Added successfully")

35 My Pace University is setting up its academic blocks at Naya Raipur and is planning to set up a 5
network. The University has 3 academic blocks and one Human Resource Center as shown in
the diagram below:

Center to Center distances between various blocks/center is as follows:


Law Block to Business Block 40m
Law Block to Technology Block 80m
Law Block to HR Center 105m
Business Block to Technology Block 30m
Business Block to HR Center 35m
Technology Block to HR Center 15m

No of computers in each block:


Law Block 15
Technology Block 40
HR Center 115
Business Block 25
36 5

A binary file “STUDENT.DAT” has structure (admission_number, Name, Percentage). Write a

function countrec() in Python that would read contents of the file “STUDENT.DAT” and

display the details of those students whose percentage is above 75. Also display number of

students scoring above 75%.

OR
A binary file “Stu.dat” has structure (rollno, name, marks). (i) (ii)

I) Write a function in Python add_record() to input data for a record and add to

Stu.dat.

II) Write a function in python Search record() to search a record from binary file

“Stu.dat” on the basis of roll number.

*****
SAMPLE PAPER SET 15
CLASS – XII SUBJECT: Computer Science-083
Total Time- 3 Hours Total Marks- 70
General Instructions:
1. This question paper contains five sections – A to E
2. All questions are compulsory
3. Section A, consists of 18 questions carrying 1 marks each.
4. Section B has 07 Very Short Answer type questions carrying 02 marks each.
5. Section C has 05 Short Answer type questions carrying 03 marks each.
6. Section D has 03 Long Answer type questions carrying 05 marks each.
7. Section E has 02 questions carrying 04 marks each. One internal choice is given in Q35 against c
part only.
8. All programming questions are to be answered using Python Language only`

Section-A
(Each question carries 1 mark from question no. 1 to 16)
Q. NO. QUESTION MAR
KS
1 Which of the following is an invalid variable? 1
(a) hello_world_2
(b) 2_hello_world
(c) day_two
(d) _2
2 What data type is the object below? 1
L=1, 'hello',23.5
(a) List
(b) dictionary
(c) tuple
(d) array

3 Which of the following function headers is correct? 1


(a) def f(a=2,b):
(b) def f(a=3,b,c=6):
(c) def f(a=3,b=1,c=6):
(d) def f(a=3,b=1,c=6,d):
4 Which of the following random module functions generated a floating point number? 1
(a) random()
(b) randint()
(c) uniform()
(d) all of these
5 Which of the following is not a valid mode to open a file? 1
(a) wb+
(b) rw
(c) ab
(d) r+
6 What is the use of return statement in function ? 1

7 Which function in sql is used to calculate average from column ? 1


8 What will be the output of the following Python code? 1
l=[1,2,3,4,5]
l[1:2]=[7,8]
print(l)
(a) [1,2,3,4,5]
(b) [1, 7, 8, 3, 4, 5]
(c) [1, [7, 8], 3, 4, 5]
(d) Syntax error
9 In a stack, deletions take place at end. 1
(a) front
(b) top
(c) rear
(d) any
10 A device that forwards data packet from one network to another is called a 1
(a) Bridge
(b) Router
(c) Hub
(d) Gateway
11 Which of the following is not a legal sub-language of SQL? 1
(a) DDL
(b) DML
(c) TCL
(d) AQL
12 clause of the following query must be added with keyword to display the 1
fields given in the select list as per a given condition.
select id,name,salary*1.1 where instructor=10005;
(a) where, having
(b) select, from
(c) where, from
(d) where,select

13 Consider the following SQL statement. What type of statement is this? 1


insert into instructor values(10211,'Amit','Science',6600);
(a) DDL
(b) DML
(c) DCL
(d) TCL
14 The following SQL is which type of join: 1
select customer.cust_id,order.cust_id,name, order_id from customer, order
(a) Equijoins
(b) Natural join
(c) Outer join
(d) Cartesian Product
15 A database is a special control structure that facilitates the row by row 1
processing of records in the resultset.
(a) fetch
(b) table
(c) cursor
(d) query
16 Which of the following attributes cannot be considered as a choice for primary key? 1
(a) id
(b) License number
(c)Street no
(d) dept_id

(Assertion Reasoning type question - Each question carries 1 marks from question no.
17 to 18)

Q17: Assertion(A): The programming expression int('12.5') results in error. 1


Reason(R): The literal value for int() with base 10: '12.5' is valid.
(a) Both A and R are true and R is the correct explanation of A.
(b) Both A and R are true, but R is not the correct explanation of A.
(c) A is true, but R is false.
(d) A is false, but R is true.

Q18: Assertion(A): To remove the middle element 3 from the list L= [1,2,3,4,5] the statement 1
L.remove (3) can be used.
Reason(R): The function remove will delete the element 4 in the list as it is placed on the
index no 3.
(a) Both A and R are true and R is the correct explanation of A.
(b) Both A and R are true, but R is not the correct explanation of A.
(c) A is true, but R is false.
(d) A is false, but R is true.

Section-B
(Very short answer question -Each question carries 2 marks from question no. 19 to 26)

19 Write the output of the following line of code: 2


a=10
def call():
global a
a=15
b=20
print(a)
call()
print(a)
20 What is a Python module? What is its significance? 2
21 Differentiate between read() and readlines() function. 2
22 Enlist two operations performed on stacks. Why is stack called a LIFO data structure? 2

23 Expand the following terms with respect to Networking: 2


(i) MODEM
(ii) WLL
(iii) FTP
(iv) TCP/IP
24 A teacher provides “https://www.youtube.com/watch?v=90ORfh6a-kM” to his /her 2
students. Help them to identify the URL and domain Name.
25 Differentiate between Candidate Key and Alternate Key in context of RDMS. 2
26 What is wrong with the following statement? 2
Select * from employee where grade= NULL;
Write the corrected form of above SQL statement.
Section-C
(Short answer question -Each question carries 3 marks from question no. 27 to 32)
27 Write a method/ function DISPLAYWORDS() in python to read lines from a text file 3
ABC.TXT, and display those words that are greater than 5 characters.
28 Write a function that takes two numbers and return that has maximum one’s digit. 3
(for eg if 491 and 278 are passed it will return 278 as it has got maximum one’s digit)
29 Predict the output. 3
(i)L=[1,4,9,16,35,27]
l=[num/3 for num in L if num%3==0]
print(l)
(ii) [x+y for x in 'ball' for y in 'boy']
(iii) l=[1,2,5,6,7,9,10,22,38]
k=[e1*r for e1 in l if (e1-4)>1 for r in l[:4]]
print(k)
30 Write PUSH(City) and POP(City) methods in Python to add city and remove city 3
considering them to act as Push and Pop operations of data structure Stack.
31 Consider the following dept and worker tables. Find outputs for sql queries (i) to (iii): 3

i) select count(*), DCODE from WORKER group by DCODE having count(*)>1;


ii) select distinct DEPARTMENT from DEPT;
iii) select NAME, DEPARTMENT, CITY from WORKER w, DEPT d where
w.DCODE=d.DCODE and WNO<1003;

32 Which functions can be used as the group functions? What is the use of GROUP BY 3
clause? How are they useful?
Section-D
(Long answer -Each question carries 5 marks from question no. 33 to 34)
33 Write a program to get student data (rollno., name and marks) from user until user 5
wants to add data. Then search for records with roll no 12 or 14. If found display the
records else display an appropriate message.

34 (a) Give one advantage and one disadvantage of optical fibre cable. 5
(b) Differentiate between Tree and Bus topologies of network.
(c) What do email and FTP mean?
(d) Differentiate between repeater and bridge.
(e) Give full form of NFS and FTP.

Section-E
(Case –Study Questions -Each question carries 4 marks from question no. 35 to 36)
35 Rohit, a student of class 12, is learning CSV File Module in Python. During examination, 4
he has been assigned an incomplete python code (shown below) to create a CSV File
'Student.csv' (content shown below). Help him in completing the code which creates the
desired CSV File. Do any 4 out of 5.
CSV File
1,AKSHAY,XII,A
2,ABHISHEK,XII,A
3,ARVIND,XII,A
4,RAVI,XII,A
5,ASHISH,XII,A

Incomplete Code
import #Statement-1
fh = open( , , newline='') #Statement-2
stuwriter = csv. #Statement-3
data = [ ]
header = ['ROLL_NO', 'NAME', 'CLASS', 'SECTION']
data.append(header)
for i in range(5):
roll_no = int(input("Enter Roll Number : "))
name = input("Enter Name : ")
Class = input("Enter Class : ")
section = input("Enter Section : ")
rec = [ ]#Statement-4
data.append( ) #Statement-5
stuwriter. (data) #Statement-6
fh.close()
(i) Identify the suitable code for blank space in the line marked as Statement-1.
(ii) Identify the missing code for blank space in line marked as Statement-2.
(iii) Write the function name (with argument) that should be used in the blank space of
line marked as Statement-3. OR Identify the suitable code for blank space in line marked
as Statement-4.
(iv) Identify the suitable code for blank space in the line marked as Statement-5
36 Write SQL commands for the following queries (i) to (iv) based on the relations Shoppe 4
and Accessories given below:

(i)to display name and price of all the accessories in descending order of their price.
(ii)to display id and sname of all shoppe located in nehru place.
(iii) to display minimum and maximum price of each name of accessories.
(iv) to display name, price of all accessories and their respective sname where they
are available.

You might also like