Students can access the CBSE Sample Papers for Class 12 Computer Science with Solutions and marking scheme Term 2 Set 10 will help students in understanding the difficulty level of the exam.
CBSE Sample Papers for Class 12 Computer Science Term 2 Set 10 with Solutions
Maximum Marks: 35
Time: 2 hours
- 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)
What is stack? Also, give some of the examples of stack.
In computer science, a stack is an abstract data type and a linear or user-defined data structure based on the principle of Last In First Out (LIFO).
A stack is a list where insertion and deletion can take place only at one end called Top.
A stack can be implemented using array and using linked list structure, depending upon the requirement.
Some of the examples of stack in real life are
- Stack of coins.
- Plates placed one above another.
- Pile of books.
- Pile of clothes in an almirah.
- Multiple chairs in a vertical pile.
(i) Expand the following
(a) URL → Uniform Resource Locator
(b) LAN → Local Area Network
(ii) Which network is suitable to connect computers across different cities?
MAN (Metropolitan Area Network)
What is the difference between HAVING clause and WHERE clause?
Differences between HAVING clause and WHERE clause are:
|WHERE clause||HAVING clause|
|WHERE clause is used to filter the records from the table based on the specified condition.||HAVING clause is used to filter record from the groups based on the specified condition.|
|WHERE clause implements in row operation.||HAVING clause implements in column operation.|
|WHERE clause cannot contain aggregate function.||HAVING clause can contain aggregate function.|
|WHERE clause can be used with SELECT, UPD ATE, DELETE statement.||HAVING clause can only be used with SELECT statement.|
|WHERE clause is used with single row function like UPPER, LOWER etc.||HAVING clause is used with multiple row function like SUM, COUNT etc.|
What is the use of foreign key field?
A foreign key field can be used to link two or more tables to get linked data. This field must be present in both the tables, so that the values in the foreign key field may be compared or joined to get the corresponding data from all the participating tables.
Write the output of the queries (i) to (iv) based on the table, BOOK given below
(i) SELECT Bname, Publisher FROM BOOK WHERE Price < 1000;
(ii) SELECT Publisher FROM BOOK WHERE DtofPub IS NOT NULL;
(iii) SELECT MAX (Price) FROM BOOK;
(iv) SELECT BookID, Bname FROM BOOK WHERE Publisher IN (“PHI”);
(i) Which command is used to display the name of existing databases;
(ii) Given the command below
DELETE FROM Toys WHERE ToyName LIKE “S_t%”;
Which record will be deleted by the above command?
The command has a LIKE clause with “S_t%” which means all the toy names that start with the letter ‘S’ and has 3rd letter as ‘t’ will deleted.
Consider the table, PREPAID given below
(i) Identify the degree and cardinality of the table.
(ii) Which field should be made the primary key?
(i) Identify the candidate key(s) from the table PREPAID.
(ii) Which command is used to add another column ‘Amount’ into a table PREPAID?
(i) Degree = 4
Cardinality = 4
(i) S_No, C_Name
(ii) ALTER TABLE PREPAID ADD Amount Integer(5);
Section – B
(Each question carries 3 Marks)
A linear stack called Status contains the following information
(i) Phone number of Employee
(ii) Name of Employee
Write the following methods to perform given operations on the stack Status
- Push_element () To Push an object containing Phone number of Employee and Name of Employee into the stack.
- Pop_element () To Pop an object from the stack and to release the memory.
Convert the expression given below from infix to postfix using stack, showing each operation.
(A+ B/(C *D)-E)
(i) defPush_element (Status, Top) :
phone_no = int (input (“Enter phone number:”)
emp_name = input (“Enter employee name:”)
St = (phone_no, emp_name)
Top =Top + 1 return Top
(ii) def Pop_element (Status, Top):
Slen = len (Status)
if (Slen <= 0):
print (“Status is empty”)
phone_no, emp_name = Status. pop()
Top = Top – 1
print(“Phone number %s and name %s deleted” % (phone_no, emp_name))
Given infix expression is (A+B/(C*D)-E)
(i) What is the meaning of GROUP BY clause in MySQL?
Through GROUP BY clause, we can create groups from a column of data in a table.
(ii) Write a query to display the Sum, Average, Highest and Lowest marks of the students grouped by subject and sub-grouped by class.
SELECT SUM (marks), AVG (marks), MAX (marks), MIN (marks) FROM students GROUP BY subject, class ;
Consider the table Faculty whose columns’ name are
F_ID, Fname, Lname, Hire_date, Salary, Course_name
Write the code to insert the following record into the given table.
import mysql.connector mycon = mysql.connector.connect (host = "localhost”, user = “root”, passwd = “system”, database = "Test”) cursor = mycon.cursor( ) sql = “INSERT INTO Faculty (F_ID, Fname, Lname, Hire_date, Salary, Course_Name) VALUES (%s, %s, %s, %s, %s, %s)” val = [(101, ‘Riya’, ‘Sharma’, ‘12-10-2004’, 35000, ‘Java Advance’), (102, ‘Kiyaan’, ‘Mishra’, ‘3-12-2010’, 28000, ‘Data Structure’)] try: cursor.executemany(sql, val) mycon.commit( ) except: mycon.rollback( ) mycon.close( )
Section – C
(Each question carries 4 Marks)
Write SQL commands with respect to the Employee table given below.
Table : Employee
(i) Display name and department of Employees whose name begins with” S”.
SELECT Ename, Dept FROM Employee WHERE Ename LIKE “S%”;
(ii) Display details of Employees whose designation ends with “r”.
SELECT*FR0M Employee WHERE Desig LIKE “%r”;
(iii) Display details of Employees whose name has 1st letter “P” and 3rd letter “i”.
SELECT * FROM Employee WHERE Ename LIKE “P_i%”.
(iv) Display name, department and salary of Employees whose department name ends with “s”.
SELECT Ename, Dept, Salary FROM Employee WHERE Dept LIKE “%s”;
(i) What is the use of ethemet cable?
Write the advantages and disadvantages of ethernet cable
An ethernet cable is one of the most popular form of network cables which are used in wired networks. It is used to build LAN networks. It connects various devices available locally on LAN, such as PCs, printers, routers and switches, etc. A crossover cable is a special type of ethemet cable specially designed for connecting two computers to each other. By contrast, most ethemet cables are designed to connect one computer to a router or a switch. A single ethemet cable can extend only limited distances due to their electrical transmission characteristics.
RJ-45 is the most commonly used ethernet cable.
Some advantages of ethemet cable are as follows
(a) It gives fast, secured, reliable transmission across them and external disturbances are very less.
(b) You can transfer any large data between two or more PC’s which are locally connected through ethemet.
(c) These are robust to noise, thus external disturbances are very less.
Some disadvantages of ethernet cable are as follows
(a) As the load on ethemet increases, number of collision increases, therefore efficiency decreases.
(b) It offers non-deterministic service, so it is not suitable for real-time application.
(c) Higher costs for provisioning in existing building.
(ii) What is network topology? Also, explain any two network topologies.
The arrangement of nodes in any computer network is called as network topology.
(a) Star Topology This topology is a topology for a Local Area Network (LAN) in which all nodes are individually connected to a central connection point, like a hub or a switch. A star takes more cable than e.g. a bus, but the benefit is that if a cable fails, only one node will be brought down.
(b) Mesh Topology In this topology, there is no central connection point. Instead, each node is connected to at least one other node and usually to more than one. Each node is capable of sending messages to and receiving messages from other nodes. The nodes act as relays, passing on a message towards its final destination.
Trine Tech Corporation (TTC) is a professional consultancy company. The company is planning to set up their new offices in India with its hub at Hyderabad. As a network adviser, you have to understand their requirement and suggest them the best available solutions. Their queries are mentioned as (i) to (iv) below.
Physical locations of the blocks of TTC
Block to block distances (in m)
|Block (From)||Block (To)||Distance|
Expected number of computers:
(i) Which will be the most appropriate block, where TTC should plan to install their server?
TTC should install its server in finance block as it is having maximum number of computers.
(ii) Draw a block to block cable layout to connect all the buildings in the most appropriate manner for efficient communication.
(iii) Which of the following device will be suggested by you to connect each computer in each of the buildings?
(iv) Company is planning to connect its offices in Hyderabad which is less than 1 km. Which type of network will be formed?