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 schema It is used to add, retrieve or update data
It defines the coloumn of the table it add or update the row of the table
Ex: Create, Drop, Alter Ex: 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_ID COACH_NAME AGE SPORTS DATEOFAPP PAY SEX
1 KRKREJA 35 KARATE 27/03/1996 1000 M
2 RAVINA 34 KARATE 20/01/1998 1200 F
3 KARAN 34 SQUASH 19/02/1998 2000 M
4 TARUN 33 BASKETBALL 01/01/1998 1500 M
5 ZUBIN 36 SWIMMING 12/01/1998 750 M
6 KETKI 36 SWIMMING 24/02/1998 800 F
7 ANKITA 39 SQUASH 20/02/1998 2200 F
8 KUSH 37 KARATE 22/02/1998 1100 F
9 SHAILYA 41 SWIMMING 13/01/1998 900 M
10 39 BASKETBALL 19/02/1998 1700 M

 

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 Key Foreign Key
It assure that the value provided in a row should be unique It basically provide a link between two tables.

 

 

7. Consider the table, STUDENT given below:

Table: STUDENT

No. Name Stipend Stream AvgMark Grade Class
1 Karan 400 Medical 80.5 B 12
2 Divakar 700 Computer 91.5 A 12
3 Divya 300 Art 73.5 C 11
4 Arun 290 Science 68.7 D 10
5 Sabina 600 Science 72.5 C 10
6 John 250 Medical 88.8 B 12

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_No Item_Name Scode Qty
1 Notebook 13 50
2 Ball Pen 11 50
3 Get Pen 17 23
4 Eraser 20 27

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_ID ProductName Manufacturer Price Discount
TP01 Talcum Powder LAK 40
FW05 Face Wash ABC 45 5
BS01 Bath Soap ABC 55
SH06 Shampoo XYZ 120 10
FW12 Face Wash XYZ 95

 

Table: Client

C_ID ClientName City P_ID
01 Cosmetic Shop Delhi TP01
02 Total Health Mumbai FW05
03 Live Life Delhi BS01
04 Pretty Woman Delhi SH06
05 Dreams Delhi TP01

 

 

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 Media Unguided Media
The signal require a physical path for transmission The signal is broadcasted through air
It is wired communication It is wireless communication
Type- twisted pair, coaxial cable, fiber Cable Type- 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-2024, CBSE Python,
All Rights Reserved