Class 12 Term 2 Sample Paper Computer Science Set 3

Subject: Computer Science

Subject Code: 083

Class : 12

Maximum Marks: 35 Time: 2 hours

General Instructions

The question paper is divided into 3 sections – A, B and C

● Section A, consists of 8 questions (1-7). Each question carries 2 marks.

● Section B, consists of 4 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,12

SECTION-A

(Each question carries 2 marks)

1. Show the Stack’s status after each of the following operations. Show position of top by underlining the element.Stack ‘s’ is initially empty.

i) s.push(10)

ii) s.push(20)

iii) s.pop()

iv) s.push(15)

v) s.push(20)

 

2. (i) Expand the following:

NIC, ARPANET

(ii) Which of the following is omnidirectional?

Infrared, Microwave, Radio wave

 

3. Differentiate between order by and group by with example.

 

4. The ‘STUDENT’ table is stored in the database ‘SCHOOL’ in MySQL. The database credentials include host as ‘localhost’, user as ‘root’ and password as ‘cloud’. Write python script to do the following:

● Import necessary modules to establish MySQL connectivity with Python

● Write a statement to establish connection to the database using given credentials.

 

5. Consider the following table ITEM

PRICE NAME
20 BOOK
4 PENCIL
15 PEN
5 ERASER
30 PEN

Write the output for the following queries :

a)Select SUM(PRICE) from ITEM where Name LIKE ‘P%’;

b)Select * from ITEM wherePRICE IN ( 4,20);

c)Select COUNT(DISTINCT NAME) FROM ITEM;

d)Select MAX(PRICE) as HIGHEST PRICE FROM ITEM; 

 

6. (i) Which command is used to open a database? 

(ii) Which keyword is used to eliminate duplicate values in a column while displaying?

 

7. Consider the following table Student.

SUBJECT MARK
CS 25
MATHS 30
PHYSICS 25
ENGLISH 36
CHEMISTRY 29

 

a)Write Cardinality and degree of the above table.

b)Insert a new row to the table Student.

OR

a)Update the mark of ENGLISH as 30 using SQL Command.

b)Write SQL command to display details like data types,name of column,constraints etc. of a table.

SECTION -B

Each question carries 3 marks
8. Mr.Ajay has created a list of elements. Help him to write a program in python with functions, PushEl(element) and PopEl(element) to add a new element and delete an element from a List of element Description, considering them to act as push and pop operations of the Stack data structure . Push the element into the stack only when the element is divisible by 4.

For eg:if L=[2,5,6,8,24,32]
then stack content will be 32 24 8

OR

Ms.Suparna has created a dictionary containing employee IDs and salaries as key value pairs of 10 employees. Write a program to perform the following operations using separate user defined functions.
● Push the keys (IDs) of the dictionary into the stack, if the corresponding salary is >30000.
● Pop and display the content of the stack
For eg:if D={1101:34000,1201:23000,1190:40000}
Then output will be 1190 1101 3

9. (i) Consider the following tables.

Table: Order

OrderId OrderDate SalesPerson OrderAmount
101 2015/01/10 R.K. 1100
102 2015/04/01 R.S. 2100
103 2015/06/03 R.K. 3000
104 2015/07/09 M.S. 2000
105 2015/12/10 R.S 1200

Table:SalesPesron

SID OrderId Area
S0010 O101 TVM
S0010 O103 KLM
S0014 O104 PKD

 

a)Suggest the foreign key for the table SalesPerson.

b)Name the data types of the columns OrderDate and OrderAmount .

 

(ii) Differentiate between having and where clause. 

10. Mr.Sandeep is working as Database Administrator .He designs the following database table to store the information on candidates who register for examination.

Table:Candidates

Field Name Data Type Remarks
CNO Char(8) Candidate Number
CNAME varchar(30) Name of candidate
DOB Date Date of Birth of Candidate

 

i) Help him to identify the primary key of the table.

ii) Write SQL command to create the above table. Also mention the advantage of using varchar data type over char data type for storing names.

SECTION C

Each question carries 4 marks
11. Study the following tables DOCTOR and SALARY and write SQL commands for the questions (a) to (d)

Table: DOCTOR

ID NAME DEPT SEX EXPERIENCE
109 Mehul MEDICINE F 9
105 Jonson ORTHOPEDIC M 10
117 Lucy ENT F 3
111 Becon MEDICINE F 10
130 Morphy ORTHOPEDIC M 15

 

TABLE:SALARY

ID BASIC ALLOWANCE CONSULTATION
101 12000 1000 300
104 23000 2300 500
107 32000 4000 500
114 12000 5200 100
109 42000 1700 200

 

(a) Display NAME of all doctors who are in “MEDICINE” and having more than 10 years experience from table DOCTOR.

(b) Display the average salary of all doctors working in “ENT” department using the tables DOCTOR and SALARY. Salary=BASIC+ALLOWANCE.

(c) To display total number of lady doctors.

(d) To display department wise maximum year of experience.

12 (i) Write the function of following devices : a)Modem b)Switch

OR

How is XML differ from HTML? 

(ii) Compare LAN,MAN,WAN

 

13. The NEW INDIA Organization has set up its new Branch at Mizoram for its office and web based activities .It has 4 wings to building as shown in the diagram.

Center to center distance between various blocks

Wing  X To  Wing   Z 40 m
Wing  Z To  Wing   Y 60 m
Wing  Y To  Wing   X 135 m
Wing  Y To  Wing   U 110 m
Wing  X To  Wing   U 165 m
Wing  Z To  Wing   U 90 m

Number of computers

 Wing   X 50
Wing   Z 130
Wing   Y 40
Wing   U 15

(i) Suggest a suitable layout of connection between the wings and topology.

(ii) Suggest a suitable place (i.e. wing) to house the server of this organization with a suitable reason with justification.

(iii) Suggest the placement of the following devices with justification. (a)Repeater (b) Hub/Switch

(iv) Suggest the most suitable wired medium for efficiently connecting each computer installed in every building out of the following network cables.

• Co-axial cable

• Ethernet cable

• Single pair telephone cable

 

Source:KVS RO ERNAKULAM

Copywrite © 2020-2024, CBSE Python,
All Rights Reserved
error: Content is protected !!