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
Maximum Marks: 35
Time: 2 hours
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
(Each question carries 2 Marks)
Question 1.
Why are data structures important? Give any two reasons.
Answer:
- Specific data structures are essential ingredients of many efficient algorithms and make possible the management of huge amounts of data, such as a large integrated collection of databases.
- Some programming languages emphasize on data structures rather than algorithms as the key organising factor in software design.
Question 2.
(i) Expand the following
(a) ARPANET
Answer:
ARPANET → Advanced Research Projects Agency Network
(b) ISP
Answer:
ISP → Internet Service Provider
(ii) Name the types of twisted pair cable.
Answer:
(a) Shielded Twisted Pair (STP) cable.
(b) Unshielded Twisted Pair (UTP) cable
Question 3.
Give the differences between primary key and foreign key in a table.
Answer:
Differences between primary key and foreign key are as follows:
Primary Key | Foreign Key |
Primary key uniquely identifies a record in the table. | Foreign key is a field in the table that is primary key in another table. |
It cannot have null values. | It can have null values. |
Only one primary key is possible in a table. | More than one foreign keys are possible in a table. |
Question 4.
Write the queries for the following questions using the table Product with the following fields
(P_ Code, P_Name, Qty, Price)
(i) Display the price of product having code as P06.
Answer:
SELECT Price FROM Product WHERE P_Code=“P06”;
(ii) Display the name of all products with quantity greater than 50 and price less than 500.
Answer:
SELECT P_Name FROM Product WHERE Qty>50 AND Price<500
Question 5.
Write the output of the queries (i) to (iv) based the table STUDENT,
Table : Student
(i) SELECT *FROM Student WHERE Grade = “A+”;
Answer:
(ii) SELECT RollNo, Marks FROM Student WHERE Name LIKE “R%”;
Answer:
(iii) SELECT MAX (Marks) FROM Student;
Answer:
(iv) SELECT Name FROM Student WHERE Marks > 80;
Answer:
Question 6.
(i) In SQL, which command is used to select only one copy of each set of duplicate rows?
Answer:
DISTINCT
(ii) Write the command to insert the row (18, Shaurya, 88, A) to the table Student whose fields are (RollNo, Name, Marks, Grade).
Answer:
INSERT INTO Student (RollNo,
Name, Marks, Grade)
VALUES (18, “Shaurya”, 88, “A”);
Question 7.
Consider the table Student given below
Table : Student
(i) Identify the degree and cardinality of a table.
(ii) Choose the field which can be used as primary key.
Or
(i) Identify the candidate key(s) of table Student.
(ii) Which command is used to show the content of table Student?
Answer:
(i) Degree: 4
Cardinality: 5
(ii) StudentId because it is identifying the record uniquely.
Or
(i) StudentId, FirstName, LastName
(ii) DESC Student;
Section – B
(Each question carries 3 Marks)
Question 8.
Anjali has a list containing 10 integers. You need to help her create a program with separate user defined functions to perform the following operations based on this list.
- Traverse the content of the list and push the numbers into the stack which are divided by 5.
- Pop and display the content of the stack
Sample input
L1 = [23, 45, 12, 75, 90, 17, 87, 42, 72, 65]
Sample output
45 75 90 65
Or
Write an algorithm to convert infix expression to postfix expression using stack.
Answer:
L1 = [23, 45, 12, 75, 90, 17, 87, 42, 72, 65] def INPUT(S, L1): S.append (L1) def OUT(S): if S! = [ ]: return S.pop( ) else: return None Stack1 =[ ] for i in L1: if i% 5 = = 0: INPUT(Stack1, i) whi1e True: if Stackl !=[]: print(OUT(Stack1), end = “ ”) else: break
Or
Algorithm Steps:
- Step1: First of all enclose the EXP in parentheses, i.e. ( ).
- Step 2: Read next symbol of EXP and repeat steps 3 to 6 until the STACK is empty.
- Step 3: If the symbol read is operand then add it to PE.
- Step 4: If the symbol read is ’( ’ then Push it into STACK.
- Step 5: If the symbol read is operator then
- Repeat while (Priority of TOP (STACK) > Priority of operator) Pop operator from STACK and add operator to PE.
- Push operator into STACK.
- Step 6: If the symbol read is ‘)’ then
- Repeat while (TOP (STACK)! = ‘ ( ’ )
Pop operator from STACK
Add operator to PE - Remove the ‘(’. [It must not be added to PE].
- Repeat while (TOP (STACK)! = ‘ ( ’ )
- Step 7: PE is the desired equivalent postfix expression.
- Step 8: Stop
Question 9.
(i) Write the statement to delete person named “Kari Pettersen” in the table PERSONS,
Answer:
DELETE FROM PERSONS
WHERE Name = “Kari Pettersen”;
(ii) Can we add any attribute in an existing table? If yes,
(a) Add SALARY attribute in a TEACHER table which already has TeacherlD and Tname as fields.
(b) After adding SALARY field add check constraint on SALARY that it should be at least 20000.
Answer:
Yes, we can add new attributes in an existing table. This can by using an ADD option with ALTER TABLE command. Add attribute salary in teacher table
(a) ALTER TABLE TEACHER ADD SALARY INT;
(b) ALTER TABLE TEACHER
ADD CHECK (SALARY>=20000);
Question 10.
Create a database FAME in MySQL. Also, create a table named FAMILY in the database to store the detail of family’s members. The table FAMILY has the following structure
Field Name | Data Type | Remark |
Id | Integer (2) | Primary Key |
Name | Char (20) | Not Null |
FemaleMembers | Integer (2) | |
MaleMembers | Integer (2) | |
Income | Float (5) | |
Occupation | Char (20) |
Answer:
CREATE DATABASE FAME;
CREATE TABLE FAMILY
(Id Integer (2) Primary Key,
Name Char (20) Not Null,
FemaleMembers Integer (2),
MaleMembers Integer (2),
Income FI oat (5),
Occupation Char (20));
Section – C
(Each question carries 4 Marks)
Question 11.
Study the following tables FLIGHTS and FARES and write SQL commands for the questions (i) to (iv).
Table: FLIGHTS
Table : FARES
(i) Display FL_NO and NO_FLIGHT from KANPUR to BENGALURU from the table FLIGHTS.
Answer:
SELECT FL_N0, N0_FLIGHT FROM
FLIGHTS WHERE STARTING = ‘KANPUR’ AND ENDING = ‘BENGALURU’;
(ii) Arrange the contents of the table FLIGHTS in the ascending order of FL_NO.
Answer:
SELECT * FROM FLIGHTS ORDER BY FL_N0;
(iii) Display the FL_NO and fare to be paid for the flights from DELHI to MUMBAI using the tables FLIGHTS and FARES, where the fare to be paid = FARE + FARE * TAX % 100.
Answer:
SELECT FL_N0, FARE + FARE * TAX%100 FROM FARES WHERE FL_N0 = (SELECT FL_No FROM FLIGHTS WHERE STARTING = ‘DELHI’ AND ENDING = ‘MUMBAI’ ) ;
(iv) Display the minimum fare INDIAN AIRLINES is offering from the table FARES.
Answer:
SELECT MIN( FARE) FROM FARES GROUP BY AIRLINES HAVING AIRLINES = ‘INDIAN AIRLINES’;
Question 12.
(i) Give any two needs of computer networking.
Or
What is WWW? Also, explain HTML and URI.
Answer:
Needs of computer networking are as
follows
(a) Resource Sharing Computer networking also allows the sharing of network resources, such as printers, scanners, dedicated servers, backup systems, input devices and Internet connections. By sharing resources, unique equipment like scanners, printers etc., can be made available to all network users simultaneously without being relocated, eliminating the need for expensive redundancies.
Data Protection and Redundancy Computer networking allows users to distribute copies of important information across multiple locations, ensuring essential information is not lost with the failure of any one computer in the network. By utilising central backup systems both on-site and off-site, unique documents and data can be gathered automatically from every computer in the network and securely backed up in case of physical computer damage or accidental deletion.
Or
- The World Wide Web (WWW) or Web in short, is an ocean of information, stored in the form of trillions of interlinked web pages and web resources.
- The resources on the web can be shared or accessed through the Internet.
- HTML HyperText Markup Language (HTML) is a language, which is used to design standardised web pages so that the web contents can be read and understood from any computer. Basic structure of every web page is designed using HTML.
- URI Uniform Resource Identifier (URI) is a unique address or path for each resource located on the web. It is also known as Uniform Resource Locator (URL). Every page on the web has a unique URL. For example, https://www.mhrd.gov.in, http:// www.ncert. nic.in, http://www.airindia.in, etc.
(ii) What do you mean by bandwidth and data transfer rate of a channel?
Answer:
In data communication, the transmission medium is also known as channel. The capacity of a channel is the maximum amount of signals or traffic that a channel can carry. It is measured in terms of bandwidth and data transfer rate as described below
Bandwidth Bandwidth of a channel is the range of frequencies available for transmission of data through that channel. Higher the bandwidth, higher the data transfer rate. Normally, bandwidth is the difference of maximum and minimum frequency contained in the composite signals. Bandwidth is measured in Hertz (Hz).
- 1 kHz =1000 Hz
- 1 MHz =1000 kHz = 1000000 Hz
Data Transfer Rate: Data travels in the form of signals over a channel. One signal carries one or more bits over the channel. Data transfer rate is the number of bits transmitted between source and destination in one second. It is also known as bit rate. It is measured in terms of bits per second (bps). The higher units for data transfer rates are
- 1 Kbps = 210 bps=1024 bps
- 1 Mbps = 220 bps=1024 Kbps
- 1 Gbps = 230 bps=1024 Mbps
- 1 Tbps = 240 bps=1024 Gbps
Question 13.
China Middleton Fashion is planning to expand their network in India, starting with two cities in India of provide infrastructure for distribution of their product. The company has planned to set up their main office units in Chennai at the different locations and have named their offices as Production Unit, Finance Unit and Media Unit. The company has its Corporate Unit in Delhi. A rough layout of the same is as follows
The approximate distance between these units are as follows:
From | To | Distance |
Production Unit | Finance Unit | 70 m |
Production Unit | Media Unit | 15 km |
Production Unit | Corporate Unit | 2112 km |
Finance Unit | Media Unit | 15 km |
In continuation of the above, the company experts have planned to install the following number of computers in each of their office units
Production Unit | 150 |
Finance Unit | 35 |
Media Unit | 10 |
Corporate Unit | 30 |
(i) Suggest the kind of network required (out of LAN, MAN, WAN) for connecting each of the following office units
(a) Production Unit and Media Unit.
(b) Production Unit and Finance Unit.
Answer:
(a) MAN
(b)LAN
(ii) Which one of the following device will you suggest for connecting all the . computers with in each of their office units?
(a) Switch/Hub
(b) Modem
(c) Telephone
Answer:
Switch/Hub
(iii) Suggest a cable/wiring layout for connecting the company’s local office units located in Chennai. Also, suggest an effective method/technology for connecting the company’s office unit located in Delhi.
Answer:
An effective method/technology for connecting the company’s office in Delhi and Chennai is broadband connection.
(iv) Suggest the most suitable place to install the server with reason.
Answer:
Production unit is suitable to install the server because it has maximum number of computers.