Students can access the CBSE Sample Papers for Class 12 Computer Science with Solutions and marking scheme Term 2 Set 2 will help students in understanding the difficulty level of the exam.

CBSE Sample Papers for Class 12 Computer Science Term 2 Set 2 with Solutions

Time: 2 Hours
Maximum Marks: 35

General Instructions:

  • The question paper is divided into 3 sections – A, B and C
  • Section A, consists of 7 questions (1 – 7). Each question carries 2 marks.
  • Section B, consists of 3 questions (8 – 10). Each question carries 3 marks.
  • Section C, consists of 3 questions (11 – 13). Each question carries 4 marks.
  • Internal choices have been given for question numbers 7, 8 and 12.

Section – A
(2 Marks Each)

Question 1.
Write the types of operations used in stack.
Answer:
There are two types of operations in Stack:

  • Push- To add data into the stack.
  • Pop- To remove data from the stack.

Question 2.
(a) Expand the following:
(i) GSM
(ii) GPRS
Answer:

  • GSM: Global System for Mobile communication.
  • GPRS: General Packet Radio Service.

CBSE Sample Papers for Class 12 Computer Science Term 2 Set 2 with Solutions

(b) Which type of network out of LAN, PAN and MAN is formed, when you connect two mobiles using Bluetooth to transfer a video?
Answer:
PAN (Personal Area Network)

Question 3.
Differentiate between Cardinality and Degree of a table with the help of an example.
Answer:
Cardinality is defined as the number of rows in a table. Degree is the number of columns in a table.
e.g. consider the following table

Cno Cname
A101 Rahul
A102 Riya
A103 Darsh

Cardinality: 3 Degree: 2

Question 4.
db = MySQLdb.connect(‘localhost’ , ‘LibMan’, ‘isspwd’, ‘Library’)
(a) What is “Library” in the statement?
Answer:
(a) Database name

(b) What is the use of connect()?
Answer:
connect() function is used to connect or establish a connection with My SQL database.

CBSE Sample Papers for Class 12 Computer Science Term 2 Set 2 with Solutions

Question 5.
Write the output of the queries (a) to (d) based on the table, Grocery given below:
Table: Grocery

Pr_Code Pr_Name PrJPrice Pr_Manufac
P101 Toothpaste 99 Dantkanti
PI 02 Soap 20 Lux
P103 Soap 25 Breeze
P104 Detergent 199 Surf Excel
PI 05 Shampoo 345 Loreal

(a) SELECT Pr_Name, Avg(Pr_Price) FROM Grocery Group BY Pr_Name;
Answer:

Pr_Code Avg (Pr_Price)
P101 199.00
PI 02 345.00
P103 22.50
P104 99.00

(b) SELECT DISTINCT Pr_Manufac FROM Grocery;
Answer:

Pr_ Manfac
Dantikanti
Lux
Breeze
Surf Execel
Loreal

(c) SELECT COUNT(DISTINCT Pr_Name) FROM Grocery;
Answer:
4

(d) SELECT Pr_Name, MAX(Pr_Price) , MIN(Pr_Price) FROM Grocery GROUP BY Pr_ Name
Answer:

Pr_Name MAX(Pr_Price) MIN(Pr_Price)
Detergent 199 199
Shampoo 345 345
Soap 25 20
Toothpaste 99 99

Question 6.
(a) MySQL supports different character sets, which command is used to display all character sets?
Answer:
SHOW CHARACTER SET

(b) What will happen if the data being loaded into a text column exceeds the maximum size of that
type?
Answer:
Data will be truncated

CBSE Sample Papers for Class 12 Computer Science Term 2 Set 2 with Solutions

Question 7.
Observe the following table and answer the parts (a) and (b):
Table: Store

Item Code Items Qty Rate
10 Gel Pen classic 1150 25
11 Sharpener 1500 10
12 Ball Pen 0.5 1600 12
13 Eraser 1600 5
15 Ball Pen 0.25 800 20

(a) In the above table, can we have Qty as primary key. [Answer as Yes/No.]. Justify your answer.
Answer:
No, Because there is a duplication of values and primary key value cannot be duplicate.

(b) What is the cardinality and degree of the above table?
Answer:
Degree : 4 Cardinality : 5

OR

(a) Identify the candidate key(s) from the table store.
Answer:
Item Code and Items

(b) Consider the following table Company:

Comp Code Cost TJ; Manufacturer Item Code
C101 15 ABC 10
C202 7 ABC 11
C303 10 XYZ 12
C404 2 PQR 13
C505 12 MNO 15

Which field will be considered as the foreign key if the tables Store and Company are related in a database?
Answer:
Item Code

Section – B
( 3 Marks Each)

Question 8.
Write a function in Python PUSH (Arr), where Arr is a list of numbers. From this list push all numbers divisible by 5 into a stack implemented by using a list. Display the stack if it has at least one element, otherwise display appropriate error message.
OR
Write a function in Python POP(Arr), where Arr is a stack implemented by a list of numbers. The function returns the value deleted from the stack.
Answer:
def PUSH (Arr, value):
s = [ ]
for x in range (0, len (Arr)): if Arr [x] % 5==0:
s.append (Arr [x]) if len (s) ==0:
print (“Empty stack”) else:
print (s)

OR

def popStack (st):
if len (st) == 0:# if stack is empty print (“Underflow”) else:
l=len (st) val=st[1-1] print (val) st.pop(1-1) return val

CBSE Sample Papers for Class 12 Computer Science Term 2 Set 2 with Solutions

Question 9.
(a) A table FLIGHT has 4 rows and 2 columns and another table AIRHOSTESS has 3 rows and 4 columns. How many rows and columns will be there if we obtain the Cartesian product of these two tables?
Answer: Total number of rows will be 12 and total number of columns will be 6.

(b) There is a column Salary in a Table EMPLOYEE. The following two statements are giving different outputs. What may be the possible reason?
SELECT COUNT(*) FROM EMPLOYEE;
SELECT COUNT(Salary) FROM EMPLOYEE;
Answer:
SELECT COUNT (*)
FROM EMPLOYEE:
This statement returns the number of records in the table.
SELECT COUNT(Salary)
FROM EMPLOYEE;
This statement returns the number of values (NULL values will not be counted) of the specified column.

Question 10.
Hina has created database named employee in MySQL.
She needs create table employee – Info in the database to stored various employees across the country. The data employee – Info has the follwing structure:

FIELD NAME DATA TYPE REMARKS
Employee ID Integer Primary key
Employee Name Varchar (255)
Emergency Contact Name Varchar (255)
Phone Number Integer
Address Varchar (255)
City Varchar (255)
Country Varchar (255)

Help her to complete the task by suggesting appropriate SQL commands.
Answer:
CREATE DATABASE Employee;
CREATE TABLE Employee – Info
EmployeelD int primary key,
EmployeeName varchar (255),
EmergencyContactName varchar(255),
PhoneNumber int,
Address varchar (255),
City varchar (255),
Country varchar(255)
) ;

Section – C
(4 Marks Each)

Question 11.
Write SQL queries for (a) to (c) and find outputs for SQL queries (d), which are based on the tables.
Table: CUSTOMER

CNO CNAME ADDRESS
101 Richa Jain Delhi
102 Surbhi Sinha Chennai
103 Lisa Thomas Bengalore
104 Imran Ali Delhi
105 Roshan Singh Chennai

Table: TRANSACTION

TRNO CNO AMOUNT TYPE DOT
T001 101 1500 Credit 2017-11-23
T002 103 2000 Debit 2017-05-12
T003 102 3000 Credit 2017-06-10
T004 103 12000 Credit 2017 – 09 – 12
T005 101 1000 Debit 2017 – 09 – 05

(a) To display details of all transactions of TYPE Credit from table TRANSACTION.
Answer:
SELECT * FROM TRANSACTION WHERE TYPE =”Credit”;

CBSE Sample Papers for Class 12 Computer Science Term 2 Set 2 with Solutions

(b) To display the CNO and AMOUNT of all Transactions done in the month of September 2017 from table TRANSACTION.
Answer:
SELECT CNO,AMOUNT FROM TRANSACTION WHERE (MONTH(DOT)=”September” AND YEAR(DOT)=2017);

(c) To display the last date of transaction (DOT) from the table TRANSACTION and customer name from CUSTOMER for the customer having CNO as 103.
Answer:
SELECT MAX(DOT), CNAME FROM TRANSACTION, CUSTOMER WHERE CNO=”103″ AND CUSTOMER.CNO=TRANSACTION.CNO:

(d) SELECT CNO, COUNT(*), MAX (AMOUNT) FROM TRANSACTION GROUP BY CNO HAVING COUNT (*)> 1;
Answer:

CNO MAX (AMOUNT) COUNT(*)
101 1500 2
103 12,000 2

Question 12.
(a) Identify the type of topology from the following:
(i) Each node is connected with the help of a single cable.
Answer:
Bus topology

(ii) Each node is connected with central switching through independent cables.
Answer:
Star topology

OR

Server side scripting : ASP, JSP
Client side scripting : JavaScript, VBScript
OR
Name two server side scripting language and two client side scripting language.
(b) What is the difference between packet and message switching?
Answer:

Packet switching Message switching
1. There is a tight upper limit on the block size. A fixed size of packet is specified. 1. In message switching there was no upper limit.
2. All the packets are stored in main memory in switching office. 2. In message switching packets are stored on disk. This increases the performance as access time is reduced.

Question 13.
Meerut school in Meerut is starting up the network between its different wings. There are four buildings named as S, J, A and H. The distance between various buildings is as follows:

A to S 200 m
A to J 150 m
A to H 50 m
S to J 250 m
StoH 350 m
J to H 350 m

Numbers of computers in each Buildings

S 130
J 80
A 160
H 50

(a) What type of topology is best suited for above network?
Answer:
Star topology

(b) Suggest the most suitable place (i.e. building) to house the server of this school.
Answer:
Building A

CBSE Sample Papers for Class 12 Computer Science Term 2 Set 2 with Solutions

(c) The school is planning to link its head office situated in New Delhi with the offices in hilly areas. Suggest a way to connect it economically.
Answer:
Radio waves would be an economic way to connect it.

(d) The company wants internet accessibility in all the blocks. What is the suitable and cost-effective technology for that?
Answer:
Broadband 

Converter 350 Degrees F To C.