0% found this document useful (0 votes)
24 views6 pages

12 CS Board Set 1 QP

Uploaded by

myappagreat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views6 pages

12 CS Board Set 1 QP

Uploaded by

myappagreat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Class: XII Session: 2022-23

Computer Science (083) 6. If a text file is opened in w+ mode, then what is the initial position of file 1
pointer/cursor?
Sample Question Paper (Theory)
(a) Beginning of file (b) End of the file
Maximum Marks: 70 Time Allowed: 3 hours (c) Beginning of last line of text file (d) Undetermined
General Instructions:
7. Fill in the blank: 1
1. This question paper contains five sections, Section A to E.
2. All questions are compulsory. Keyword is used to set foreign key in SQL.
3. Section A have 18 questions carrying 01 mark each.
4. Section B has 07 Very Short Answer type questions carrying 02 marks each. (a) foreign key (b)unique (c) references (d)primary
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. 8. Which of the following commands will change the datatype of the table in 1
7. Section E has 02 questions carrying 04 marks each. One internal choice is MYSQL?
given in Q35 against part c only. (a) DELETE TABLE
8. All programming questions are to be answered using Python Language only.
(b) DROP TABLE
(c) REMOVE TABLE
(d) ALTER TABLE
SECTION A
1. Which of the following is an invalid statement? 1 9. For a user defined function with header 1
a. abc=1,000,000 c. a b c=100 200 300 def start (x, y, z=10),
b. a, b, c= 100,200,300 d. a=b=c=100 Which of the following function call statements will generate an
2. Which of the following operators has the highest precedence? 1 error?
(a) << (b) ** (c)% (d)and
(a) start(10) (b) start(x = 10,y = 20)
3. What will be the output of the following Python code snippet? 1 (b) start(y = 20, x = 10) (d) All of the above
d1 = {"john":40, "peter":45}
d2 = {"john":466, "peter":45} 10. Fill in the blank: 1
d1 > d2 _______________ refers to a situation of keeping the same data in different
a) True formats in two different tables
b) False (a) data redundancy
c) Error (b) data privacy
d) None (c) data inconsistency
4. What will be the value of the given expression? 1 (d) data integrity
3+3.00, 3**3.0 11. What is the binary file mode associated with “file must exist, otherwise error will 1
(a) (6.0, 27.0) be raised and reading and writing can take place”?
(b) (6.0, 9.00) (a) ‘wb+’ (b) ‘w+’ (c) ‘rb’ (d) ‘rb+’
(c) (6,27)
(d) [6.0,27.0] 12. Fill in the blank: 1
(e) [6,27] Group by clause uses ______________ clause to apply conditions on aggregate
5. Select the correct output of the code: 1 rows
(a) where (b) order by (c) sort (d) having
a = "foobar"
13. Fill in the blank: 1
a = a.partition("o")
What kind of transmission medium is most appropriate to carry data in a
(a) ["fo","","bar"] computer network that is exposed to electrical interferences?
(b) ["f","oo","bar"]
(c) ["f","o","bar"] a. Unshielded twisted pair b. Optical fiber c. Coaxial cable d. Microwave
(d) ("f","o","obar")
14. If x = 12 and y = ‘12’, then what will be the output of the following code? 1 1
print(x*2, y*2, sep="") (b) Sum = 0
for k in range(10 , 1, -2):
(a) 2424 (b) 24 24 (c) 241212 (d) 24 1212 Sum = Sum+k
print(Sum)
22. Explain the referential integrity constraint. What conditions must be met in 2
15. Which of the following is not a built in aggregate function in SQL? 1 order to set referential integrity?
23. (a) Write the full forms of the following: 2
a) avg b) max c) total d) count
(i) CDMA (ii) SLIP

16. Name the method which is used for displaying only one resultset. 1 (b) What is the use of HTTP?
(a) fetchmany (b) fetchno (c) fetchall (d) fetchone 24. Predict the output of the Python code given below: 2
def modifyList(x):
Q17 and 18 are ASSERTION AND REASONING based questions. Mark the x.append(sum(x))
correct choice as print(x, end= ‘ ’)
a. Both A and R are true and R is the correct explanation for A L = [1,2,3,4]
b. Both A and R are true and R is not the correct explanation for A
print(L, end= ‘ ’)
c. Both A and R are false.
d. A is True but R is False modifyList(L)
e. A is false but R is True print(L)
OR
17. Assertion (A): Parameters with default arguments can be followed by 1
parameters with no default argument. Predict the output of the Python code given below:
Reason (R): Syntactically, it would be impossible for the interpreter to decide l1 = [10,15,16,18,20]
which values match which arguments if mixed modes were allowed while l1.remove(15)
providing default arguments. l1.insert(1,30)
print (l1[::-2])
18. Assertion (A): Local Variables are accessible only within a function or block in 1
which it is declared 25. 2
Reason (R): Global variables are accessible in the whole program.

SECTION B

19. Correct the following code segment: 2


DEF say(message, times = 1)
print(message * times , end : ’ ‘)
say(times=10, ‘Hello and’)
say('World')

20. Write two points of difference between Circuit Switching and Packet Switching. 2
OR (a) Find the Degree and Cardinality of the Cartesian product of the
Supplier and Product relations.
Write two points of difference between Coaxial and fiber. (b) Identify the foreign key in the given tables, also mention in which table
21. Find the output. 1 it is appearing as a foreign key?
(a) def example(a):
a = a+2 OR
a=a*2
Find output:
return a
(a) select *from product p, supplier s where p.supcode=s.supcode;
>>>print(example("hello")) (b) select *from product natural join supplier;
SECTION C
26 (a) Create the connection of Python with MYSQL, in which (1) 1+2 Table: Employee
User=Admin Password= Admin2123 Database Name=System

(b) Write the output of the queries (a) to (d) based on the table, Staff given
below:

Table: Staff

Help him to complete the task by suggesting appropriate SQL commands.

29. Write a function merge_tuple(t1,t2), where t1 and t2 are the tuples of elements 3
passed as argument to the function. The function returns another tuple named that
stores the sum of consecutive element of t1 and t2, only if they are of same length
else return -1

For example:
(a) Select avg(exp) from staff where gender = ‘F’;
T1=(1,2,3,4)
(b) Select min(doj) from staff;
T2=(5,6,7,8)
(c) Select *from staff where gender!=’M’ and dept like ‘_ _ _ _ _’; Then function should return
(d) Select name, doj from staff where dept not in (‘Finance’,’Sales’); (6,8,10,12)
27. Assume that a text file named TEXT1.TXT already contains some text written 3
into it, write a program with a function named vowelwords(), that reads the file And if
TEXT1.TXT and create a new file named TEXT2.TXT , which shall contain T1=(1,2,3)
T2=(5,6,7,8)
only those words from the
Then function should return
file TEXT1.TXT which don’t start with an uppercase vowel(i.e. with -1
‘A’,’E’,’I’,’O’,’U’)
30. Rajiv has created a dictionary containing employee names and their salaries as 3
for example if the file TEXT1.TXT contains key value pairs of 6 employees.
Carry Umbrella and Overcoat When it Rains Write a program, with separate user defined functions to perform the following
operations:
then the file TEXT2.TXT shall contain
● Push the keys (employee name) of the dictionary into a stack, where the
Carry and when it Rains. corresponding value (salary) is less than 85000.
● Pop and display the content of the stack.
OR For example:
If the sample content of the dictionary is as follows:
Write a Python program to count all the line having 'a' as last character.
Emp={"Ajay":76000, "Jyothi":150000, "David":89000, "Remya":65000,
28. Dileep has to create a database named Company in MYSQL. 3
"Karthika":90000, "Vijay":82000}
He now needs to create a table named Employee in the database to store the
records of employees in the company. The table Employee has the following The output from the program should be:
structure: Vijay Remya Ajay

OR
Aruna has a list containing temperatures of 10 cities. You need to help her create
a program with separate user defined functions to perform the following
operations based on this list.
● Traverse the content of the list and push the negative temperatures into a stack. (d) Suggest a device that can provide wireless Internet access to all
● Pop and display the content of the stack. smartphone/laptop users in the campus of Excel Public School,
For Example: Coimbatore.
If the sample Content of the list is as follows: (e) Draw suitable layout to connect all four wings of Excel Public School
T=[-9, 3, 31, -6, 12, 19, -2, 15, -5, 38]
Sample Output of the code should be: 32. (a) Write the output of the code given below: 2+3
-5 -2 -6 -9
x = 10
def localvar():
SECTION global x
D x+=5
31. Excel Public School, Coimbatore is setting up the network between its 5 print(x, end=' ')
different print(x+5, end=' ')
wings of school campus. There are 4 wings namely SENIOR(S), JUNIOR localvar()
(J), print(x, end=' ')
ADMIN (A) and HOSTEL (H).

(b) following code establishes connectivity between Python and MYSQL:

____________________ #statement 1
dataBase = mysql.connector.connect(
host ="localhost",
user ="user",
passwd ="password",
database = "gfg"
)

# preparing a cursor object


cursorObject = ____________________ #statement 2
Distances between various wings are given below:
Wing A to Wing S 100m # creating table
Wing A to Wing J 200m studentRecord = """CREATE TABLE STUDENT (
Wing A to Wing H 400m NAME VARCHAR(20) NOT NULL,
BRANCH VARCHAR(50),
Wing S to Wing J 300m
ROLL INT NOT NULL,
Wing S to Wing H 100m SECTION VARCHAR(5),
Wing J to Wing H 450m AGE INT
Number of Computers installed at various wings are as follows: )"""
Wings Number of Computers
Wing A 20 # table created
Wing S 150 cursorObject.________________________ #statement 3
Wing J 50
# disconnecting from server
Wing H 25 dataBase.close(
(a) Suggest the best-wired medium and mention the topology or
layout to connect various wings of Excel Public School, Write the following missing statements to complete the code: Statement 1
– to import requisite module
Coimbatore.
Statement 2 – to form the cursor object
(b) Name the most suitable wing to house the server. Justify your Statement 3- to execute the command that creates table
answer.
(c) Suggest placement of HUB/SWITCH in the network of the
School.
33. What is the advantage of using a csv file for permanent storage? 5 (a) what will be the degree and cardinality of the resulting relation after Cartesian
Write a program to product of above relations?
(a) add/insert records in file “data.csv”. Structure of a record is roll number,
name and class. (b) what will be the degree and cardinality of the resulting flight after addition of
(b) search and display record for a given class two rows and deletion of one column?
OR (c) (i) Write a query to display the NAME, corresponding FARE and F_DATE
of all PASSENGERS who have a flight to START from DELHI.
A binary file “emp.dat” has structure [EID, Ename, designation, salary].
(ii) Write a query to delete the records of flights which end at Mumbai.
I.Write a user defined function CreateEmp() to input data for a record and add to OR
emp.dat.
(c) create a new table traveller having same fields and tuples as passenger.
II.Write a function display() in Python to display the detail of all employees. 35. Sudev, a student of class 12th, is learning CSV File Module in Python. During 5
examination, he has been assigned an incomplete python code to create a CSV file
‘customer.csv’. Help him in completing the code which creates the desired CSV
file.

SECTION
E
34 Write SQL queries for (a) to (d) based on the tables PASSENGER and 1+1+2
FLIGHT given below:
I. Identify suitable code for the blank space in line marked as Statement-
a) include
b) add
c) Import
d) import
II. Identify the missing code for the blank space in line marked as Statement-2.
a) Customer
b) reader
c) csvwriter
d) writer
III. Identify the argument name for the blank space in line marked as Statement-3?
a) Row
b) Rec
c) row
d) rec
IV. Identify the missing file name for the blank space in line marked as Statement-
4?
a) customer
b) customer.csv
c) customer.txt
d) customer.dat
V. Identify the object name for the blank space in line marked as Statement-5?
a) i
b) Rec
c) row
d) rec

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy