0% found this document useful (0 votes)
21 views13 pages

Cs Term 2 2021 22

The document is a sample question paper for Computer Science with a maximum of 35 marks and a duration of 2 hours. It is divided into three sections: Section A with 7 questions worth 2 marks each, Section B with 3 questions worth 3 marks each, and Section C with 3 questions worth 4 marks each. The paper includes various topics such as data structures, SQL queries, and programming tasks, along with internal choices for some questions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views13 pages

Cs Term 2 2021 22

The document is a sample question paper for Computer Science with a maximum of 35 marks and a duration of 2 hours. It is divided into three sections: Section A with 7 questions worth 2 marks each, Section B with 3 questions worth 3 marks each, and Section C with 3 questions worth 4 marks each. The paper includes various topics such as data structures, SQL queries, and programming tasks, along with internal choices for some questions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Sample Question Paper

COMPUTER SCIENCE (Code: 083)


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
Q. Part Question Marks
No No.
1. Give any two characteristics of stacks. (2)

2. (i) Expand the following: (1)


SMTP , XML

(ii) Out of the following, which is the fastest wired and wireless medium (1)
of transmission?

Infrared, coaxial cable, optical fibre,


microwave, Ethernet cable

3. Differentiate between char(n) and varchar(n) data types with respect (2)
to databases.

4. A resultset is extracted from the database using the cursor object (2)
(that has been already created) by giving the following statement.

Mydata=cursor.fetchone()

(a) How many records will be returned by fetchone()


method?
(b) What will be the datatype of Mydata object after the
given command is executed?

[1]
5. Write the output of the queries (a) to (d) based on the table, (2)
Furniture given below:

Table: FURNITURE
FID NAME DATEOFPURCHASE COST DISCOUNT
B001 Double 03-Jan-2018 45000 10
Bed
T010 Dining 10-Mar-2020 51000 5
Table
B004 Single 19-Jul-2021 22000 0
Bed
C003 Long 30-Dec-2016 12000 3
Back
Chair
T006 Console 17-Nov-2019 15000 12
Table
B006 Bunk 01-Jan-2021 28000 14
Bed

(a) SELECT SUM(DISCOUNT)


FROM FURNITURE
WHERE COST>15000;

(b) SELECT MAX(DATEOFPURCHASE)


FROM FURNITURE;

(c) SELECT * FROM FURNITURE


WHERE DISCOUNT>5 AND FID LIKE "T%";

(d) SELECT DATEOFPURCHASE FROM FURNITURE


WHERE NAME IN ("Dining Table", "Console
Table");

6. (i) Which command is used to view the list of tables in a database? (1)

(ii) Give one point of difference between an equi-join and a natural join. (1)

7. Consider the table, MOVIEDETAILS given below: (2)

Table: MOVIEDETAILS
MOVIEID TITLE LANGUAGE RATING PLATFORM
M001 Minari Korean 5 Netflix
M004 MGR Magan Tamil 4 Hotstar
[2]
M010 Kaagaz Hindi 3 Zee5
M011 Harry English 4 Prime
Potter Video
and the
Chamber
of
Secrets
M015 Uri Hindi 5 Zee5
M020 Avengers: English 4 Hotstar
Endgame

(a) Identify the degree and cardinality of the table.


(b) Which field should be made the primary key? Justify your
answer.

OR

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


(b) Consider the table SCHEDULE given below:

Table: SCHEDULE
SLOTID MOVIEID TIMESLOT
S001 M010 10 AM to 12 PM
S002 M020 2 PM to 5 PM
S003 M010 6 PM to 8 PM
S004 M011 9 PM to 11 PM

Which field will be considered as the foreign key if the tables


MOVIEDETAILS and SCHEDULE are related in a database?

SECTION – B
Each question carries 3 marks

8. Julie has created a dictionary containing names and marks as key (3)
value pairs of 6 students. Write a program, with separate user
defined functions to perform the following operations:

● Push the keys (name of the student) of the dictionary into a


stack, where the corresponding value (marks) is greater than
75.
● Pop and display the content of the stack.
For example:
If the sample content of the dictionary is as follows:

[3]
R={"OM":76, "JAI":45, "BOB":89, "ALI":65, "ANU":90,
"TOM":82}

The output from the program should be:


TOM ANU BOB OM

OR

Alam has a list containing 10 integers. 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 the even numbers
into a stack.
● Pop and display the content of the stack.

For Example:
If the sample Content of the list is as follows:
N=[12, 13, 34, 56, 21, 79, 98, 22, 35, 38]

Sample Output of the code should be:


38 22 98 56 34 12

9. (i) A table, ITEM has been created in a database with the following (1)
fields:
ITEMCODE, ITEMNAME, QTY, PRICE

Give the SQL command to add a new field, DISCOUNT (of type
Integer) to the ITEM table.
(ii) Categorize following commands into DDL and DML commands? (2)

INSERT INTO, DROP TABLE, ALTER TABLE,


UPDATE...SET

10. Charu has to create a database named MYEARTH in MYSQL. (3)


She now needs to create a table named CITY in the database to store
the records of various cities across the globe. The table CITY has the
following structure:

Table: CITY
FIELD NAME DATA TYPE REMARKS

CITYCODE CHAR(5) Primary


Key
CITYNAME CHAR(30)
SIZE INTEGER

[4]
AVGTEMP INTEGER
POLLUTIONRATE INTEGER
POPULATION INTEGER

Help her to complete the task by suggesting appropriate SQL


commands.
Section C
Each question carries 4 marks

11. Write queries (a) to (d) based on the tables EMPLOYEE and (4)
DEPARTMENT given below:

Table: EMPLOYEE
EMPID NAME DOB DEPTID DESIG SALARY
120 Alisha 23- D001 Manager 75000
Jan-
1978
123 Nitin 10- D002 AO 59000
Oct-
1977
129 Navjot 12- D003 Supervisor 40000
Jul-
1971
130 Jimmy 30- D004 Sales Rep
Dec-
1980
131 Faiz 06- D001 Dep 65000
Apr- Manager
1984

Table: DEPARTMENT

DEPTID DEPTNAME FLOORNO


D001 Personal 4
D002 Admin 10
D003 Production 1
D004 Sales 3

(a) To display the average salary of all employees, department wise.

(b) To display name and respective department name of each


employee whose salary is more than 50000.
[5]
(c) To display the names of employees whose salary is not known, in
alphabetical order.

(d) To display DEPTID from the table EMPLOYEE without repetition.

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

OR

Define the following terms:


www , web hosting

(ii) How is packet switching different from circuit switching? (2)

13. BeHappy Corporation has set up its new centre at Noida, Uttar (4)
Pradesh for its office and web-based activities. It has 4 blocks of
buildings.

BeHappy Corporation
Block B
Block A

Block D
Block C

Distance between the various blocks is as follows:


A to B 40 m
B to C 120m
C to D 100m
A to D 170m
B to D 150m
A to C 70m

Numbers of computers in each block


Block A - 25
[6]
Block B - 50
Block C - 125
Block D - 10

(a) Suggest and draw the cable layout to efficiently connect


various blocks of buildings within the Noida centre for
connecting the digital devices.

(b) Suggest the placement of the following device with


justification
i. Repeater
ii. Hub/Switch

(c) Which kind of network (PAN/LAN/WAN) will be formed if the


Noida office is connected to its head office in Mumbai?

(d) Which fast and very effective wireless transmission medium


should preferably be used to connect the head office at
Mumbai with the centre at Noida?

[7]
Marking Scheme
COMPUTER SCIENCE (Code : 083)
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
Q. Part Question Marking Marks
No No. Instructions
1. Characteristics of Stacks: 1 mark for
 It is a LIFO data structure each point (2)
 The insertion and deletion happens at one
end i.e. from the top of the stack

2. (i) SMTP : Simple Mail Transfer Protocol ½ mark for


XML: Extensible Mark Up Language each correct (1)
expansion
(ii) Wired- optical fibre ½ mark for
Wireless – microwave each correct (1)
answer
3. char(n): 1 mark for
 stores a fixed length string between 1 and each correct
255 characters difference
 if the value is of smaller length, adds blank ( minimum 2
spaces differences (2)
 some space is wasted to be given)
varchar(n) :
 stores a variable length string
 no blanks are added even if value is of
smaller length
 no wastage of space
[1]
4. (a) One record 1 mark for
(b) tuple each correct (2)
answer
5.
(a) 29

(b) 19-Jul-2021
½ mark for (2)
(c) each correct
output
T006 Console 17-Nov- 15000 12
Table 2019

(d)
10-Mar- 2020
17-Nov-2019

6. (i) SHOW TABLES; 1 mark for


correct (1)
answer
(ii) Equi- join: 1 mark for
 The join in which columns from two tables correct
are compared for equality difference
 Duplicate columns are shown (Any one (1)
Natural Join point may be
 The join in which only one of the identical given)
columns existing in both tables is present
 No duplication of columns

7. (a) Degree: 5 ½ mark each


Cardinality: 6 for correct
degree and
cardinality

(b) MOVIEID should be made the primary key as it ½ mark for


uniquely identifies each record of the table. correct field
and ½ mark (2)
for
justification

[2]
OR

(a) MOVIEID and TITLE ½ mark for


each correct
field name

(b) MOVIEID 1 mark for


correct
answer
SECTION – B
Each question carries 3 marks

8. # Question No 8 (first option)


R={"OM":76, "JAI":45, "BOB":89, 1 mark for
"ALI":65, "ANU":90, "TOM":82} correct PUSH
def PUSH(S,N): operation
S.append(N)
def POP(S):
1 mark for
if S!=[]:
return S.pop() correct POP
else: operation
return None
ST=[] 1 mark for
for k in R: correct
if R[k]>=75: function calls
PUSH(ST,k) and (3)
while True: displaying
if ST!=[]: the output
print(POP(ST),end=" ")
else:
break

OR

# Question No 8 (second option) 1 mark for


correct PUSH
N=[12, 13, 34, 56, 21, 79, 98, 22, operation
35, 38]
def PUSH(S,N):

[3]
S.append(N) 1 mark for
def POP(S): correct POP
if S!=[]: operation
return S.pop()
else: 1 mark for
return None
correct
ST=[]
for k in N: function calls
if k%2==0: and
PUSH(ST,k) displaying
while True: the output
if ST!=[]:
print(POP(ST),end=" ")
else:
break

Note: Marks
to be
awarded for
any other
correct logic
given by the
student
9. (i) ALTER TABLE Item 1 mark for
ADD (Discount INT); correct (1)
command
(ii) DDL: DROP TABLE, ALTER TABLE ½ mark for (2)
DML: INSERT INTO, UPDATE...SET each correct
command
identified
10. CREATE DATABASE MYEARTH; 1 mark for
correctly
CREATE TABLE CITY creating
( database.
CITYCODE CHAR(5)PRIMARY KEY, (3)
CITYNAME CHAR(30),
2 marks for
SIZE INT,
AVGTEMP INT, correctly
POPULATIONRATE INT, creating the
POPULATION INT, table.
);

Section C
Each question carries 4 marks
11. (a) SELECT AVG(SALARY)

[4]
FROM EMPLOYEE
GROUP BY DEPTID;

(b) SELECT NAME, DEPTNAME


1 mark for
FROM EMPLOYEE, DEPARTMENT each correct
WHERE query
EMPLOYEE.DEPTID= (4)
DEPARTMENT.DEPTID
AND SALARY>50000;

(c) SELECT NAME FROM EMPLOYEE


WHERE SALARY IS NULL
ORDER BY NAME;

(d) SELECT DISTINCT DEPTID


FROM EMPLOYEE;
12. (i) Advantages
 Ease of service
 Centralized control
 Easy to diagnose faults
 One device per connection ½ mark for
each correct
Disadvantages advantage / (2)
 long cable length disadvantage
 difficult to expand
 central node dependency

OR

www: a set of protocols that allow you to access any


document on the internet through the naming 1 mark for
systems based on URLs each correct
Web hosting: Web hosting is a service that definition
allows organizations and individuals to post a
website or web page onto the server, which can be
viewed by everyone on the Internet.
(ii) Packet switching: 1 mark for
 uses store and forward concept to send each correct
messages difference
 no physical path is actually establishes
 message is divided into smaller parts, known (minimum
as packets and then sent forward two points (2)
 tight upper limit on block size should be
 Each data unit knows only the final given)
receiver’s address
[5]
Circuit switching
 physical connection is established between
sender and receiver
 Each data unit knows the entire path from
sender to receiver
 It does not follow store and forward
concept

13.

(a)

BeHappy Corporation (4)


Block B
Block A

Block C Block D

1 mark for
each correct
answer
(b)
Repeater : between C and D as the distance
between them is 100 mts.

Hub/ Switch : in each block as they help to share


data packets within the devices of the network in
each block

(c) WAN.

(d) Satellite

[6]

You might also like