Computer Science PQ T2
Computer Science PQ T2
Session: 2021-22
Computer Science (Code 083)
(Theory : Term-II
Time allowed : 2 hours Maximum Marks : 35
General Instructions :
(i) This question paper is divided into 3 sections
(ii) Section A, consists 7 questions (1 7). Each question carries 2 marks.
(iii) Section B, consists 3 questions (8 10). Each question carries 3 marks.
(iv) Section C, consists 3 questions (11 13). Each question carries 4 marks.
(v) Internal choices have been given for questions number 7, 8 and 12.
SECTION A
(Each question carries 2 marks)
1. Differentiate between Push and Pop operations in the context of stacks. 2
2. (a) Expand FTP. 1
(b) Out of the following, which has the largest network coverage area ? 1
3. LAN, MAN, PAN, WAN
Differentiate between Degree and Cardinality in the context of Relational
Data Model. 2
4. Consider the following table EMPLOYEE in a Database COMPANY :
Table : EMPLOYEE
E_ID NAME DEPT
H1001 Avneet AC
A1002 Rakesh HR
A1003 Amina AC
H1002 Simon HR
A1004 Pratik AC
Assume that the required library for establishing the connection between
Python and MySQL is already imported in the given Python code.
Also assume that DB is the name of the database connection for the given
table EMPLOYEE stored in the database COMPANY.
Predict the output of the following Python code :
CUR=DB.cursor()
CUR.execute("USE COMPANY")
CUR.execute("SELECT * FROM EMPLOYEE WHERE DEPT = 'AC' ")
for i in range(2) :
R=CUR.fetchone()
print(R[0], R[1], sep ="#") 2
5. Write the output of the SQL queries (a) to (d) based on the table TRAVEL
given below : 2
Table : TRAVEL
T_ID START END T_DATE 2021- FARE
101 DELHI CHENNAI 12-25 2021- 4500
102 DELHI BENGALURU 11-20 2020- 4000
103 MUMBAI CHENNAI 12-10 2019- 5500
104 DELHI MUMBAI 12-20 2022- 4500
105 MUMBAI BENGALURU 01-15 5000
6. Write the output of the SQL queries (a) and (b) based on the following two
tables FLIGHT and PASSENGER belonging to the same database : 2
Table : FLIGHT
FNO DEPART ARRIVE FARE
F101 DELHI CHENNAI 4500
F102 DELHI BENGALURU 4000
F103 MUMBAI CHENNAI 5500
F104 DELHI MUMBAI 4500
F105 MUMBAI BENGALURU 5000
Table : PASSENGER
PNO NAME FLIGHTDATE FNO
P1 PRAKASH 2021-12-25 F101
P2 NOOR 2021-11-20 F103
P3 HARMEET 2020-12-10 NULL
P4 ANNIE 2019-12-20 F105
OR
(i) Identify and write the name of the Candidate Keys in the
given table BATSMEN.
How many tuples are there in the given table BATSMEN ?
(ii) 2
SECTION B
(Each question carries 3 marks)
10. Rashmi has forgotten the names of the databases, tables and the structure
of the tables that she had created in Relational Database Management
System (RDBMS) on her computer.
(a) Write the SQL statement to display the names of all the databases
present in RDBMS application on her computer.
(b) Write the statement which she should execute to open the database
named "STOCK".
(c) Write the statement which she should execute to display the
structure of the table "ITEMS" existing in the above opened
database "STOCK". 3
SECTION C
(Each question carries 4 marks)
11. Write SQL queries for (a) to (d) based on the tables CUSTOMER and
TRANSACT given below : 4
Table : CUSTOMER
CNO NAME GENDER ADDRESS PHONE
1001 Suresh MALE A-123, West Street 9310010010
1002 Anita FEMALE C-24, Court Lane 9121211212
1003 Harjas MALE T-1, Woods Avenue 9820021001
Table : TRANSACT
TNO CNO AMOUNT TTYPE TDATE
T1 1002 2000 DEBIT 2021-09-25
T2 1003 1500 CREDIT 2022-01-28
T3 1002 3500 CREDIT 2021-12-31
T4 1001 1000 DEBIT 2022-01-10
(a) Write the SQL statements to delete the records from table
TRANSACT whose amount is less than 1000.
(b) Write a query to display the total AMOUNT of all DEBITs and all
CREDITs.
Write a query to display the NAME and corresponding AMOUNT of all
(c)
CUSTOMERs who made a transaction type (TTYPE) of CREDIT.
Write the SQL statement to change the Phone number of customer
OR
(b) Write the names of two wired and two wireless data transmission
mediums. 2
13. The government has planned to develop digital awareness in the rural
areas of the nation. According to the plan, an initiative is taken to set up
Digital Training Centers in villages across the country with its Head
Office in the nearest cities. The committee has hired a networking
consultancy to create a model of the network in which each City Head
Office is connected to the Training Centers situated in 3 nearby villages.
As a network expert in the consultancy, you have to suggest the best
network-related solutions for the issues/problems raised in (a) to (d),
keeping in mind the distance between various locations and other given
parameters.
4
Layout of the City Head Office and Village Training Centers :
Village 3
Training
Village 2 Center
Training
Center
(i) MODEM
(ii) ETHERNET CARD
(iii) REPEATER
(iv) HUB
(c) Which hardware networking device, out of the following, will you
suggest to connect all the computers within the premises of every
Village Training Center ?
(i) SWITCH
(ii) MODEM
(i) FTP
(ii) PPP
(iii) SMTP
(iv) VoIP