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

## CBSE Sample Papers for Class 12 Computer Science Term 2 Set 8 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.
Give any two operations that are performed on data structure.
Insertion It means addition of a new data element in a data structure.
Deletion It means removal of a data element from a data structure. The data element is searched before its removal.

Question 2.
(i) Expand the following
(a) SMTP
(b) HTML
(a) SMTP – Simple Mail Transfer Protocol
(b) HTML – HyperText Markup Language

(ii) Which topology contains a backbone cable running through the whole length of the network?
Bus topology

Question 3.
Explain any four constraints used in DBMS.
There are some types of constraints are

1. NOT NULL Constraint It ensures that a column cannot store NULL value.
2. UNIQUE Constraint It is used to uniquely identify each record in a database.
3. PRIMARY KEY Constraint It ensures that a column have a unique identity, which helps to find a particular record in a table and no column that is part of the primary key constraint can contain a NULL value.
4. FOREIGN KEY Constraint It designates a column or combination of columns as a foreign key and establishes its relationship with a primary key in different tables.

Question 4.
A result is extracted from the database using the cursor object by giving the following statement.

d = cursor . fetcha 11 ( )

(i) How many records will be returned by fetchall() method?
All records

(ii) What will be the datatype of object d after the given command is executed?
List of tuples

Question 5.
Observe a table ITEM and give the output of following queries.

(i) SELECT SUM (Qty) FROM ITEM WHERE Name LIKE “S%;

(ii) SELECT MAX (Qty) FROM ITEM;

(iii) SELECT Itemno, Name FROM ITEM WHERE Qty < 50 AND Name LIKE “%u%”;

(iv) SELECT Name, Date FROM ITEM WHERE Date LIKE “%12%”;

Question 6.
(i) Which component of database system consists of various secondary storage devices on which data is stored?
Hardware

(ii) Which type of language of SQL provides statements for creation and deletion of the database tables, views?
DDL (Data Definition Language)

Question 7.
Write answer the following questions, which are based on table PERSON given below.

(i) What is cardinality and degree of a relation?
(ii) Display all the person record of age 18 to 22.
Or
(i) Alter table add CITY column in it as a type character.
(ii) Identify the candidate keys of table PERSON.
(i) Cardinality – 5, Degree – 4
(ii) SELECT *FR0M PERSON WHERE AGE BETWEEN 18 AND 22;
Or
(i) ALTER TABLE PERSON ADD CITY CHAR(20);
(ii) PID, FNAME, LNAME

Section – B
(Each question carries 3 Marks)

Question 8.
Suppose STACK is allocated 6 memory locations and initially STACK is empty (Top = 0).
Give the output of the program segment.

AAA = 4 BBB = 6
Push (STACK, AAA)
Push (STACK, 4)
Push (STACK, BBB + 2)
Push (STACK, AAA + BBB)
Push (Top > 0):
Element = STACK, pop ( ) print (Element)

Or

Write the Push operation of stack containing person names. Notice that the name should only accept characters, spaces and period (.) except digits. Assume that Pname is a class instance attribute.
Output
10
10
8
4
4

Or

def insert():
name_pattern = re.compile (r “[A - Za - zs.]")
while True : n = input ("Enter name:”)
while name_pattern. search (n): :
print (“Invalid name”)
print (“Enter name correctly”)
n = input( )
Sname. append (n)
c = input (“Enter more name <y/n>”).upper ( )
if (c! = ‘y’):
break

Question 9.
(i) Write the syntax to add a column into a table using SQL command.
column_name datatype;

(ii) Explain the following SQL commands in brief.
(a) UPDATE
UPDATE It is used to modify existing record in a table.
e.g. Change city value of a person to DELHI for PID 101.
UPDATE TABLE SET CITY=‘DELHI’
WHERE PID = 101;

(b) INSERT
INSERT It is-used to insert new values in the existing table.
e.g. Add one row with values in a PERSON table.
INSERT INTO PERS0N(PID, FNAME, LNAME, AGE) VALUES(108, ‘Geeta’, ‘Sharma’, 23);

Question 10.
Create a database HUMAN in MySQL. Also, create a table PERSON with given constraints and data types for each column.
PID – Numeric and primary key, FNAME – Character max length 20, cannot be empty,
LNAME – Character max 20 length, AGE – Numeric and must be at least 18.
CREATE DATABASE HUMAN;
CREATE TABLE PERSON (
PID INT,
FNAME CHAR(20) NOT NULL,
LNAME CHAR(20),
AGE INT, CHECK (AGE > = 18),
PRIMARY KEY(PID));

Section C
(Each question carries 4 Marks)

Question 11.
Consider the following tables STUDENT and STREAM. Write SQL commands for the statements (i) to (iv).

(i) To display the name of streams in alphabetical order from table STREAM.
SELECT STRNAME FROM STREAM ORDER BY STRNAME;

(ii) To display the number of students whose POINTS are more than 5.
SELECT COUN(*) FROM STUDENT WHERE POINTS > 5;

(iii) To update GRADE to A’ for all those students, who are getting more than 8 as POINTS.
UPDATE STUDENT SET GRADE = ‘A’ WHERE POINTS > 8;

(iv) ARTS+MATHS stream is no more available. Make necessary change in table STREAM.
DELETE FROM STREAM WHERE STRNAME = ‘ARTS + MATHS’;

Question 12.
(i) Explain FTP and telnet network protocols in brief.
Or
Define terms – internet and intranet.
FTP The File Transfer Protocol is a standard communication protocol used for the transfer of computer files from a server to a client on a computer network. FTP is built on a client-server model architecture using separate control and data connections between the client and the server.

Telnet This is also called as Remote login. It is used to make connection between remote computers. After establishment of connection with remote host, the telnet client becomes a virtual terminal. It provides an error free connection.

Or

Internet Internet is a called as network of networks, where many networks are connected together to make a big worldwide network, which can be accessed by the general public, anywhere anytime. The network connected can be related with business, finance, game, education, etc. These network can share their data, information, documents on the networks using WWW.

Intranet This type of network belongs to only one organisation. Means if the devices of one organisation are connected with each other with an objective to share data with each other then it is called as Intranet.

(a) Write any two benefits of using computer network.
(b) What do you mean by data transfer rate?
(a) Two benefits of using computer network are

1. File Sharing Computer network helps connected user is sharing of data and files with each other.
2. User Communication Connected user can send and receive messages with each other, using email, chat or other applications of messaging.

(b) Data Transfer Rate Data travels in the form of signals over a channel. One signal carries one or more bits over the channel. Data transfer rate is the number of bits transmitted between source and destination in one second. It is also known as bit rate. It is measured in terms of bits per second (bps).

Question 13.
A School in Dehradun has three blocks A, B and C. It is required to setup a network in the school. The head office of the school is in Delhi.

Distance between blocks are as follows
A to C – 100m
A to B – 40m
B to C – 55m

Number of computers installed at each building

 A 15 B 100 C 30 Head Office 10

(i) Suggest most suitable place to install a server.