Class 12 Computer Science Sample Paper Term 2 Set B

Sample Paper Class 12

Please refer to Class 12 Computer Science Sample Paper Term 2 Set b with solutions below. The following CBSE Sample Paper for Class 12 Computer Science has been prepared as per the latest pattern and examination guidelines issued by CBSE. By practicing the Computer Science Sample Paper for Class 12 students will be able to improve their understanding of the subject and get more marks.

CBSE Class 12 Computer Science Sample Paper for Term 2

Section – A

1. Define the term Overflow and Underflow in stack.
1. Overflow occurs in stack when one tries to push an item in stack that is full.
Underflow occurs in stack when one tries to POP an item from an empty stack.

2. (a) Expand the following:
WWW, RJ45
(b) XYZ company is planning to connect all computers, each spread over a distance of 50 meters.
Suggest an economic cable type having high speed data transfer to connect these computers.
Answer: (a) WWW : World wide web.
RJ45 : Registered Jack – 45.
(b) Optical Fibre Cable.

3. Define Database Management System.
Answer: A database management system (DBMS) is a set of programs that enables the users to define, create and maintain the database and provides controlled access to this database.
The primary goal of DBMS is to provide a way to store and retrieve database information that is both convenient and efficient. The purpose of a DBMS is to bridge the gap between the information and data.

4. Consider the following statement:
db.rollback()
(a) What is the function of this statement in a program?
(b) Name the method when, rollback() method can be used to retrieve the original data that was changed through that method.
Answer: (a) It returns the database to some previous state.
(b) commit() method.

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

Class 12 Computer Science Sample Paper Term 2 Set B

Note :
♦ NO is Driver Number
(a) SELECT NAME FROM TRIP WHERE KM>100;
(b) SELECT SUM (NOP) FROM TRIP WHERE TCODE=102;
(c) SELECT MAX (KM) FROM TRIP;
(d) SELECT * FROM TRIP WHERE NAME LIKE ‘%Kumar%’;
Answer: (a) NAME
Tanish Khan
Ram Kumar
Rajpal Kirti
(b) SUM (NOP)
82
(c) MAX (KM)
350
(d) NO NAME TDATE KM TCODE NOP
15 Ram Kumar 2016-02-23 350 102 42
17 Aan Kumar 2015-02-10 75 104 2

6. (a) Explain the degree of table.
(b) Which clause is used to remove the duplicating rows of the table?
Answer: (a) The degree of the table denotes the number of columns. Present in the table.
(b) DISTINCT

7. Consider the table PERSON given below:

Class 12 Computer Science Sample Paper Term 2 Set B

(a) Differentiate between the primary key and alternatekey.
(b) Identify the primary key of given table.
Answer: (a) A primary key is a value that can be used to identify a unique row in a table. While an alternate key is any candidate key which is not selected to be the primary key.
(b) Aadhar Num

OR

(a) Identify the candidate key(s) of table PERSON.
(b) Identify the alternate key of table PERSON.
Answer: (a) AadharNum, BankA/CNum
(b) BankA/CNum

Section – B

8. Write a program to implement a stack for these book details (book no, book name). That is, now each item node of the stack contains two types of information –a book no and its name. Just implement push and display operations.
Answer: def isempty(stk):
if stk==[]:
return True
else:
return False
def pushbook (stk, item):
stk.append(item)
top=len(stk)–1
def displaybook(stk):
if isempty(stk):
print(“stack Empty”)
else:
top=len(stk)–1
print(“book no …… book name”)
for a in range(top,-1,-1):
print(stk[a])
stk=[]
top=None
while True:
print(“book”)
print(“1.adda book”)
print(“2. display list”)
print(“3. exit”)
ch=int(input(“enter your choice 1-3:”))
if ch==1:
bno=input(“enter book no:”)
bname=input(“enter book name”)
item=[bno, bname]
pushbook(stk, item)
elif ch==2:
displaybook(stk)
elif ch==3:
break
else:
print(“invalid choice!”)

OR

Convert the following infix into postfix form using stack.
(True AND False) OR (False AND True)
Answer:

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

9. (a) In SQL, write the query to display the current Date and Time.
(b) Give Some examples of integrity constraints.
Answer: (a) SELECT NOW( );
(b) Integrity constraints are:
♦ NOT NULL
♦ PRIMARY KEY
♦ UNIQUE
♦ CHECK

10. Write Python code to insert following records into the order details table.
Database → sales
Userid → Admin
Password → salAd345
table name → OrderDetails

Class 12 Computer Science Sample Paper Term 2 Set B

Answer: import MySQLdb
db=MySQLdb.connect(‘localhost’,’Admin’,’salAd345’,’sales’)(cursor=db.
cursor)(prepared=True)
insert_quer=”””INSERT INTO TABLE(ORDNUMS,PARTNUMB,NUMBORD,QUOTPRIC)
VALUSE(‘%s’,’%s’,’%s’, ‘%f’)”””
rec_ins=[(‘12489’,’AX12’,‘11’, 14.95),(‘12491’,‘BT04’,‘1’, 402.99),(‘12492’,’BZ66’,
‘1’, 311.95),(‘12498’, ‘CX11’, ‘2’,57.95)
try:
cursor.executemany(insert_query,rec_ins)
print(cursor.rowcount,”Records inserted successfully”)
db.commit()
except:
db.rollbank()
cursor.close()
db.close()

Section – C

11. Write queries (a) to (d) based on tables, SCHOOL and ADMIN given below:

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

(a) To display TEACHERNAME, PERIODS of all teachers whose periods are more than 25.
(b) To display all the information from the table SCHOOL in descending order of experience.
(c) To display DESIGNATION without duplicate entries from the table ADMIN.
(d) To display TEACHERNAME, CODE and corresponding DESIGNATION from tables SCHOOL and ADMIN of Male teachers.
Answer: (a) SELECT TEACHERNAME, PERIODS FROM SCHOOL WHERE PERIODS >25;
(b) SELECT * FROM SCHOOL ORDER BY EXPERIENCE DESC;
(c) SELECT DISTINCT DESIGNATION FROM ADMIN;
(d) SELECT TEACHERNAME, CODE,DESIGNATION FROM SCHOOL, ADMIN WHERE SCHOOL.
CODE = ADMIN.CODE AND GENDER = MALE;

12. (a) Differentiate between Web server and web browser. Write any two popular web browsers.
Answer: (a) Web Browser : A web browser is a software application for accessing information on the World Wide Web. When a user requests a web page from a particular website, the web browser retrieves the necessary content from a web server and then displays the page on the user’s device.
Web Server : A web server is a computer that runs websites. The basic objective of the web server is to store, process and deliver web pages to the users. This intercommunication is done using Hypertext Transfer Protocol (HTTP).
Popular web browsers: Google Chrome, Mozilla Firefox, Internet Explorer etc.

OR

Write one advantage of star topology of network. Also, illustrate how five(5) computers can be connected with each other using star topology of network.
(b) What is an IP address?
Answer: Advantage of star topology:
Easy to replace, install or remove host or other devices.

Class 12 Computer Science Sample Paper Term 2 Set B

(b) IP address is a unique identifier for a node or host connection on an IP network. An IP address is a 32 bit binary number usually represented as 4 decimal values, each representing 8 bits in range 0 to 255 (known as octets) separated by decimal points. This is known as dotted decimal notation e.g.140.179.220.200

13. ABC is professional consultancy company. The company is planning to set up their new offices in India with its hub at Bengaluru. As a network adviser, you have to understand their requirement and suggest them the best available solutions.
Their queries are mentioned as (a) to (d) below:
Block to Block distances (in Mtr):

Class 12 Computer Science Sample Paper Term 2 Set B

Expected Number of computers to be installed in each block:

Class 12 Computer Science Sample Paper Term 2 Set B

(a) What will be the most appropriate block,where ABC should plan to install their server?
(b) Draw a block diagram showing cable layout to connect all the buildings in the most appropriate manner for efficient communication.
(c) What will be the best possible connectivity out of the following, you will suggest to connect the new setup of offices in Chennai with its London based office.
♦ Satellite link
♦ Infrared
♦ Ethernet cable
(d) Which of the following device will be suggested by you to connect each computer in each of the buildings?
♦ Switch
♦ Modem
♦ Gateway
Answer: (a) Finance block because it has maximum number of computers.
(b)

Class 12 Computer Science Sample Paper Term 2 Set B

(c) Satellite link
(b) Switch