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

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

Maximum Marks: 35
Time: 2 hours

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
(Each question carries 2 Marks)

Question 1.
Evaluate following postfix expression using a stack and show content of the stack after each step.
8, 2, +, 9, +, 2, 8,*,+
Answer:
Given, postfix expression is 8, 2, +, 9, +, 2, 8, *, +

Element Operation Stack
8 Push 8
2 Push 8,2
+ Pop two elements 2 and 8, 2+ 8=10 (Push) 10
9 Push 10,9
+ Pop two elements 10 and 9, 9 + 10 = 19 (Push) 19
2 Push 19,2
8 Push 19,2,8
* Pop two elements 8 and 2,2*8 = 16 (Push) 19,16
+ Pop two elements 19 and 16*, 16 + 19 = 35 35

Question 2.
(i) Expand the following
(a) HTTP
(b) VoIP
Answer:
(a) HTTP—HyperText Transfer Protocol
(b) VoIP—Voice over Internet Protocol

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

(ii) What is the name of the network topology in which there are bi-directional links between each possible node?
Answer:
Mesh topology

Question 3.
What do you mean by referential integrity?
Answer:
A referential integrity is a system of rules that a DBMS uses to ensure that relationships between records in related tables are valid and that users do not accidently delete or change related data. We can set the referential integrity when all of the following conditions are met

  • The matching field from the primary table is a primary key or has a unique value.
  • The related fields have the same data types.
  • Both tables belong to the same database.

Question 4.
Write the code to create the connection in which database’s name is Python, name of host, user and password can be taken by user. Also, print that connection.
Answer:

import mysql. connector
mycon = mysql . connector, connect (
host = "localhost",
user = "test",
passwd = "testData",
database = "Python")
print(mycon)
CBSE Sample Papers for Class 12 Computer Science Term 2 Set 6 with Solutions

Question 5.
Write the output of the queries (i) to (iv) based on the table TEACHER given below
CBSE Sample Papers for Class 12 Computer Science Term 2 Set 6 with Solutions 1
(i) SELECT TeacherlD, DOJ FROM TEACHER WHERE Departments’Computer’ OR Department=’Math’;
Answer:

(ii) SELECT DISTINCT Department FROM TEACHER;
Answer:

(iii) SELECT Department, COUNT!*), MIN(Salary) FROM TEACHER GROUP BY Department HAVING COUNT(*)>1:
Answer:

(iv) SELECT SUM (Salary) FROM TEACHER WHERE Gender = “M”;
Answer:

Question 6.
(i) Which aggregate function returns the count of all rows in a specified table?
Answer:
COUNT()

(ii) Which keyword can be used to return only different values in a particular column or a whole table?
Answer:
DISTINCT

Question 7.
Observe a table ITEM and answer the following questions.
CBSE Sample Papers for Class 12 Computer Science Term 2 Set 6 with Solutions 6
(i) Write names of columns can be considered for a candidate key.
(ii) Write an SQL query to display all the items where Qty is more than 20.
Or
(i) Display Itemno, Name and Qty in descending order of the Qty from table ITEM.
(ii) Identify the primary key. Also, give the reason to choose primary key of particular field.
Answer:
(i) Itemno, Name are most appropriate for making candidate key.
(ii) SELECT * FROM ITEM WHERE Qty>20;
Or
(i) SELECT Itemno, Name, Qty FROM ITEM ORDER BY Qty DESC;
(ii) Itemno should be made the primary key as it uniquely identifies each record of the table.

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

Section B
(Each question carries 3 Marks)

Question 8.
A list has containing 5 integers. To create a program with separate user defined functions to perform following tasks:

  • Insert odd numbers
  • Remove and display the content of the stack For example,

Sample input
LI = [15, 26, 72, 53, 44]

Sample output
53 15

Or

A linear stack called Status contains the following information
(i) Phone number of Employee
(ii) Name of Employee
Write the method to perform the operation Pop to pop an object from the stack and to release the memory.
Answer:

LI = [15, 26, 72, 53, 44]
def Insert (E, LI):
E.append (LI)
def Delete ( E):
if E! = [ ]:
return E. pop ( )
else :
return None
Stack1 = [ ]
for i in [ ] :
if i% 2! = E:
Insert (Stack1, i) while True:
if Stack1 ! = [ ]:
print(Delete(Stackl), end = " ”)
else:
break
Or
def Pop_element(Status, Top):
Slen = len(Status)
if (Slen < = 0):
print (“Status is empty”)
else:
phone_no*, emp_name = Status. pop( )
Top = Top - 1
print (“Phone number % s and Name %sdeleted” % (phone_no, emp_name))
return Top

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

Question 9.
(i) Which method is used to create a connection between the MySQL database and Python?
Answer:
Connect

(ii) What are different type of commands category is provided by SQL?
Answer:
SQL provides different type of commands used for different purposes

  • DDL Data Definition Language called as DDL, used to define all the commands which are related with the definition of a relation. Such as – CREATE TABLE, ALTER TABLE, etc.
  • DCL Data Control Language called as DCL, used to control the access of the users inside the database by using some set of SQL commands. Such as – GRANT and REVOKE.
  • DML Data Manipulation Language called as DML, used to define all the SQL commands required for data manipulation is table. Such as – INSERT, DELETE, etc.
  • TCL Transaction Control Language called as TCL, used to define all the commands deals with transactions in the database. Such as – COMMIT, ROLLBACK, etc.

Question 10.
Create a database University in MySQL. Also, create a table STUDENT with given constraints and data types for each column.
Rollno – integer and primary key,
Sname – character max length 20, cannot be empty DOB – date type,
Phoneno – character max 10
Answer:

CREATE DATABASE University:
CREATE TABLE STUDENT (
Rollno INT,
Sname VARCHAR(20) NOT NULL,
DOB DATE,
Phoneno CHAR(10),
PRIMARY KEY(Rol1 no));

Section-C
(Each question carries 4 Marks)

Question 11.
Write SQL queries for (i) to (iv) based on tables TEACHER and POSTING.
CBSE Sample Papers for Class 12 Computer Science Term 2 Set 6 with Solutions 2
(i) Display number of male and female teachers.
Answer:
SELECT Gender, COUNT(*) FROM TEACHER GROUP BY Gender;

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

(ii) Display TeacherlD and Tname working in Delhi.
Answer:
SELECT Teacherld, Tname, City
FROM TEACHER, POSTING WHERE
TEACHER.Department=P0STING.
Department AND
POSTING.City=‘Delhi’;

(iii) Display Tname, DOJ and Gender whose Salary is less than 45000.
Answer:
SELECT Tname, D0J, Gender FROM TEACHER WHERE Salary<45000;

(iv) Display number of teachers’ department wise.
Answer:
SELECT Department, COUNT(*) FROM TEACHER GROUP BY Department;

Question 12.
(i) Explain the “distributed computing power can be achieved” using networking.
Or
Define advantages and disadvantages of fibre optical cables.
Answer:
(i) In computer networks, we can distribute tasks across multiple computers throughout the network, by breaking complex problems into hundreds or thousands of smaller operations, which are then parcelled out to individual computers. Each computer in the network performs its operations on its own portion of the larger problem and return its result. Then, all these results are gathered in such a form that impact as the solution of the complex problem and finally are used for the further task.

Or

There are some advantages of fibre optical cable

  • These are highly suitable for harsh industrial environment. These are immune to noise caused by electrical and magnetic fields.
  • It can support dramatically higher bandwidths (and hence data rates) than either twisted pair or co-axial cable.

There are some disadvantages of fibre optical cable

  • These are very difficult to install and maintain.
  • They require more protection around the cable than copper cables.
  • Propagation of light is uni-directional. For bi-directional communication, two fibres are needed. These are relatively more expensive than other guided media.

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

(ii) Compare and contrast the wireless transmission media- bluetooth and infrared.
Answer:
Differences between bluetooth and infrared are as follows

Bluetooth Infrared
Bluetooth uses low power radio waves. Infrared uses infrared waves.
Bluetooth has a transmission range of upto 240 metres. Infrared has a transmission range of 5 metres.
Bluetooth is not limited to line of sight communication. Infrared works  only in direct line of sight,

Question 13.
A university is setting a network between the buildings. The University has 4 blocks – Admin(A), Technology(T), Workshop(W) and HR(H).
CBSE Sample Papers for Class 12 Computer Science Term 2 Set 6 with Solutions 3
Distance between wings are as follows
A to T -100 m
A to W – 200 m
A to H – 300 m
T to H – 400 m
T to W -100 m
W to H – 350 m
Number of computers installed at each building
A – 15
T – 100
W – 30
H – 10
(i) Suggest most suitable place to install a server.
Answer:
Most suitable building is “Technology” block to install a server because it has maximum number of computers.

(ii) Suggest a layout to connect these blocks for wired channel.
Answer:
Layout connection
CBSE Sample Papers for Class 12 Computer Science Term 2 Set 6 with Solutions 9

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

(iii) Which device will be suggested by you to install in each block for efficient connection of all computers within block?
Answer:
Switch is a perfect device for making connection between computers within a block.

(iv) Suggest the placement of repeater.
Answer:
Repeater can be placed when distance between two buildings are more than 70 metres. Total 4 repeaters can be placed.