Cs Term 2 2021 22
Cs Term 2 2021 22
General Instructions
Section -A
Each question carries 2 marks
Q. Part Question Marks
No No.
1. Give any two characteristics of stacks. (2)
(ii) Out of the following, which is the fastest wired and wireless medium (1)
of transmission?
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()
[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
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)
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
OR
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
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:
[3]
R={"OM":76, "JAI":45, "BOB":89, "ALI":65, "ANU":90,
"TOM":82}
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]
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)
Table: CITY
FIELD NAME DATA TYPE REMARKS
[4]
AVGTEMP INTEGER
POLLUTIONRATE INTEGER
POPULATION INTEGER
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
12. (i) Give two advantages and two disadvantages of star topology (2)
OR
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
[7]
Marking Scheme
COMPUTER SCIENCE (Code : 083)
Maximum Marks: 35 Time: 2 hours
General Instructions
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
(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
[2]
OR
OR
[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;
OR
13.
(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.
(c) WAN.
(d) Satellite
[6]