Class 12 Term 2 Sample Paper Computer Science Set 2

Last updated on May 27th, 2022 at 11:27 am

Class 12 Term 2 Sample Paper Computer Science Set 2

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. What is a data structure? Give two examples. 

Ans: Data structure is a means of organising and storing data in such a way that an operation can be performed on it more efficiently. Ex Stack, queue etc.

 

2. (i) Expand the following: FTP, URL

Ans: FTP- File Transfer Protocol

URL- Uniform Resource Locater

 

(ii) Which type of network (out of LAN, PAN and MAN) is formed, when you connect two mobiles using Bluetooth to transfer a video?

Ans: PAN

 

3. Differentiate between DDL and DML commands.

Ans: 

DDL (Data Defining Language)DML (Data Manipulation Language)
It is used to create database schemaIt is used to add, retrieve or update data
It defines the coloumn of the tableit add or update the row of the table
Ex: Create, Drop, AlterEx: Update, Insert

 

 

4. (i) Which function is used to check whether Python MySQL connectivity is successful or not? 

Ans: Connect ()

 

(ii) Name any two functions used to extract data from cursor. 

fetchone (), fetchmany()

 

5. Consider the table CLUB given below.  

Table: CLUB

COACH_IDCOACH_NAMEAGESPORTSDATEOFAPPPAYSEX
1KRKREJA35KARATE27/03/19961000M
2RAVINA34KARATE20/01/19981200F
3KARAN34SQUASH19/02/19982000M
4TARUN33BASKETBALL01/01/19981500M
5ZUBIN36SWIMMING12/01/1998750M
6KETKI36SWIMMING24/02/1998800F
7ANKITA39SQUASH20/02/19982200F
8KUSH37KARATE22/02/19981100F
9SHAILYA41SWIMMING13/01/1998900M
1039BASKETBALL19/02/19981700M

 

Write the output of the queries (a) to (d) based on the table, CLUB given above:

i) SELECT COUNT (DISTINCT SPORTS) FROM CLUB;

ii) SELECT MIN(AGE) FROM CLUB WHERE SEX = ‘F’;

iii) SELECT AVG(PAY) FROM CLUB WHERE SPORTS = ‘KARATE’;

iv) SELECT SUM(PAY) FROM CLUB WHERE DATEOFAPP > ‘31/01/1998’;

 

Ans:

i) 4

ii) 34

iii) 66

iv) 8800

 

6. (i) Which clause is used to remove duplicate rows of the table?

Ans: Distinct

 

(ii) Give one point of difference between primary key and foreign key.

Ans:

Primary KeyForeign Key
It assure that the value provided in a row should be uniqueIt basically provide a link between two tables.

 

 

7. Consider the table, STUDENT given below:

Table: STUDENT

No.NameStipendStreamAvgMarkGradeClass
1Karan400Medical80.5B12
2Divakar700Computer91.5A12
3Divya300Art73.5C11
4Arun290Science68.7D10
5Sabina600Science72.5C10
6John250Medical88.8B12

a) Write the degree and cardinality of the table STUDENT.

Ans:

Degree- 6

Cardinality-7

 

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

Primary key- No.

 

 

OR

Table: INVENTORY

Item_NoItem_NameScodeQty
1Notebook1350
2Ball Pen1150
3Get Pen1723
4Eraser2027

a) Identify the candidate key(s) from the table INVENTORY.

Ans: Candidate Key- Item no., S.Code

b) Which command can be used to remove the table INVENTORY from the database HyStore.

Ans: DROP

 

SECTION – B

Each question carries 3 marks

8. Nandu has created a dictionary containing countries and continent as key value pairs of 6 countries. Write a program, with separate user defined functions to perform the following operations:

● Push the keys (name of the country) of the dictionary into a stack, where country belongs to continent “ASIA”.

● Pop and display the content of the stack.

For example:

If the sample content of the dictionary is as follows:

R={“UK”:”EUROPE, “INDIA”:”ASIA”, “CHINA”:”ASIA”,

“EGYPT”:”AFRICA”, “CUBA”:”AMERICA”, “JAPAN”:”ASIA”}

The output from the program should be:

JAPAN CHINA INDIA

 

Ans: 

def push (S,N):
    S.append (N)
def pop (S):
    if S!=[]:
        return S.pop()
    else:
        return none
T=[]

for k in R:
    if R[K]== "ASIA":
        Push (T,k)
    while True:
        if T!=[]:
            print (pop(T),end= '')
        else:
            break

 

 

OR

Vaishnav has a list containing names of 10 cities. You need to help him 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 those names which are having more than 5 characters in it.

● Pop and display the content of the stack.

For Example:

If the sample Content of the list is as follows:

N=[“Paris”, “England”, “Mumbai”, “Delhi”, “London”]

Sample Output of the code should be:

London Mumbai England

 

Ans: 

def push (S,N):
    S.append (N)
def pop (S):
    if  S!=[]:
        return S.pop()
    else:
        return none
T=[]
for k in N:
    if len(k)>=5:
        Push(T,k)
    while True:
        if T!=[]:
            print (pop(T),end=’’)
        else:
            break

 

 

9. (i) A table, medicalstore has been created in a database with the following fields: MedicineNo, MedicineName, MedCode,Quantity

Give the SQL command to add a new field, PRICE (of type Integer) to the medicalstore table.

Ans: Alter Table Medical store ADD (Price  INT);

 

(ii) Define the following terms

a) Self Join

b) Natural Join

 

Ans: 

Self Join → A self join is a join in which table is joined with itself.

Natural Join – Natural join joins two tables based on some attribute name and data types.

 

 

10. An educational institution EducationPoint is considering to maintain their inventory using SQL to store the data. As a database administer, Ajay has decided that :

● Name of the database – EDUPOINT

● Name of the table – STUDENT

The attributes of student are as follows:

● STUDENTID – numeric, primary key

● STUDNAME – character of size 30

● SCODE – character of size 10

● MARKS – numeric

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

 

Ans: 

Create database EDUPoint ;

Use EDUPoint;

Create Table STUDENT (“Student ID int Primary Key, Studentname varchar (30), scode varchar (10), Marks int (10));

 

Section C

Each question carries 4 marks

11. Write SQL commands for the following queries (i) to (iv) based on the relations Product and Client given below:

Table: Product

P_IDProductNameManufacturerPriceDiscount
TP01Talcum PowderLAK40
FW05Face WashABC455
BS01Bath SoapABC55
SH06ShampooXYZ12010
FW12Face WashXYZ95

 

Table: Client

C_IDClientNameCityP_ID
01Cosmetic ShopDelhiTP01
02Total HealthMumbaiFW05
03Live LifeDelhiBS01
04Pretty WomanDelhiSH06
05DreamsDelhiTP01

 

 

i) Write SQL query to display ProductName and Price for all products whose Price is in the range of 50 to 150.

ii) Write SQL query to display details of product whose manufacturer is either XYZ or ABC

iii)Write SQL query to display ProductName, Manufacturer and Price for all products that are not given any discount.

iv) Write SQL query to display ClientName, City, and P_ID for all clients whose city is Delhi.

 

Ans: 

i) Select ProductName , Price from Product where price between 50 and 150;

ii) Select * from Product where Manufacture in (“XYZ”,”ABC”);

iii) Select Product Name, Manufacture, Price from Product where Discount is null;

iv) select clientname, City, P-ID , Product name form Product where city=”Delhi” ;

 

12. (i) Give two advantages and two disadvantages of bus topology. 

Ans:

Two advantages of Bus Topology:

Easy to expand by joining two cables

Cost effective as compared to other topologies.

 

Disadvantages:

Not useful for large networks

Very slow as compared to other topologies

 

OR

Define the following terms: Protocols, Cookies

Ans:

Protocols: A set of fixed rules that determines how data is transmitted between different devices

 

Cookies: A piece of data from website that is used to tell the server that users have returned to a particular website.

 

 

(ii) Your friend wishes to install a wireless network in his office. Explain him the differences between guided and unguided media.

Ans: 

 

Guided MediaUnguided Media
The signal require a physical path for transmissionThe signal is broadcasted through air
It is wired communicationIt is wireless communication
Type- twisted pair, coaxial cable, fiber CableType- Radio wave, Microwave

 

 

 

13. Tech Up Corporation (TUC) 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 to them the best available solutions.

CS 083

Block to block distance 

Human Resource to Conference : 60 m

Human Resource to Finance : 120 m

Conference to Finance :  80 m

No. of Computers in Each Block

Human Resource : 125

Conference: 60

Finance: 25

a) What will the most appropriate block, where TUC should plan to install their server?

b) Draw a block-to-block cable layout to connect all the buildings in the most appropriate manner for efficient communication.

c)What will be the best possible connectivity out of the following, you will suggest to connect the new set-up of offices in Bangalore with its London based office?

● Infrared

● Satellite Link

● Ethernet Cable

d)Which device will you suggest to connect each computer in each of the buildings?

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