Class 12 Computer Science Sample Paper Term 2 Set A

Sample Paper Class 12

Please refer to Class 12 Computer Science Sample Paper Term 2 Set A 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. Convert to postfix notation:
(A+B)*C/D
Answer: ((A+B)*C)/D
=(AB+*C)/D
=(AB+C*)/D
=AB+C*D/

2. (a) Expand the following:
PPP, HTML
(b) Rahul has to share the data among various computers of his two office branches situated in the same city. Name the network (out of LAN, MAN,PAN and MAN) which is being formed in this process.
Answer: (a) PPP: Point-to-Point Protocol.
HTML: HyperText Markup Language.
(b) MAN (Metropolitan Area Network)

3. Explain database.
Answer: A database is a collection of interrelated data. A database consists of a number of tables. Each table comprises of rows(records) and columns(attributes). Each record contains values for the corresponding attributes. The values of the attributes for a record are interrelated. For example,different cars have different values for the same specifications (length, color, engine capacity etc.)

4. Consider the statement given below:
MySQLdb.connect(‘localhost’,‘LibMan’,‘isspwd’,‘Library’)
(a) What is “Library” in the statement?
(b) What is “LibMan” in the statement?
Answer: (a) Database
(b) User name

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

Class 12 Computer Science Sample Paper Term 2 Set A

(a) SELECT GAME FROM SPORTS WHERE GRADE=’A’;
(b) SELECT COACHNAME FROM SPORTS WHERE GAME LIKE ‘%KET’;
(c) SELECT ADMNO, GRADE FROM SPROTS WHERE ADMNO>1215;
(d) SELECT GRADE FROM SPORTS WHERE GAME=”BASKETBALL;
Answer:

Class 12 Computer Science Sample Paper Term 2 Set A

(c) ADMNO GRADE
1215 A
(d) GRADE
B

6. (a) Which command is used to modify the records of the table?
(b) What is a query result set?
Answer: (a) UPDATE Command.
(b) A result set is an object that is returned when a cursor object is used to query a table.

7. Consider the table Patients:

Class 12 Computer Science Sample Paper Term 2 Set A

(a) What is degree?
(b) Define cardinality.
Answer: (a) Degree is the number of attributes or columns present in a table.
(b) Cardinality is the number of tuples or rows present in a table.

OR

(a) Identify the degree and cardinality of table Patients.
(b) Identify the primary key of table Patients.
Answer: (a) Degree: 4
Cardinality : 5
(b) PatNo,

Section – B

8. Write a function to push any student’s information to stack.
Answer: def push(stack):
s=[]
print (“STACK BEFORE PUSH” )
display (stack)
s.append(input(“Enter student rollno?”))
s.append(input(“Enter student name”))
s.append(input(“Enter student grade”))
stack.append(s)
def display(stack):
l=len(stack)
print “STACK CONTENTS”
for i in range(l – 1, – 1, – 1):
print (stack[i])
stack=[]
print (“Creating stack” )
n=int(input(“Enter the number of students” ))
for i in range(n):
push(stack)
display(stack)

OR

Convert (A+ (B*C – (D / E ^ F) * G) * H) into postfix form showing stack status after every step.
Answer:

Class 12 Computer Science Sample Paper Term 2 Set A

Final=ABC*DEF^/G* –H*+

9. (a) Which type of relationship is supported by network model?
(b) What is join in SQL?
Answer: (a) Network model supports many to many relationships.
(b) A join is a query that combines rows from two or more tables. In a join query, more than one tables are listed in FROM clause. The function of combining data from multiple tables is called joining. Joins are used when we have to select data from two or more tables

10. Create following table using Python code.
Table Name = Customer
Database – xyzcorp
Userid – Adminxyz
Password – Axydm12

Class 12 Computer Science Sample Paper Term 2 Set A

Answer: import MySQLdb
db=MySQLdb.connect(“localhost”, “Adminxyz”, “Axydm12”, “xyzcorp”)
cursor=db.cursor()
cursor.execute(“DROP TABLE IF EXISTS CUSTOMER”)
sql=””” Create Table Customer(CUSTNUMB CHAR(3) NOT NULL, CUSTNAME CHAR(60)
NOT NULL,
ADDRESS CHAR(100),BALANCE Float, CREDLIM Float, SLSRNUMB CHAR(2) NOT NULL)”””
cursor.execute(sql)
cursor.close()
rec_ins=[(‘124’, ‘TINA ADAMS, ‘481 Tilak lane, CP, Delhi’, 41800.75,50000,
‘3’),
(‘256’, ‘R VENKAT’, ‘215 Mylapore, Chennai’, 100000.75, 80000,’6’),
((‘567’,‘BHUVNA BALAJI’, ‘808 BalaNagar, Hyderabad’, 57000.75, 50000,’6’),
(‘622’, ‘PRATHAM JAIN’, ‘149 Plot 182, sec-9 Drarka, Delhi’,
57500.75,80000,’12’)]
sql_insert=”””INSERT INTO Customer (CUSTNUMB, CUSTNAME, ADDRESS, BALANCE,
CREDLIM,SLSRNUMB), (VALUES(‘%s’,’%s’,’%s’,’%f’,’%f’,’%s’)”””
cursor=db.cursor(prepared=TRUE)
try;
cursor.executemany(sql_insert,rec_ins)
print(cursor.rowcount, “Records inserted successfully”)
db.commit()
except:
db.rollback()
cursor.close()
db.close()

Section – C

11. Write SQL queries for (a) to (d) based on tables, ACCOUNT and TRANSACT given below:

Class 12 Computer Science Sample Paper Term 2 Set A

(a) To display details of all transactions of TYPE Deposit from Table TRANSACT.
(b) To display the ANO and AMOUNT of all Deposits and Withdrawals done in the month of October 2017 from table TRANSACT.
(c) To display the last date of transaction (DOT) from the table TRANSACT for the Accounts having ANO as 103.
(d) To display the ANAME and AMOUNT from tables given above for those whose address is Chennai.
Answer: (a) SELECT* FROM TRANSACT WHERE TYPE= ‘Deposit’;
(b) SELECT ANO, AMOUNT FROM TRANSACT WHERE DOT >= ‘ 2017-10-01 ’AND DOT
<=‘2017-10-31’;
(c) SELECT MAX(DOT) FROM TRANSACT WHERE ANO = 103;
(d) SELECT ANAME, AMOUNT FROM ACCOUNT A, TRANSACT T WHERE A.ANO=T.ANO AND ADDRESS = “Chennai”;

12. (a) Write one advantage of bus topology of network. Also illustrate how four (4) computers can be connected with each other using bus topology of network.
Answer:(a) Advantage of Bus topology:
The cable length required for this topology is the least compared to the other networks.

Class 12 Computer Science Sample Paper Term 2 Set A

OR

Explain the purpose of a Switch.
(b) What is the difference between e–mail and chat?
Answer: It connects several nodes to form a network and directs the received information only to the intended
node.
(b)

Class 12 Computer Science Sample Paper Term 2 Set A

13. Meerut school in Meerut is starting up the network between its different wings. There are four buildings named as S, J, A and H. The distance between various buildings is as follows:

Class 12 Computer Science Sample Paper Term 2 Set A

Number of computers in each Building:

Class 12 Computer Science Sample Paper Term 2 Set A

(a) Suggest the cable layout of connections between the buildings.
(b) Suggest the most suitable place (i.e. building) to house the server of this school, provide a suitable reason.
(c) Suggest the placement of the following devices with justification:
♦ Repeater
♦ Hub/Switch
(d) The organization also has inquiry office in another city about 50-60 km away in hilly region.
Suggest the suitable transmission media to interconnect to school and inquiry office out of the following:
♦ Fibre optic cable
♦ Micro wave
♦ Radio wave
Answer: (a)

Class 12 Computer Science Sample Paper Term 2 Set A

(b) Server can be placed in the A building as it has the maximum number of computers.
(c) Repeater can be placed between A and S and A and J buildings as the distance is more than 100 m. Hub/switch should be placed in each building.
(d) Radiowaves can be used in hilly regions as they can travel through obstacles.