CS_Pre_Board_1_Exam_Class_XII_Session-2022-23
CS_Pre_Board_1_Exam_Class_XII_Session-2022-23
SECTION A
1. Is Python case sensitive when dealing with identifiers? 1
(a)Yes (b)No (c)Machine dependent (d)None of these
2. Which of the following is an ordered data type? 1
(a)integer (b)Boolean (c)tuple (d)float
3. Which of the following will delete key: value pair for key = ‘tiger’ in dictionary? 1
(a)del di[‘tiger’] (b)di[‘tiger’].delete() (c)delete di.[‘tiger’])
(d)del(di.[‘tiger’])
4. Consider the given expression: 1
"abc"=="Abc" and not (2==3 or 3==4)
Which of the following will be correct output if the given expression is evaluated?
(a) True (b) False (c) NONE (d) NULL
5. Select the correct output of the code: 1
a = "I enjoy working in Python"
b = a.partition(‘working’)
print(b)
(a)(‘I enjoy’, ‘working’, ‘in Python’) (b)[‘I’, ‘enjoy’, ‘working’, ‘in’, ‘Python’]
(c)(‘I’, ‘enjoy’, ‘in Python’) (d)None of these
6. Which of the following is not a valid mode to open a file? 1
(a)wb+ (b)w (c)wb (d)w+
7. ___________command is used to rename column of table in SQL. 1
(a)insert (b)rename (c)alter (d)changename
8. Which of the following commands do we use to delete all the tuples from a relations (R)? 1
(a)DELETE TABLE R; (b)DROP TABLE R; (c)DELETE FROM R;
(d)DROP FROM R;
9. Which of the following statement(s) would give an error after executing the following code? 1
S="PRE-BOARD EXAM FOR CLASS XII" # Statement 1
print(S) # Statement 2
S="BEST OF LUCH" # Statement 3
S[0]= '$' # Statement 4
S = S + "WELCOME" # Statement 5
2
Or
Write difference between HTML and XML.
21 Explain the use of ‘Primary Key’ in a Relational Database Management System. Give 2
example to support your answer.
22 (i) Write full forms of the following: 2
(a)SMTP (b)PPP
(ii)What is the use of DHCP?
23 Predict the output of the Python code given below: 2
(
a) SELECT START, END FROM TRAVEL WHERE FARE <= 4000 ;
(b) SELECT T_ID, FARE FROM TRAVEL WHERE T_DATE LIKE '2021-12-%' ;
(c) SELECT T_ID, T_DATE FROM TRAVEL WHERE END = 'CHENNAI' ORDER BY
4
FARE ;
(d) SELECT START, MIN(FARE) FROM TRAVEL GROUP BY START ;
(ii) Observe the following table carefully and write the names of the most appropriate 1
columns, which can be considered as (i) candidate keys
27 Write a method/function Words() in Python to read contents from a text file ZIP.TXT, to 3
count and display the occurrence of those words, which are having more than 4 alphabets.
For example :
If the content of the file is
She started to work there
Right now, we looking forward to get you renowned
The output of the function should be: 7
28 (i)Consider the following DEPT and EMPLOYEE tables. Write SQL queries for (i) to (iii). 2
Table : DEPT +
1
Note : DOJ refers to date of joining and DOB refers to date of Birth of employees.
(a) To display Eno, Name, Gender from the table EMPLOYEE in ascending order of Eno.
(b) To display the Name of all the MALE employees from the table EMPLOYEE.
(c) To display the Eno, Name, Department, Location of those employees from the table
EMPLOYEE who are born between ‘1987-01-01’ and ‘1991-12-01’.
(d) To count and display FEMALE employees who have joined after ‘1986-01-01’.
(ii)Write a SQL command to list all tables in a database.
29 (i)What are the possible outcome(s) executed from the following code? Also specify the 3
maximum and minimum values that can be assigned to variable N.
5
(ii)Write a line of code that writes “Hello World!” to a file opened with file object myfile.
30 Write the definition of a user defined function Push35(N) which accepts a list of 3
integers in a parameter N and pushes all those integers which are divisible by 3 and
divisible by 5 from the list N into a list named Only35.
Write a program in Python to input 10 integers into a list named NUM.
The program should then use the function Push35() to create the stack of the list Only35.
Thereafter pop each integer from the list Only35 and display the popped value. When the list
is empty, display the message “StackEmpty”.
For example:
If the integers input into the list NUM are:
[10,6,14,18,30,21,45,60, 65,90]
Then the stack Only35 should store
[30, 45, 60, 90]
And the output should be displayed as
30 45 60 90 StackEmpty
31 Xcelencia Edu Services Ltd. is an educational organization. It is planning to set up its India 5
campus at Hyderabad with its head office at Delhi. The Hyderabad campus has 4 main
buildings - ADMIN, SCIENCE, BUSINESS and ARTS. You as a network expert have to
suggest the best network related solutions for their problems raised in (i) to (v), keeping in
mind the distances between the buildings and other given parameters.
6
(a) Suggest the most appropriate location of the server inside the HYDERABAD campus (out
of the 4 buildings), to get the best connectivity for maximum number of computers. Justify
your answer.
(b) Suggest and draw the cable layout to efficiently connect various buildings within the
HYDERABAD campus for connecting the computers.
(c) Which hardware device will you suggest to be used in all buildings to connect all
computers.
(d) Which of the following will you suggest to establish the online face-to-face
communication between the people in the Admin Office of HYDERABAD campus and
DELHI Head Office?
(i) E-mail
(ii) Text Chat
(iii) Video Conferencing
(iv) Cable TV
(e)Which hardware device will you suggest to be procured by the company to be installed to
protect and control the internet uses within the campus?
32 (a)Write the output of the code given below: 2
+
3
(b) The code given below reads the following record from the table named student and
displays only those records who have marks greater than 75:
RollNo – integer
7
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.
Write the following missing statements to complete the code:
Statement 1 – to form the cursor object
Statement 2 – to execute the query that extracts records of those
students whose marks are greater than 75.
Statement 3- to read the complete result of the query (records whose marks are greater than
75) into the object named data, from the table student in the database.
33 Give any one point of difference between a binary file and a csv file. Write a Program in 5
Python that defines and calls the following user defined functions:
(i) add() – To accept and add data of an employee to a CSV file ‘furdata.csv’. Each record
consists of a list with field elements as fid, fname and fprice to store furniture id, furniture
name and furniture price respectively.
(ii) search()- To display the records of the furniture whose price is more than 10000.
SECTION E
34 (i)Rashmi has forgotten the names of the databases, tables and the structure of the tables that 4
she had created in Relational Database Management System (RDBMS) on her computer.
(a) Write the SQL statement to display the names of all the databases present in RDBMS
application on her computer.
(b) Write the statement which she should execute to open the database named "STOCK".
(c) Write the statement which she should execute to display the structure of the table
"ITEMS" existing in the above opened database "STOCK".
(ii)A SQL table BOOKS contains the following column names :
BOOKNO, BOOKNAME, QUANTITY, PRICE, AUTHOR Write the SQL statement to add a
new column REVIEW to store the reviews of the book.
35 Rohit, a student of class 12th, is learning CSV File Module in Python. During examination, 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.
8
(i) Identify the suitable code for blank space in line marked as Statement-1. Identify the 1
missing code for blank space in line marked as Statement-2?
(ii)Choose the function name (with argument) that should be used in the blank space of line 1
marked as Statement-3
(iii) Identify the suitable code for blank space in line marked as Statement-4. 1
(iv)Write the function name that should be used in the blank space of line marked as 1
Statement-5 to create the desired CSV File?