1. “Stack is a linear data structure which follows a particular order in which the operations are performed.”
What is the order in which the operations are performed in a Stack?
Ans: In a stack, the order of operations is typically based on the Last-In-First-Out (LIFO) principle, where the last element added is the first one to be removed.
Name the List method/function available in Python which is used to remove the last element from a list implemented stack.
Ans: pop() method
Also write an example using Python statements for removing the last element of the list.
Ans: #define the list
my_list = [1, 2, 3, 4, 5]
#remove the last element from the list
my_list.pop()
#print the modified list
print(my_list)
2. (i) Expand the following:
VoIP, PPP
Ans: VoIP - Voice over Internet Protocol
PPP - Point to Point Protocol
(ii) Riya wants to transfer pictures from her mobile phone to her laptop. She uses Bluetooth technology to connect two devices. Which type of network (PAN/LAN/MAN/WAN) will be formed in this case?
Ans: PAN (Personal Area Network)
3. Differentiate between the terms Attribute and Domain in the context of Relational Data Model.
Ans: Attribute: An attribute refers to a single data item or field within a table (relation). For example, in a "Customers" table, "CustomerName" and "CustomerID" are attributes.
Domain: A domain is a set of allowable values for an attribute. It defines the range of valid values that an attribute can take. For example, a domain for the "Age" attribute may define that valid ages range from 0 to 100 years.
4. Consider the following SQL table MEMBER in a SQL Database CLUB:
Table: MEMBER
| M_ID |
NAME |
ACTIVITY |
| M1001 |
Amina |
GYM |
| M1002 |
Pratik |
GYM |
| M1003 |
Simon |
SWIMMING |
| M1004 |
Rakesh |
GYM |
| M1005 |
Avneet |
SWIMMING |
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 table MEMBER stored in the database CLUB.
Predict the output of the following code:
MYCUR - DB.cursor()
MYCUR.execute ("USE CLUB")
MYCUR.execute ("SELECT * FROM MEMBER WHERE ACTIVITY= 'GYM' ")
R=MYCUR. fetchone ()
for i in range (2) :
R-MYCUR.fetchone ()
print (R[Ol, R[1], sep = "#")
Ans: Output: M1001#Amina
5. Write the output of SQL queries (a) to (d) based on the table VACCINATION_DATA given below:
Table: VACCINATION_DATA
| VID |
Name |
Age |
Dose1 |
Dose2 |
City |
| 101 |
Jenny |
27 |
2021-12-25 |
2022-01-31 |
Delhi |
| 102 |
Harjot |
55 |
2021-07-14 |
2021-10-14 |
Mumbai |
| 103 |
Srikanth |
43 |
2021-04-18 |
2021-07-20 |
Delhi |
| 104 |
Gazala |
75 |
2021-07-31 |
NULL |
Kolkata |
| 105 |
Shiksha |
32 |
2022-01-01 |
NULL |
Mumbai |
(a) SELECT Name, Age FROM VACCINATION DATA WHERE Dose2 IS NOT NULL AND Age > 40;
Ans:
(b) SELECT City, COUNT (*) FROM VACCINATION DATA GROUP BY City;
Ans:
| City | COUNT(*) |
|---|
| Delhi | 2 |
| Mumbai | 2 |
| Kolkata | 1 |
(c) SELECT DISTINCT City FROM VACCINATION DATA;
Ans:
(d) SELECT MAX (Dosel), MIN (Dose2) FROM VACCINATION DATA;
Ans:
| MAX (Dose1) | MIN (Dose2) |
|---|
| 2022-01-01 | 2021-07-20 |
6. Write the output of SQL queries (a) and (b) based on the following two tables DOCTOR and PATIENT belonging to the same database:
Table: DOCTOR
| DNO |
DNAME |
FEES |
| D1 |
AMITABH |
1500 |
| D2 |
ANIKET |
1000 |
| D3 |
NIKHIL |
1500 |
| D4 |
ANJANA |
1500 |
Table: PATIENT
| PNO |
PNAME |
ADMDATE |
DNO |
| P1 |
NOOR |
2021-12-25 |
D1 |
| P2 |
ANNIE |
2021-11-20 |
D2 |
| P3 |
PRAKASH |
2020-12-10 |
NULL |
| P4 |
HARMEET |
2019-12-20 |
D1 |
(a) SELECT DNAME, PNAME FROM DOCTOR NATURAL JOIN PATIENT;
Ans:
| DNAME | PNAME |
|---|
| AMITABH | NOOR |
| ANIKET | ANNIE |
| AMITABH | HARMEET |
(b) SELECT PNAME, ADMDATE, FEES FROM PATIENT P, DOCTOR D WHERE D.DNO = P.DNO AND FEES > 1000;
Ans:
| PNAME | ADMDATE | FEES |
|---|
| NOOR | 2021-12-25 | 1500 |
| HARMEET | 2019-12-20 | 1500 |
7. Differentiate between Candidate Key and Primary Key in the context of Relational Database Model.
Ans: A Candidate Key is a set of one or more columns (attributes) that can uniquely identify each row (tuple) in a table. It means that there are no duplicate values for this combination of columns.
The Primary Key is a specific Candidate Key chosen by the database designer to be the main method for uniquely identifying rows in a table. It's a subset of Candidate Keys and is the key used for establishing relationships with other tables.
OR
Consider the following table PLAYER:
Table: PLAYER
| PNO | NAME | SCORE |
|---|
| P1 | RISHABH | 52 |
| P2 | HUSSAIN | 45 |
| P3 | ARNOLD | 23 |
| P4 | ARNAV | 18 |
| P5 | GURSHARAN | 42 |
(a) Identify and write the name of the most appropriate column from the given table PLAYER that can be used as a Primary key.
Ans: PNO
(b) Define the term Degree in relational data model. What is the Degree of the given table PLAYER?
Ans: In the context of a relational database management system (RDBMS), the degree of a table refers to the number of attributes (columns) in the table. It represents the total count of columns or fields within a table.
The degree of the "PLAYER" table is 3 because it has three attributes (columns).
SECTION B (Each Question carries 3 Marks)
8. Write the definition of a user defined function PushNV (N) which accepts a list of strings in the parameter N and pushes all strings which have no vowels present in it, into a list named NoVowel.
Write a program in Python to input 5 words and push them one by one into a list named All.
The program should then use the function PushNV() to create a stack of words in the list NoVowel so that it stores only those words which do not have any vowel present in it, from the list All. Thereafter, pop each word from the list NoVowel and display the popped word. When the stack is empty display the message “EmptyStack“.
For example:
If the Words accepted and pushed into the list All are
['DRY', 'LIKE', 'RHYTHM', 'WORK', 'GYM']
Then the stack NoVowel should store
['DRY', 'RHYTHM', 'GYM']
And the output should be displayed as
GYM RHYTHM DRY EmptyStack
Ans:
def PushNV(N):
for W in N:
for C in W:
if C.upper() in 'AEIOU':
break
else:
NoVowel.append(W)
All = []
NoVowel = []
for i in range(5):
All.append(input('Enter a Word: '))
PushNV(All)
while NoVowel:
print(NoVowel.pop(), end=' ')
else:
print('EmptyStack')
OR
Write the definition of a user defined function Push3_5 (N) which accepts a list of integers in a parameter N and pushes all those integers which are divisible by 3 or divisible by 5 from the list N into a list named Only3_5.
Write a program in Python to input 5 integers into a list named NUM.
The program should then use the function Push 3_5() to create the stack of the list Only3_5. Thereafter pop each integer from the list Only3_5 and display the popped value. When the list is empty, display the message “StackEmpty“.
For example:
If the integers input into the list NUM are :
[10, 6, 14, 18, 30]
Then the stack Only3_5 should store
[10, 6, 18, 30]
And the output should be displayed as
30 18 6 10 StackEmpty
Ans: def Push3_5(N):
for i in N:
if i % 3 == 0 or i % 5 == 0:
Only3_5.append(i)
NUM = []
Only3_5 = []
for i in range(5):
NUM.append(int(input('Enter an Integer: ')))
Push3_5(NUM)
while Only3_5:
print(Only3_5.pop(), end=' ')
else:
print('StackEmpty')
9. (i) A SQL table ITEMS contains the following columns: INO, INAME, QUANTITY, PRICE, DISCOUNT
Write the SQL command to remove the column DISCOUNT from the table.
Ans: ALTER TABLE ITEMS DROP COLUMN DISCOUNT; OR ALTER TABLE ITEMS DROP DISCOUNT;
(ii) Categorize the following SQL commands into DDL and DML: CREATE, UPDATE, INSERT, DROP
Ans: DDL Commands: CREATE, DROP
DML Commands: INSERT, UPDATE
10. Rohan is learning to work upon Relational Database Management System (RDBMS) application. Help him to perform following tasks :
(a) To open the database named “LIBRARY“.
Ans: USE LIBRARY;
(b) To display the names of all the tables stored in the opened database.
Ans: SHOW TABLES;
(c) To display the structure of the table “BOOKS” existing in the already opened database “LIBRARY“.
Ans: DESCRIBE BOOKS;
Alternatively, for some database systems, the following command can be used: DESC BOOKS;
SECTION C (Each Question carries 4 Marks)
11. Write SQL queries for (a) to (d) based on the tables PASSENGER and FLIGHT given below:
Table: PASSENGER
| PNO |
NAME |
GENDER |
FNO |
| 1001 |
Suresh |
MALE |
F101 |
| 1002 |
Anita |
FEMALE |
F104 |
| 1003 |
Harjas |
MALE |
F102 |
| 1004 |
Nita |
FEMALE |
F103 |
Table: FLIGHT
| FNO |
START |
END |
F_DATE |
FARE |
| F101 |
MUMBAI |
CHENNAI |
2021-12-25 |
4500 |
| F102 |
MUMBAI |
BENGALURU |
2021-11-20 |
4000 |
| F103 |
DELHI |
CHENNAI |
2021-12-10 |
5500 |
| F104 |
KOLKATA |
MUMBAI |
2021-12-20 |
4500 |
| F105 |
DELHI |
BENGALURU |
2021-01-15 |
5000 |
(a) Write a query to change the fare to 6000 of the flight whose FNO is F104.
Ans: UPDATE FLIGHT SET FARE=6000 WHERE FNO="F104";
(b) Write a query to display the total number of MALE and FEMALE PASSENGERS.
Ans: SELECT GENDER, COUNT(*) FROM PASSENGER GROUP BY GENDER;
OR
SELECT COUNT(*) FROM PASSENGER GROUP BY GENDER;
(c) Write a query to display the NAME, corresponding FARE and F_DATE of all PASSENGERS who have a flight to START from DELHI.
Ans: SELECT NAME, FARE, F_DATE FROM PASSENGER P, FLIGHT F WHERE F.FNO= P.FNO AND START = 'DELHI';
OR
SELECT NAME, FARE, F_DATE FROM PASSENGER, FLIGHT WHERE PASSENGER.FNO= FLIGHT.FNO AND START = 'DELHI';
OR
SELECT NAME, FARE, F_DATE FROM PASSENGER, FLIGHT WHERE PASSENGER.FNO= FLIGHT.FNO AND START LIKE 'DELHI';
OR
SELECT NAME,FARE,F_DATE FROM PASSENGER NATURAL JOIN FLIGHT WHERE START = 'DELHI';
(d) Write a query to delete the records of flights which end at Mumbai.
Ans: DELETE FROM FLIGHT WHERE END = "MUMBAI";
OR
DELETE FROM FLIGHT WHERE END LIKE "MUMBAI";
12. (i) Differentiate between Bus Topology and Tree Topology. Also, write one advantage of each of them.
Ans:
Bus Topology: In bus topology, each communicating device connects to a single transmission medium, known as bus.
|
Tree Topology: It is a hierarchical topology, in which there are multiple branches and each branch can have one or more basic topologies like star, ring and bus.
|
Advantage:
It is very cost-effective as compared to other network topologies.
|
Advantage:
It is easier to set-up multi-level plans for the network.
|
OR
Differentiate between HTML and XML.
Ans:
| HTML |
XML |
|
It stands for HyperText Markup Language.
|
It stands for eXtensible Markup Language.
|
|
It contains predefined tags which are used to design webpages.
|
It contains user defined tags to describe and store the data.
|
(ii) What is a web browser ? Write the names of any two commonly used web browsers.
Ans: A web browser is a software application used for accessing and navigating the World Wide Web. It allows users to view web pages, download content, and interact with websites. Web browsers interpret HTML (Hypertext Markup Language) and other web programming languages to display text, images, videos, and other elements on websites.
Commonly used web browsers are: Google Chrome, Mozilla Firefox
13. Galaxy Provider Ltd. is planning to connect its office in Texas, USA with its branch at Mumbai. The Mumbai branch has 3 Offices in three blocks located at some distance from each other for different operations - ADMIN, SALES and ACCOUNTS.
As a network consultant, you have to suggest the best network related solutions for the issues/problems raised in (a) to (d), keeping in mind the distances between various locations and other given parameters.
Layout of the Offices in the Mumbai branch:
Shortest distances between various locations:
| ADMIN Block to SALES Block |
300 m |
| SALES Block to ACCOUNTS Block |
175 m |
| ADMIN Block to ACCOUNTS Block |
350 m |
| MUMBAI Branch to TEXAS Head Office |
14000 km |
Number of Computers installed at various locations are as follows:
| ADMIN Block |
255 |
| ACCOUNTS Block |
75 |
| SALES Block |
30 |
| TEXAS Head Office |
90 |
(a) It is observed that there is a huge data loss during the process of data transfer from one block to another. Suggest the most appropriate networking device out of the following, which needs to be placed along the path of the wire connecting one block office with another to refresh the signal and forward it ahead.
(i) MODEM
(ii) ETHERNET CARD
(iii) REPEATER
(iv) HUB
(b) Which hardware networking device out of the following, will you suggest to connect all the computers within each block?
(i) SWITCH
(ii) MODEM
(iii) REPEATER
(iv) ROUTER
(c) Which service/protocol out of the following will be most helpful to conduct live interactions of employees from Mumbai Branch and their counterparts in Texas?
(i) FTP
(ii) PPP
(iii) SMTP
(iv) VoIP
(d) Draw the cable layout (block to block) to efficiently connect the three offices of the Mumbai branch.
Ans:

Download Now - Class 12 CS 083 Previous Year Question Paper (PYQP) 2021-22 Term 2 with Solution
Year wise Pre-Board and CBSE Previous Year Question Papers with Solution – Class 12 Computer Science (Code 083)
CBSE Class 12 CS 083 PYQP 2026-27 with Solution
CBSE Class 12 CS 083 PYQP 2025-26 with Solution - Updated Soon
CBSE Class 12 CS 083 PYQP 2021-22 (Term 2) with Solution
CBSE Class 12 CS 083 PYQP 2021-22 (Term 1) with Solution
CBSE Class 12 CS 083 PYQP 2019-20 (Compartment) with Solution
CBSE Class 12 CS 083 PYQP 2019-20 with Solution
CBSE Class 12 CS 083 PYQP 2018-19 with Solution