Students can access the CBSE Sample Papers for Class 12 Computer Science with Solutions and marking scheme Term 2 Set 3 will help students in understanding the difficulty level of the exam.
CBSE Sample Papers for Class 12 Computer Science Term 2 Set 3 with Solutions
Time: 2 Hours
Maximum Marks: 35
General 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
(2 Marks Each)
Question 1.
Give few applications of stack.
Answer:
- Expression evaluation.
- Backtracking (game playing, finding paths,exhaustive searching).
- Memory management, run-time environment for nested language features.
Question 2.
(a) Expand the following Oil
HTTP, TCP
Answer:
- HTTP – Hyper Text Transfer Protocol.
- TCP – Transmission Control Protocol.
(b) Which protocol is used in creating a connection with a remote machine? HD
Answer:
Telnet is a protocol that is used in creating a connection with a remote machine.
Question 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.
Question 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?
Answer:
It returns the number of records specified by the size argument.
(b) What will be the datatype of Mycon object after the given command is executed?
Answer:
list
Question 5.
Write the output of the queries (a) to (d) on the table, SCHOOL given below:
Table: SCHOOL
CODE | TEACHER | SUBJECT | DOJ | PERIODS | EXPERIENCE |
1001 | RAVI
SHANKAR |
ENGLISH | 12/3/2000 | 24 | 10 |
1009 | PRIYA RAI | PHYSICS | 03/09/1998 | 26 | 12 |
1203 | LIS ANAND | ENGLISH | 90/04/2000 | 27 | 5 |
1045 | YASHRAJ | MATHS | 28/8/2000 | 24 | 15 |
1123 | GAGAN | PHYSICS | 16/7/1999 | 28 | 3 |
1167 | 1 lansh B | Chemistry | 19/10/1999 | 27 | 5 |
1215 | Umesh | Physics | 11/05/1998 | i 22 | 16 |
(a) SELECT MAX (EXPERIENCE) FROM SCHOOL;
Answer:
16
(b) SELECT TEACHER FROM SCHOOL WHERE EXPERIENCE >12 ORDER BY TEACHER;
Answer:
UMESH YASHRAJ
(c) SELECT SUM (PERIODS) FROM SCHOOL WHERE SUBJECT LIKE “E%”;
Answer:
51
(d) SELECT SUBJECT FROM SCHOOL WHERE PERIODS <25 AND EXPERIENCE > 15;
Answer:
PYHISCS
Question 6.
(a) Which keyword is used to sort the records of a table in descending order?
Answer:
DESC
(b) What is a database connection?
Answer:
A database connection is a mean to communicate form of the script to a database program.
Question 7.
Consider the table, CUSTOMER given below:
Table: CUSTOMER
CNO | CNAME | Address |
101 | Richa Jain | Delhi |
102 | Surbhi Sinha | Chennai |
103 | Lisa Thomas | Bangalore |
104 | Imran Ali | Delhi |
105 | Roshan Singh | Chennai |
(a) Identify the degree and cardinality of given table
Answer:
- Degree : 3
- Cardinality : 5
(b) Which field should be made the primary key?
Answer:
CNO
OR
(a) Identify the candidate key(s) from the table CUSTOMER.
Answer:
CNO, CNAME
(b) Which command is used to add new column into table CUSTOMER?
Answer:
ALTER TABLE
Section – B
(3 Marks Each)
Question 8.
Write a program to print a string in reverse order, using stack.
OR
Evaluate the following Postfix expression : 20,10, -, 15, 3, /, +, 5, *
Answer:
def pushstack(stack,ch):
stack.append(ch) top=len(stack)-1 return
def popstack(stack):
if isempty(stack):
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
Commonly Made Error:
Students use keywords or similar name for identifiers which show error.
Answering Tip:
Try to use meaningful name identifiers and do not use keywords or similar name for identifiers.
OR
Symbol | Operation | : Stack … | Result |
20 | Push | 20 | |
10 | Push | 20, 10 | |
Pop (10)
Pop (20) Push (20 – 10) = 10 |
10 | ||
15 | Push | 10, 15 | |
3 | Push | 10, 15, 3 | |
/ | Pop (3)
Pop (15) Push (15/3)=5 |
10, 5 | |
+ | Pop (5)
Pop (10) Push (10+5) = 15 |
15 | |
5 | Push | 15, 5 | |
★ | Pop (5) Pop (15) | 75 | |
Push (15*5)=75 | : Stack … |
Result : 75
Question 9.
(a) In SQL, write the query to display the list of tables stored in a database.
Answer:
SHOW TABLES;
(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 = “**0?”;
Answer:
The wildcards are incorrect. The corrected query is SELECT NAME FROM TEACHER WHERE NAME LIKE ‘- -0%’;
Question 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:
FIELD NAME | DATATYPE | REMARKS |
ADMNO | INTEGER CHAR(20) INTEGER CHAR(2) INTEGER VARCHAR (30) | Primary Key Not Null |
NAME | DATATYPE | |
CLASS | INTEGER CHAR(20) INTEGER CHAR(2) INTEGER VARCHAR (30) | |
SEC | DATATYPE | |
RNO | INTEGER CHAR(20) INTEGER CHAR(2) INTEGER VARCHAR (30) | |
ADRESS | DATATYPE |
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
( 4 Marks Each)
Question 11.
Write SQL queries for (a) to (b) based on the given tables, CUSTOMER and TRANSACTION.
Table: CUSTOMER
CNO | CNAME | ADRESS |
101 | Richa Jain | Delhi |
102 | Surbhi Sinha | |
103 | Lisha Thomas | Bangalore |
104 | Imran Ali | Delhi |
105 | Roshan Singh | Chennai |
Table: TRANSACTION
TNO | CNO | Amount | TYPE | DOT |
T001 | 101 | 1500 | Credit | 2007-11-23 |
T002 | 103 | 2000 | Debit | 2007-05-12 |
T003 | 102 | 3000 | Credit | 2007-06-10 |
T004 | 103 | 12000 | Credit | 2007-09-12 |
T005 | 102 | 1000 | Debit | 2007-09-05 |
(a) To display the detail of customers whose include Ali in their name.
Answer:
SELECT * FROM CUSTOMER WHERE CNAME LIKE “%ALi”;
(b) To display the AMOUNT of all Transactions done in the 2017 from table TRANSACTION.
Answer:
SELECT AMOUNT FROM TRANSACTION WHERE DOT = 2017);
(c) To display the last date of transaction (DOT) from the table TRANSACTION for the customer having CNO as 103.
Answer:
SELECT MAX (DOT) FROM TRANSACTION WHERE CNO=”103″;
(d) To display CNO, CNAME and TYPE with the help of both tables where address is not in Delhi and Bangalore-
Answer:
SELECT CNO, CNAME, TYPE FROM CUSTOMER C, TRANSACTION T WHERE C.CNO=T. CNO AND ADDRESS NOT IN (‘DELHI’, ‘BANGALORE’);
Question 12. (i) What do you mean by a modem? Why is it used?
OR
Identify the type of topology from the following:
(a) Each node can have an arbitrary number of child nodes.
Answer:
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.
Tree topology.
(b) Each node is connected with hub through independent cables.
Answer:
Star topology.
(ii) Write any two differences between twisted pair cable and coaxial cable.
Answer:
Twisted pair cable | Co-axial cable |
(i) Their bandwidth is not as high as coaxial cables. | (i) It has high bandwidth. |
(ii) A twisted pair consists of two copper wires twisted around each other (each has its own insulation around it) like a double helix. | (ii) A coaxial cable consists of a copper wire core covered by an insulating material and a layer of conducting material over that. |
Question 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:
Market to Finance | 80 mt |
Market to legal | 180 mt |
Market to Sales | 100 mt |
Legal to Sales | 150 mt |
Finance to Sales | 50 mt |
Number of computer in building:
Market | 20 |
Legal | 10 |
Finance | 08 |
Sales | 42 |
(a) Suggest a cable layout of connections between the Departments and specify the topology.
Answer:
Star topology should be used.
(b) Suggest the most suitable building to place the server by giving suitable reason.
Answer:
Sales is the most suitable building to place the server because it has maximum no. of computers.
(c) Suggest the placement of (i) Modem (ii) Hub/Switch in the network.
Answer:
Each building should have Hub/Switch and Modem in case Internal connection is required
(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:
MAN (Metropolitan Area Network).