Computer Science
Solved Sample Paper 2021-22
Term 2

SECTION - A

Question 1. Give any two characteristics of stacks.

Question 2. Expand the following:

  1. SMTP , XML
  2. Out of the following, which is the fastest wired and wireless medium of transmission? Infrared, coaxial cable, optical fibre, microwave, Ethernet cable

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

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

  1. How many records will be returned by fetchone() method?
  2. What will be the datatype of Mydata object after the given command is executed?

Question 5. Write the output of the queries (a) to (d) based on the table, Furniture given below:
Table: FURNITURE

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

Facing difficulties in solving? Read the Revision Notes and Question Bank book by PyForSchool

  1. SELECT SUM(DISCOUNT) FROM FURNITURE WHERE COST>15000;

  2. SELECT MAX(DATEOFPURCHASE) FROM FURNITURE;

  3. SELECT * FROM FURNITURE WHERE DISCOUNT>5 AND FID LIKE "T%";

  4. SELECT DATEOFPURCHASE FROM FURNITURE WHERE NAME IN ("Dining Table", "Console Table");

Question 6.

  1. Which command is used to view the list of tables in a database?
  2. Give one point of difference between an equi-join and a natural join.

Question 7. Consider the table, MOVIEDETAILS given below:
Table: MOVIEDETAILS

MOVIEID TITLE LANGUAGE RATING PLATFORM
M001 Minari Korean 5 Netflix
M004 MGR Magan Tamil 4 Hotstar
M010 Kaagaz Hindi 3 Zee5
M011 Harry Potter and the Chamber of Secrets English 4 Prime Video
M015 Uri Hindi 5 Zee5
M020 Avengers: Endgame English 4 Hotstar
  1. Identify the degree and cardinality of the table.
  2. Which field should be made the primary key? Justify your answer.

OR

  1. Identify the candidate key(s) from the table MOVIEDETAILS.
  2. 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?

Facing difficulties in solving? Read the Revision Notes and Question Bank book by PyForSchool

SECTION - B

Question 8. Julie has created a dictionary containing names and marks as key 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:
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

Question 9.

  1. A table, ITEM has been created in a database with the following fields:
    ITEMCODE, ITEMNAME, QTY, PRICE
    Give the SQL command to add a new field, DISCOUNT (of type Integer) to the ITEM table.
  2. Categorize following commands into DDL and DML commands?
    INSERT INTO, DROP TABLE, ALTER TABLE, UPDATE...SET

Question 10. Charu has to create a database named MYEARTH in MYSQL.
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(3)  
AVGTEMP INTEGER  
POLLUTIONRATE INTEGER  
POPULATION INTEGER  

Facing difficulties in solving? Read the Revision Notes and Question Bank book by PyForSchool

SECTION - C

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

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

Table: DEPARTMENT

DEPTID DEPTNAME FLOORNO
D001 Personal 4
D002 Admin 10
D003 Production 1
D004 Sales 3
  1. To display the average salary of all employees, department wise.
  2. To display name and respective department name of each employee whose salary is more than 50000.
  3. To display the names of employees whose salary is not known, in alphabetical order.
  4. To display DEPTID from the table EMPLOYEE without repetition.

Question 12.

  1. Give two advantages and two disadvantages of star topology
    OR
    Define the following terms:
    www, web hosting
  2. How is packet switching different from circuit switching?

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

Distance between the various blocks is as follows:

A to B 40m
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
Block B 50
Block C 125
Block D 10
  1. Suggest and draw the cable layout to efficiently connect various blocks of buildings within the Noida centre for connecting the digital devices.
  2. Suggest the placement of the following device with justification
    1. Repeater
    2. Hub/Switch
  3. Which kind of network (PAN/LAN/WAN) will be formed if the Noida office is connected to its head office in Mumbai?
  4. Which fast and very effective wireless transmission medium should preferably be used to connect the head office at Mumbai with the centre at Noida?