Class 12 Term 2 Sample Paper Computer Science Set 4

Last updated on February 23rd, 2022 at 09:18 am

Class 12 Term 2 Sample Paper Computer Science Set 4

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 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

1. Give any two applications of stack

 

2 (i) Expand the following: POP3, HTTPS

(ii) Identify the Guided and Un-Guided Transmission Media out of the following: Satellite, Twisted Pair Cable, Optical Fiber, Infra-Red waves

 

3. Differentiate between WHERE and HAVING clause

 

4. Consider the given code:

import mysql.connector mydb=mysql.connector.connect (host=”localhost”, user=”root”, passwd=”kv”, database=”db”)
mycursor=mydb.cursor()
adm=1000
name=”Sonia”
mark=60
mycursor.execute(“INSERT INTO BOOKS (adm_no,name,mark) VALUES ({},'{}’,{})” .format(adm,name,mark))
mydb.commit()

a) Which record will get inserted in the table by the above code?

b) What is the role of using commit() here?

5. Write the output of the queries (a) to (d) based on the table,EMPLOYEE given below.

EMPIDNAMECITYPAY_LEVELSALARY
E01AISHWARYAMUMBAIL9200000
E02RITHUNAVDELHIL9300000
E03SHARUKHBHOPALL150000
E04MUMTAZDELHIL130000
E05JESS JOHNMAHARASHTRAL255000

 

a) SELECT SUM(SALARY) FROM EMPLOYEE WHERE CITY LIKE “M%”;

b) SELECT PAY_LEVEL FROM EMPLOYEE GROUP BY PAY_LEVEL HAVING COUNT(*)>1;

c) SELECT * FROM EMPLOYEE ORDER BY NAME DESC

d) SELECT NAME FROM EMPLOYEE WHERE SALARY<>54000

 

6. (a) Which command is used to view the list of databases in the system

(b) What is the difference between COUNT(*) and COUNT(<columnname>)

 

7. A department is considering to maintain their worker data using SQL to store the data. As a database administrator, Kiran has decided that :

Name of the database – Department

Name of the table – WORKER

The attributes of WORKER are as follows:

WORKER_ID – character of size 3

NAME – character of size 10

SALARY – numeric

JOINING_DATE – Date

DEPARTMENT – character of size 10

WORKER_IDNAMESALARYJOINING_DATEDEPARTMENT
100SAURAV1000002014-02-20ADMIN
101MONIKA2000002014-02-21HR
102KARAN300002012-22-20ACCOUNTS
103MITHUN2000002000-04-25ACCOUNTS
104NAYANA5000002010-08-29ADMIN
105RIYAS3000002011-02-12ADMIN

a) Write a query to create the given table WORKER.

b) Identify the attribute best suitable to be declared as a primary key

OR

Consider the table DEPT given below:

DEPTIDHOD
D01RAJU
D02MANJU
D03YADHU

a) What will be the degree and cardinality of cartesian product of the tables Worker and Dept

b)Name the constraint to be used while creating the table DEPT to ensure the column DEPTID is not null.

SECTION – B

Each question carries 3 marks

8. Amar has a list containing details, which include RNO,NAME and AGE , of 5 students. Write a program with separate user defined functions to perform the following operations

# Push RNO of students into a stack, where the corresponding age is less than 18

# Pop and display the content of the stack.

Or

Hari has a list containing 6 elements. You need to help him to write a function in Python PUSH(Arr),where Arr is a list of numbers, to push all odd numbers from Arr into a stack implemented by using a list. Display the stack if it has at least one element, otherwise display “stack empty” message.
>>> Arr=[10,61,88,101,26,28]
>>> PUSH(Arr)
The item 10 can’t be inserted because it is not an odd number
The item 88 can’t be inserted because it is not an odd number
The item 26 can’t be inserted because it is not an odd number
The item 28 can’t be inserted because it is not an odd number
Stack elements after push operation : [101, 61]

 

9 (i) Identify the error in the following SQL query which is expected to delete all rows of a table TEMP without deleting its structure and write the correct one:
DELETE TABLE TEMP;

(ii) Differentiate Primary Key and Foreign Key with an example

 

10. Pratap has created a table STOCK . Now, he came to know that one more column,STACKDATE is needed in the table and also wanted to modify the size of ITEM_NAME to 100.The table STOCK has the following structure:

Table:STOCK

ITEM_IDITEM_NAMEQTYUNIT_PRICE
I001Drawing Copy320
I002Sharpener Camlin105
I003Eraser Natraj104

Help him to complete the tasks by suggesting appropriate SQL commands.

SECTION – C

Each question carries 4 marks

11.  Write Queries a) to d) based on the tables STUDENT and LIBRARY given below:

Table:STUDENT

ADM_NOCLASSRNONAMEAGECITYFEE
100X1SAMEER34DELHI45000
101XII10ARYAN35MUMBAI54000
102XI2RAM34CHENNAI45000
103XI4PREMLATA36BHOPAL60000
104XII2SHIKHA36INDORE34000
105X2RADHA33DELHI23000

Table:LIBRARY

LIB_IDCLASSRNOBOOK_ISSUE
1000XII10PYTHON PROGRAMMING
1001XII2C++ PROGRAMMING
1002X1ESSENTIALS OF AI
1003X2Basics of HTML
1004XI2Fun With C
1005XI4JAVA Programming

a) To display the details of students from Delhi who pay fees more than 30000

b) To display all the students whose name, begin with ‘S’

c) To display total fee paid class-wise.

d) To display admission number, student name and name of the book issued.

12 (i) Differentiate between Bus Topology and Star Topology of Network

Or

Give the differences between HTML and XML.

(ii) How is switch different from hub? Which is more preferable in a large network of computers and why?

 

13. “Mumbai Corps” is planning to expand their network in India, starting with two cities in India to provide infrastructure for distribution of their product. The company has planned to set up their main office units in Mumbai at three locations and have named their offices as “Production Unit”, “Finance Unit” and “Training Unit”. The company has its corporate unit in New Delhi. A rough layout of the same is as follows:

CS SAMPLE

Approximate distances between these Units is as follows

Production to Finance Unit : 70 Mtr
Production to Training Unit : 15 KM
Production to Corporate Unit : 2112 KM
Finance to Training 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:

Number Of Computers

Production Unit : 150
Finance Unit : 35
Training Unit : 10
Corporate Unit : 30

a) Suggest the kind of network required (out of LAN, MAN, WAN) for connecting each of the following office units:

i) Production Unit and Training Unit

ii) Production Unit and Finance Unit

b) Which of the following communication media, will you suggest to be procured by the company for connecting their local offices in Mumbai for very effective communication? Ethernet Cable, Optical Fiber, Telephone Cable.

c) Which of the following devices will you suggest for connecting all the computers within each of their office units?

i)Switch/Hub

ii)Modem

iii)Telephone

d) Suggest the most suitable place to house the server for the organization with suitable reason.

Copywrite © 2020-2025, CBSE Python,
All Rights Reserved