Class 12 Computer Science Sample Paper Term 2 With Solutions Set B

Sample Papers for Class 12

Please refer to Class 12 Computer Science Sample Paper Term 2 With Solutions Set B provided below. The Sample Papers for Class 12 Computer Science have been prepared based on the latest pattern issued by CBSE. Students should practice these guess papers for class 12 Computer Science to gain more practice and get better marks in examinations. The Term 2 Sample Papers for Computer Science Standard 12 will help you to understand the type of questions which can be asked in upcoming examinations.

Term 2 Sample Paper for Class 12 Computer Science With Solutions Set B

Section – A

1. Give few applications of stack.
Answer: (i) Expression evaluation.
(ii) Backtracking (game playing, finding paths,exhaustive searching).
(iii) Memory management, run-time environment for nested language features.

2. (a) Expand the following
HTTP, TCP
(b) Which protocol is used in creating a connection with a remote machine?
Answer: (a) HTTP – Hyper Text Transfer Protocol.
TCP – Transmission Control Protocol.
(b) Telnet is a protocol that is used in creating a connection with a remote machine.

3. What is relation? Define the Relational Data Model.
Answer: A relation is a table having atomic values, unique and unordered rows and columns.
The relational model represents data and relationship among data by a collection of tables known as relation, each of which has a number of columns with unique names.

4. An output is extracted from the database using the cursor object by giving the following statement.
Mycon=cursor.fetchmany(size)
(a) How many records will be returned by fetchmany(size) method?
(b) What will be the datatype of Mycon object after the given command is executed?
Answer: (a) It returns the number of records specified by the size argument.
(b) list

5. Write the output of the queries (a) to (d) on the table, SCHOOL given below:

Class 12 Computer Science Sample Paper Term 2 With Solutions Set B

(a) SELECT MAX (EXPERIENCE) FROM SCHOOL;
(b) SELECT TEACHER FROM SCHOOL WHERE EXPERIENCE >12 ORDER BY TEACHER;
(c) SELECT SUM (PERIODS) FROM SCHOOL WHERE SUBJECT LIKE “E%”;
(d) SELECT SUBJECT FROM SCHOOL WHERE PERIODS < 25 AND EXPERIENCE > 15;
Answer: (a) 16
(b) UMESH
YASHRAJ
(c) 51
(d) PHYSICS

6. (a) Which keyword is used to sort the records of a table in descending order?
(b) What is a database connection?
Answer: (a) DESC
(b) A database connection is a mean to communicate form of the script to a database program.

7. Consider the table, CUSTOMER given below: 

Class 12 Computer Science Sample Paper Term 2 With Solutions Set B

(a) Identify the degree and cardinality of given table
(b) Which field should be made the primary key?
Answer: (a) Degree : 3
Cardinality : 5
(b) CNO

OR

(a) Identify the candidate key(s) from the table CUSTOMER.
(b) Which command is used to add new column into table CUSTOMER?
Answer: (a) CNO, CNAME
(b) ALTER TABLE

Section – B

8. Write a program to print a string in reverse order, using stack.
Answer: def pushstack(stack,ch):
stack.append(ch)
top=len(stack)-1
return
def popstack(stack):
if isempty(stack):
return
else:
top=len(stack)-1
for a in range(top, -1, -1):
print (stack[a])
return
def is empty(stack):
if stack==[]:
return True
else:
return False
#—————–main——————-
stk=[]
top=None
str=input(“Enter a string”)
for a in str:
pushstack(stk, a)
print (“——Reverse——“)
popstack(stk)

OR

Evaluate the following Postfix expression : 20, 10, –, 15, 3, /, +, 5, *
Answer: 

Class 12 Computer Science Sample Paper Term 2 With Solutions Set B

Result : 75

9. (a) In SQL, write the query to display the list of tables stored in a database.
(b) Sonal needs to display name of teachers, who have “O” as the third character in their name.
She wrote the following query.
SELECT NAME FROM TEACHER WHERE NAME = “**O?”;
But the query isn’t producing the result. Identify the problem.
Answer: (a) SHOW TABLES;
(b) The wildcards are incorrect. The corrected query is
SELECT NAME FROM TEACHER WHERE NAME LIKE ‘_ _ O%’;

10. (a) Sahil has to create a database named KNOWLEDGE in MYSQL.
He now needs to create a table named STUDENT in the database to store the records. The table STUDENT has the following structure:

Class 12 Computer Science Sample Paper Term 2 With Solutions Set B

Help him to complete the task by suggesting appropriate SQL commands.
Answer: CREATE DATABASE KNOWLEDGE;
CREATE TABLE STUDENT(
ADMNO INT PRIMARY KEY,
NAME CHAR(20) NOT NULL,
CLASS INT,
SEC CHAR(2),
RNO INT,
ADDRESS VARCHAR(30)
);

Section – C

11. Write SQL queries for (a) to (b) based on the given tables, CUSTOMER and TRANSACTION.

Class 12 Computer Science Sample Paper Term 2 With Solutions Set B

(a) To display the detail of customers whose include Ali in their name.
(b) To display the AMOUNT of all Transactions done in the 2017 from table TRANSACTION.
(c) To display the last date of transaction (DOT) from the table TRANSACTION for the customer having CNO as 103.
(d) To display CNO, CNAME and TYPE with the help of both tables where address is not in Delhi and Bangalore..
Answer: (a) SELECT * FROM CUSTOMER WHERE CNAME LIKE “%ALi”;
(b) SELECT AMOUNT FROM TRANSACTION WHERE DOT = 2017);
(c) SELECT MAX (DOT) FROM TRANSACTION WHERE CNO=”103”;
(d) SELECT CNO, CNAME, TYPE FROM CUSTOMER C, TRANSACTION T WHERE C.CNO=T.
CNO AND ADDRESS NOT IN (‘DELHI’, ‘BANGALORE’);

12. (i) What do you mean by a modem? Why is it used?
Answer: (i) A MODEM (Modulator Demodulator) is an electronic device that enables a computer to transmit data over telephone lines. It converts the digital signals, governed by the source computer into analog form for transmission over the telephone lines. At the receiving end it converts received analog signal into digital signals.

OR

Identify the type of topology from the following:
(a) Each node can have an arbitrary number of child nodes.
(b) Each node is connected with hub through independent cables.
(ii) Write any two differences between twisted pair cable and coaxial cable.
Answer: (a) Tree topology
(b) Star topology
(ii)   

Class 12 Computer Science Sample Paper Term 2 With Solutions Set B

13. ABC Pvt. Ltd. is setting up the network in the Bengaluru. There are four departments named as Market, Finance, Legal and Sales.
Distance between various building follows: 

Class 12 Computer Science Sample Paper Term 2 With Solutions Set B

Number of computer in building: 

Class 12 Computer Science Sample Paper Term 2 With Solutions Set B

(a) Suggest a cable layout of connections between the Departments and specify the topology.
(b) Suggest the most suitable building to place the server by giving suitable reason.
(c) Suggest the placement of (i) Modem (ii) Hub/Switch in the network.
(d) The organization is planning to link its sale counter situated in various part of the same city.
Which type of network out of LAN, WAN, MAN will be formed? Justify.
Answer: (i)   

Class 12 Computer Science Sample Paper Term 2 With Solutions Set B

Star topology should be used.
(ii) Sales is the most suitable building to place the server because it has maximum no. of computers.
(iii) Each building should have Hub/Switch and Modem in case Internal connection is required.
(iv) MAN (Metropolitan Area Network).