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

CBSE Sample Papers for Class 12 Computer Science Term 2 Set 9 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.
Write the applications of stack.
Answer:
There are some applications of stack are as follows

  • Infix to postfix conversion using stack.
  • Evaluation of postfix expression.
  • Reverse a string using stack.
  • Implement two stacks in an array.

Question 2.
(i) Expand the following
(a) PPP
(b) MAN
Answer:
(a) PPP → Point-to-Point Protocol
(b) MAN → Metropolitan Area Network

(ii) Name the device that is used to connect different types of networks. It performs the necessary translation, so that the connected networks can communicate properly.
Answer:
Router

Question 3.
Differentiate between ALTER and UPDATE commands in SQL.
Answer:
Differences between ALTER and UPDATE commands in SQL are as follows:

ALTER command UPDATE command
It belongs to DDL category. It belongs to DML category.
It changes the structure of the table. It modifies data of the table.
Columns can be added, modified, deleted etc. Data can be changed, updated with values and expressions.

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

Question 4.
Which data will get added in table Company by following code?

import mysql.connector
con = mysql.connector.connect (host = “localhost”,
user = “system”,
passwd = “hello”,
database = "connect”)
cur = con .cursor( )
sql = “INSERT INTO Company
(Name,Dept,Sal ary)
VALUES (%s, %s, %s)”
val = ("ABC”, “DBA”, 35000)
cur.execute(sql, val)
con.commit! )

Answer:
“ABC”, “DBA”, 35000

Question 5.
Write a output for SQL queries (i) to (iv), which are based on the table ITEMS.
Table : ITEMS
CBSE Sample Papers for Class 12 Computer Science Term 2 Set 9 with Solutions 1
(i) SELECT MAX(Price), MIN(Price) FROM ITEMS;
Answer:
CBSE Sample Papers for Class 12 Computer Science Term 2 Set 9 with Solutions 2

(ii) SELECT Price * Qty AS AMOUNT FROM ITEMS WHERE Code=1004;
Answer:
CBSE Sample Papers for Class 12 Computer Science Term 2 Set 9 with Solutions 3

(iii) SELECT DISTINCT TCode FROM ITEMS;
Answer:
CBSE Sample Papers for Class 12 Computer Science Term 2 Set 9 with Solutions 4

(iv) SELECT IName FROM ITEMS WHERE Company LIKE “DIGIT’;
Answer:
CBSE Sample Papers for Class 12 Computer Science Term 2 Set 9 with Solutions 5

Question 6.
(i) Is it compulsory to provide values for all columns of a table while adding records?
Answer:
No, it is not compulsory to provide values for all columns of a table while adding records. We can use NULL values wherever values are missing.

(ii) Which join is a simple SQL join condition that uses equal sign as a comparison operator?
Answer:
Equi join

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

Question 7.
Observe the table Product
Table: Product
CBSE Sample Papers for Class 12 Computer Science Term 2 Set 9 with Solutions 6
(i) Identify the primary key.
(ii) Identify the degree and cardinality of the table.
Or
(i) Identify the candidate keys from the table Product.
(ii) If we have another table Item whose fields are ItemID, IName, CID, then which field will be considered as a foreign key?
Answer:
(i) CID
(ii) Degree = 5
Cardinality = 4

Or

(i) CID, CNAME
(ii) CID

Section – B
(Each question carries 3 Marks)

Question 8.
Write Push (contents) and Pop (contents) methods in Python to add numbers and remove numbers considering them to act as Push and Pop operations of stack.
Or
Change the following infix expression into postfix expression (A+(B*C)-D/E + C ^ H)
Answer:

def Push (contents):
if(len(stack) >= limit):
print(“Stack Overflow!”)
el se:
stack. append (contents)
print (“Stack after Push”,stack def PopO:
if (len (stack) <= 0 ):
print("Stack Underflow!”)
return 0
el se:
return stack.pop()

Or
Given, infix expression is
A+(B*C)-D/E + C ^ H)
CBSE Sample Papers for Class 12 Computer Science Term 2 Set 9 with Solutions 7
Output:
ABC*DE/-CH^+

Question 9.
(i) Give the command that displays the details of all the products, in table Product whose fields are PNo, PName, Qty, Date_Of_Mfg.
Answer:
SELECT * FROM Product;

(ii) In the following query, how many rows will be deleted?

DELETE Student WHERE Student_ID = 109;

(Assuming a Student table with primary key Student_ID)
Answer:

DELETE FROM Student WHERE
Student_ID = 109:

Here, the “FROM” clause is missing, so the command will produce an error.

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

Question 10.
Namita has to create a database named STREAM in MySQL.
She now needs to create a table named Student in the database to store the records of various students in Stream.

The table Student has the following structure:

Field Name Data Type Remarks
Scode Varchar(3) Primary Key
Name Char(20)
Age Integer
STRCDE Integer
Points Integer
Grade Char(2)

Help her to complete the task by suggesting appropriate SQL commands.
Answer:

CREATE DATABASE STREAM;
CREATE TABLE Student
(Scode Varchar(3) Primary key,
Name Char(20),
Age Integer,
STRODE Integer,
Points Integer,
Grade Char(2));

Section – C
(Each question carries 4 Marks)

Question 11.
Answer the questions (i) to (iv) on the basis of the following tables SHOPPE and ACCESSORIES.
Table : SHOPPE

Id SName Area
S001 ABC Computeronics CP
S002 All Infotech Media GKII
S003 Tech Shoppe CP
S004 Geeks Tecno Soft Nehru Place
S005 Hitech Tech Store Nehru Place

Table : ACCESSORIES
CBSE Sample Papers for Class 12 Computer Science Term 2 Set 9 with Solutions 8
(i) To display Name and Price of all the accessories in ascending order of their Price.
Answer:
SELECT Name, Price FROM
ACCESSORIES ORDER BY Price;

(ii) To display Id and SName of all shoppe located in Nehru Place.
Answer:
SELECT Id, SName FROM SHOPPE WHERE Area = “Nehru Place”;

(iii) To display minimum and maximum Price of each name of accessories.
Answer:
SELECT MIN (Price) “Minimum Price”, MAX(Price) “Maximum Price”, Name FROM ACCESSORIES GROUP BY Name;

(iv) To display Name, Price of all accessories and their respective SName, where they are available.
Answer:
SELECT Name, Price, SName FROM ACCESSORIES A, SHOPPE S WHERE A.Id = S.Id;

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

Question 12.
(i) Write any two uses of Internet.
Or
What is the use of baud rate?
Answer:
Two uses of Internet are as follows

  • Internet is used for communication and information sharing.
  • Business use the Internet to provide access to complex databases.

Or

  • Baud rate is a measure of the number of symbols (signals) transferred or line changes every second. It may represent more than one binary bit.
  • Every symbol can represent or convey one or several bits of data. For a binary signal of 20 Hz, this is equivalent to 20 baud.

(ii) A company wants to form a network on their five computers to a server within the company premises. Represent star and ring topologies diagrammatically for this network.
Answer:
CBSE Sample Papers for Class 12 Computer Science Term 2 Set 9 with Solutions 9

Question 13.
Granuda consultants are setting up a secured network for their office campus at Faridabad for their day-to-day office and web based activities. They are planning to have connectivity between 3 buildings and the head office situated in Kolkata. Answer the questions (i) to (iv) after going through the building positions in the campus and other details, which are given below:

Distance between various buildings

Building RAVI to Building JAMUNA 120 m
Building RAVI to Building GANGA 50 m
Building GANGA to Building JAMUNA 65 m
Faridabad Campus to Head Office 1460 km

Number of computers

Building RAVI 25
Building JAMUNA 150
Building GANGA 51
Head Office 10

(i) Suggest the most suitable place (i.e. block) to house the server of this organisation. Also, give a reason to justify your suggested location.
Answer:
The most suitable place to house the server is JAMUNA because it has maximum number of computers.

(ii) Suggest a cable layout of connections between the building inside the campus.
Answer:
CBSE Sample Papers for Class 12 Computer Science Term 2 Set 9 with Solutions 10

(iii) The organisation is planning to provide a high speed link with its head office situated in the Kolkata using a wired connection. Which of the following cable will be most suitable for this job?
(a) Optical fibre
(b) Co-axial cable
(c) Ethernet cable
Answer:
(a) Optical fibre

(iv) Consultancy is planning to connect its office in Faridabad which is more than 10 km from Flead Office. Which type of network will be formed?
Answer:
MAN