Students can access the CBSE Sample Papers for Class 12 Computer Science with Solutions and marking scheme Term 2 Set 6 will help students in understanding the difficulty level of the exam.
CBSE Sample Papers for Class 12 Computer Science Term 2 Set 6 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)
Evaluate following postfix expression using a stack and show content of the stack after each step.
8, 2, +, 9, +, 2, 8,*,+
Given, postfix expression is 8, 2, +, 9, +, 2, 8, *, +
|+||Pop two elements 2 and 8, 2+ 8=10 (Push)||10|
|+||Pop two elements 10 and 9, 9 + 10 = 19 (Push)||19|
|*||Pop two elements 8 and 2,2*8 = 16 (Push)||19,16|
|+||Pop two elements 19 and 16*, 16 + 19 = 35||35|
(i) Expand the following
(a) HTTP—HyperText Transfer Protocol
(b) VoIP—Voice over Internet Protocol
(ii) What is the name of the network topology in which there are bi-directional links between each possible node?
What do you mean by referential integrity?
A referential integrity is a system of rules that a DBMS uses to ensure that relationships between records in related tables are valid and that users do not accidently delete or change related data. We can set the referential integrity when all of the following conditions are met
- The matching field from the primary table is a primary key or has a unique value.
- The related fields have the same data types.
- Both tables belong to the same database.
Write the code to create the connection in which database’s name is Python, name of host, user and password can be taken by user. Also, print that connection.
import mysql. connector mycon = mysql . connector, connect ( host = "localhost", user = "test", passwd = "testData", database = "Python") print(mycon)
Write the output of the queries (i) to (iv) based on the table TEACHER given below
(i) SELECT TeacherlD, DOJ FROM TEACHER WHERE Departments’Computer’ OR Department=’Math’;
(ii) SELECT DISTINCT Department FROM TEACHER;
(iii) SELECT Department, COUNT!*), MIN(Salary) FROM TEACHER GROUP BY Department HAVING COUNT(*)>1:
(iv) SELECT SUM (Salary) FROM TEACHER WHERE Gender = “M”;
(i) Which aggregate function returns the count of all rows in a specified table?
(ii) Which keyword can be used to return only different values in a particular column or a whole table?
Observe a table ITEM and answer the following questions.
(i) Write names of columns can be considered for a candidate key.
(ii) Write an SQL query to display all the items where Qty is more than 20.
(i) Display Itemno, Name and Qty in descending order of the Qty from table ITEM.
(ii) Identify the primary key. Also, give the reason to choose primary key of particular field.
(i) Itemno, Name are most appropriate for making candidate key.
(ii) SELECT * FROM ITEM WHERE Qty>20;
(i) SELECT Itemno, Name, Qty FROM ITEM ORDER BY Qty DESC;
(ii) Itemno should be made the primary key as it uniquely identifies each record of the table.
(Each question carries 3 Marks)
A list has containing 5 integers. To create a program with separate user defined functions to perform following tasks:
- Insert odd numbers
- Remove and display the content of the stack For example,
LI = [15, 26, 72, 53, 44]
A linear stack called Status contains the following information
(i) Phone number of Employee
(ii) Name of Employee
Write the method to perform the operation Pop to pop an object from the stack and to release the memory.
LI = [15, 26, 72, 53, 44] def Insert (E, LI): E.append (LI) def Delete ( E): if E! = [ ]: return E. pop ( ) else : return None Stack1 = [ ] for i in [ ] : if i% 2! = E: Insert (Stack1, i) while True: if Stack1 ! = [ ]: print(Delete(Stackl), end = " ”) else: break Or def Pop_element(Status, Top): Slen = len(Status) if (Slen < = 0): print (“Status is empty”) else: phone_no*, emp_name = Status. pop( ) Top = Top - 1 print (“Phone number % s and Name %sdeleted” % (phone_no, emp_name)) return Top
(i) Which method is used to create a connection between the MySQL database and Python?
(ii) What are different type of commands category is provided by SQL?
SQL provides different type of commands used for different purposes
- DDL Data Definition Language called as DDL, used to define all the commands which are related with the definition of a relation. Such as – CREATE TABLE, ALTER TABLE, etc.
- DCL Data Control Language called as DCL, used to control the access of the users inside the database by using some set of SQL commands. Such as – GRANT and REVOKE.
- DML Data Manipulation Language called as DML, used to define all the SQL commands required for data manipulation is table. Such as – INSERT, DELETE, etc.
- TCL Transaction Control Language called as TCL, used to define all the commands deals with transactions in the database. Such as – COMMIT, ROLLBACK, etc.
Create a database University in MySQL. Also, create a table STUDENT with given constraints and data types for each column.
Rollno – integer and primary key,
Sname – character max length 20, cannot be empty DOB – date type,
Phoneno – character max 10
CREATE DATABASE University: CREATE TABLE STUDENT ( Rollno INT, Sname VARCHAR(20) NOT NULL, DOB DATE, Phoneno CHAR(10), PRIMARY KEY(Rol1 no));
(Each question carries 4 Marks)
Write SQL queries for (i) to (iv) based on tables TEACHER and POSTING.
(i) Display number of male and female teachers.
SELECT Gender, COUNT(*) FROM TEACHER GROUP BY Gender;
(ii) Display TeacherlD and Tname working in Delhi.
SELECT Teacherld, Tname, City
FROM TEACHER, POSTING WHERE
(iii) Display Tname, DOJ and Gender whose Salary is less than 45000.
SELECT Tname, D0J, Gender FROM TEACHER WHERE Salary<45000;
(iv) Display number of teachers’ department wise.
SELECT Department, COUNT(*) FROM TEACHER GROUP BY Department;
(i) Explain the “distributed computing power can be achieved” using networking.
Define advantages and disadvantages of fibre optical cables.
(i) In computer networks, we can distribute tasks across multiple computers throughout the network, by breaking complex problems into hundreds or thousands of smaller operations, which are then parcelled out to individual computers. Each computer in the network performs its operations on its own portion of the larger problem and return its result. Then, all these results are gathered in such a form that impact as the solution of the complex problem and finally are used for the further task.
There are some advantages of fibre optical cable
- These are highly suitable for harsh industrial environment. These are immune to noise caused by electrical and magnetic fields.
- It can support dramatically higher bandwidths (and hence data rates) than either twisted pair or co-axial cable.
There are some disadvantages of fibre optical cable
- These are very difficult to install and maintain.
- They require more protection around the cable than copper cables.
- Propagation of light is uni-directional. For bi-directional communication, two fibres are needed. These are relatively more expensive than other guided media.
(ii) Compare and contrast the wireless transmission media- bluetooth and infrared.
Differences between bluetooth and infrared are as follows
|Bluetooth uses low power radio waves.||Infrared uses infrared waves.|
|Bluetooth has a transmission range of upto 240 metres.||Infrared has a transmission range of 5 metres.|
|Bluetooth is not limited to line of sight communication.||Infrared works only in direct line of sight,|
A university is setting a network between the buildings. The University has 4 blocks – Admin(A), Technology(T), Workshop(W) and HR(H).
Distance between wings are as follows
A to T -100 m
A to W – 200 m
A to H – 300 m
T to H – 400 m
T to W -100 m
W to H – 350 m
Number of computers installed at each building
A – 15
T – 100
W – 30
H – 10
(i) Suggest most suitable place to install a server.
Most suitable building is “Technology” block to install a server because it has maximum number of computers.
(ii) Suggest a layout to connect these blocks for wired channel.
(iii) Which device will be suggested by you to install in each block for efficient connection of all computers within block?
Switch is a perfect device for making connection between computers within a block.
(iv) Suggest the placement of repeater.
Repeater can be placed when distance between two buildings are more than 70 metres. Total 4 repeaters can be placed.