Class 12 CBSE Final Term Question Bank
Section A
- “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?
Answer: The order is LIFO (Last In, First Out).Name the list method available in Python used to remove the last element from a list-implemented stack.
Answer: The pop() method.Write an example using Python for removing the last element of a list:
stack = [1, 2, 3, 4] stack.pop() # Removes the last element (4)
- (i) Expand the following:
VoIP
PPP
Answer: VoIP: Voice over Internet Protocol, PPP: Point-to-Point Protocol(ii) Riya uses Bluetooth to transfer pictures from her phone to her laptop. Which network type (PAN/LAN/MAN/WAN) will be formed?
Answer: PAN (Personal Area Network). - Differentiate between Attribute and Domain in a Relational Data Model.
Answer: Attribute: Column in a table representing a specific property. Domain: Set of allowable values for an attribute. - Consider the following SQL table MEMBER:
M_ID NAME ACTIVITY M1001 Amina GYM M1002 Pratik GYM M1003 Simon SWIMMING M1004 Rakesh GYM M1005 Avneet SWIMMING 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[0], R[1], sep="#")
Answer: M1002#Pratik, M1004#Rakesh - Write the output of SQL queries (a) to (d) based on the 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;
Answer: Harjot 55, Srikanth 43 - (b) SELECT City, COUNT(*) FROM VACCINATION_DATA GROUP BY City;
Answer: Delhi 2, Mumbai 2, Kolkata 1 - (c) SELECT DISTINCT City FROM VACCINATION_DATA;
Answer: Delhi, Mumbai, Kolkata - (d) SELECT MAX(Dose1), MIN(Dose2) FROM VACCINATION_DATA;
Answer: MAX(Dose1): 2022-01-01, MIN(Dose2): 2022-01-31
- (a) SELECT Name, Age FROM VACCINATION_DATA WHERE Dose2 IS NOT NULL AND Age > 40;
Section B
- Write the definition of a user-defined function PushNV(N) that accepts a list of strings in the parameter N and pushes all strings with no vowels into a list named NoVowel.
def PushNV(N): NoVowel = [] for word in N: if not any(vowel in word for vowel in 'AEIOUaeiou'): NoVowel.append(word) return NoVowel
Section C
- (i) A SQL table ITEMS contains columns INO, INAME, QUANTITY, PRICE, DISCOUNT.
Write the SQL command to remove the column DISCOUNT from the table.
Answer:ALTER TABLE ITEMS DROP COLUMN DISCOUNT;
- (ii) Categorize the following SQL commands into DDL and DML:
CREATE, UPDATE, INSERT, DROP.
Answer: DDL: CREATE, DROP; DML: INSERT, UPDATE
Section D
- (i) Differentiate between Bus Topology and Tree Topology. Write one advantage of each.
Answer: Bus Topology: Easy to install. Tree Topology: Scalable and supports multiple device hierarchies. - (ii) What is a web browser? Write the names of any two commonly used web browsers.
Answer: A web browser is an application used to access the internet. Examples: Google Chrome, Mozilla Firefox