CUET UG Computer Science 20 Sets Book 2025
CUET UG Computer Science 20 Sets Book 2025
com
CUET(UG) 2025
COMPUTER
SCIENCE
Information contained in this book has been obtained by author, from sources believes to be reliable.
However, neither Nodia and Company nor its author guarantee the accuracy or completeness of
any information herein, and Nodia and Company nor its author shall be responsible for any
error, omissions, or damages arising out of use of this information. This book is published with
the understanding that Nodia and Company and its author are supplying information but are not
attempting to render engineering or other professional services.
MRP Rs 250.00
This book is available on amazon and flipkart only and not available in market.
Published by :
Nodia and Company
125, Sector 6, Vidyadhar Nagar, Jaipur 302039
Phone :+91 9024037387
PRACTICE PAPER 02 17
PRACTICE PAPER 03 27
PRACTICE PAPER 04 36
PRACTICE PAPER 05 45
PRACTICE PAPER 06 55
PRACTICE PAPER 07 65
PRACTICE PAPER 08 75
PRACTICE PAPER 09 85
PRACTICE PAPER 10 94
Expand Your Reach: Your readers can share these PDFs on other platforms, helping your
influence grow exponentially.
Still not convinced? Ask us how, and we’ll walk you through exactly how it works.
Best of all: It’s completely free—no hidden charges.
Section A
1 : Database Concepts
• Introduction to database concepts, difference between database and file system, rela-
tional data model : concept of domain, tuple, relation, keys - candidate key, primary key,
alternate key, foreign key.
• Relational algebra : selection, projection, union, set difference and cartesian product.
2 : Structured Query Language - I
• Advantages of using Structured Query Language, Data Definition Language, Data
Query Language and Data Manipulation Language, Introduction to MySQL, Creating a
database using MySQL, DataTypes
• Data Definition : CREATE TABLE, DROP TABLE, ALTER TABLE,Data Query : SE-
LECT, FROM, WHERE
• Data Manipulation : INSERT, UPDATE, DELETEMath functions : POWER (), ROUND
(), MOD ().Text functions : UCASE ()/UPPER (), LCASE ()/LOWER (), MID ()/SUB-
STRING ()/SUBSTR (),LENGTH (), LEFT (), RIGHT (), INSTR (), LTRIM (), RTRIM
(), TRIM ().
3 : Structured Query Language - II
• Date Functions : NOW (), DATE (), MONTH (), MONTHNAME (), YEAR (), DAY (),
DAYNAME ().
• Aggregate Functions : MAX (), MIN (), AVG (), SUM (), COUNT (); using COUNT(*).
Querying and manipulating data using Group by, Having, Order by.
• Operations on Relations - Union, Intersection, Minus, Cartesian Product, JOIN
4 : Computer Networks
• Introduction to computer networks, Evolution of networking,
• Network types : LAN, WAN, MAN
• Network devices : Modem, Ethernet Card, Repeater, Hub, Switch, Router,Gateway.Net-
work Topologies : Mesh, Ring, Bus, Star, and Tree topologies.
• Basic concept of MACand IP Address Difference between Internet and web.
Section B1 : Computer Science
**********
PRACTICE PAPER 01
1. Which choice best defines a primary key in a relational exist, but only one can be officially designated as the
database? primary key to maintain integrity and consistency.
(A) A duplicated attribute that identifies multiple rows
4. Why is a foreign key important in relational tables?
(B) A unique attribute that identifies a single row
(C) A numeric attribute used for calculations only (A) It makes all columns mandatory
(D) A textual attribute with no indexing capability (B) It ensures software updates are automatic
(C) It helps link tables by referencing a primary key in
Ans another table
(B) A unique attribute that identifies a single row (D) It converts text data to numeric form
A primary key is a unique identifier for rows in a relation, Ans
ensuring that no two rows share the same key value. It
helps maintain data integrity by preventing duplicate (C) It helps link tables by referencing a primary key in
records. Each table can have exactly one primary key, another table
central to structuring and retrieving data efficiently. This A foreign key establishes a relationship between two
constraint supports references in database applications. tables by referencing a primary key in another table.
This linkage enforces referential integrity, ensuring that
2. Which term describes a domain in a relational database data remains consistent and valid across related tables. It
context? prevents orphan records and supports efficient retrieval
(A) A structured query output of interconnected information in a relational database
(B) A set of permissible values for an attribute without unnecessary duplication.
(C) A compilation of all foreign key constraints
5. Which SQL command is used to remove rows from a
(D) A storage unit with unlimited capacity
table?
Ans (A) UPDATE
(B) A set of permissible values for an attribute (B) DELETE
A domain specifies the valid values an attribute (C) CREATE
can assume in a relational database. It ensures data (D) ALTER
consistency and reliability by restricting inputs to a Ans
specific range or type, such as integers or dates. This
constraint safeguards data integrity and prevents entries (B) DELETE
that fall outside acceptable boundaries for each attribute. The DELETE command in SQL is used to remove one
or more rows from an existing table based on specified
3. How many primary keys can a single relation (table) conditions. It allows selective data removal when
have at once? combined with a WHERE clause. Unlike DROP, which
(A) One removes an entire table, DELETE preserves the table
(B) Two structure and related schema definitions intact and
(C) Unlimited helps maintain consistency.
(D) Depends on database engine
6. Which of the following statements about the UPDATE
Ans command is NOT correct?
(A) One (A) It modifies existing rows in a table
A table can only have one primary key, though that (B) It can affect multiple rows using a single command
key can consist of multiple columns if needed. This (C) It automatically creates new tables if none exist
restriction enforces a unique identifier for each record, (D) It can use a WHERE clause to target specific rows
preventing duplication. Additional candidate keys may Ans
Expand Your Reach: Your readers can share these PDFs on other platforms, helping your
influence grow exponentially.
Still not convinced? Ask us how, and we’ll walk you through exactly how it works.
Best of all: It’s completely free—no hidden charges.
NOW() yields the current date and time. Matching (B) A localized network covering a small area, like a
these functions correctly ensures proper usage in SQL building
queries for text manipulation, arithmetic operations, A LAN connects computers and devices within a
substring extraction, and timestamp retrieval. limited geographic area, such as a home, school, or
office building. It facilitates high-speed data transfers
12. Which of the following statements about JOIN and resource sharing among connected machines. This
operations are correct? localized structure reduces latency and lowers costs,
1. INNER JOIN returns matching rows across tables. making LANs ideal for smaller-scale networking needs
2. LEFT JOIN returns all rows from the right table. in confined environments and deployment.
3. RIGHT JOIN returns all rows from the right table.
4. FULL JOIN returns all matching rows plus non- 15. What topology arranges all devices in a closed loop,
matching rows from both tables. where each device connects to exactly two others?
(A) 1 and 2 only (A) Bus
(B) 1, 3, and 4 only (B) Star
(C) 2, 3, and 4 only (C) Ring
(D) 1, 2, 3, and 4 (D) Tree
Ans Ans
(B) 1, 3, and 4 only (C) Ring
INNER JOIN retrieves records present in both tables. In a ring topology, each node is connected to exactly
RIGHT JOIN includes all rows from the right table, two neighbors, forming a continuous loop. Data travels
along with matching rows from the left table. FULL around the ring until it reaches the destination. While
JOIN includes matching and non-matching rows from it can simplify cabling, a single break in the loop can
both tables. LEFT JOIN returns rows from the left table disrupt communication unless specialized mechanisms,
and matching ones from the right. such as dual rings, are fully implemented.
13. Which device is primarily used to forward data packets 16. Which networking approach differentiates LAN, MAN,
between computer networks? and WAN primarily?
(A) Hub (A) Transmission protocol used
(B) Switch (B) Geographical coverage area
(C) Router (C) Encryption method implemented
(D) Repeater (D) Cable type required
Ans Ans
(C) Router (B) Geographical coverage area
A router directs data packets across different networks, LANs cover a small area, like offices or homes, MANs
determining the optimal path for transmission using span a city or metropolitan region, and WANs connect
routing tables. Unlike switches or hubs that mainly geographically distant locations. Though they may share
operate within a single network, routers connect networking protocols, the key difference lies in physical
multiple networks and manage traffic efficiently. They scope and distance. This classification influences cost,
facilitate inter-network communication, ensuring data complexity, and bandwidth requirements for each
reaches its correct destination across diverse segments network type.
securely.
17. Which Python keyword initiates an exception-handling
14. What is a LAN (Local Area Network)? block?
(A) A network that spans entire continents (A) throw
(B) A localized network covering a small area, like a (B) except
building (C) try
(C) A wireless protocol used for smartphones (D) raise
(D) A software tool for database backups Ans
Ans (C) try
In Python, the try keyword starts a block of code where The finally block executes whether an exception is
exceptions might occur. It is commonly paired with raised or not, ensuring essential cleanup. It does not stop
except or finally clauses to manage errors gracefully. This except blocks from running; instead, it follows them to
structure helps isolate risky operations and provides a finalize operations like closing files. Developers can
controlled way to handle runtime anomalies without also use else for code that runs only if no exception is
crashing the entire program or causing data loss. triggered, before finally carefully.
18. What is a user-defined exception in Python? 21. Arrange the following stack operations in the correct
(A) An error automatically raised by the Python sequence when evaluating an arithmetic expression in
interpreter postfix form:
(B) A custom error class created by the programmer 1. Push operands
(C) A syntax error that halts execution 2. Apply operator to top elements
(D) A library function that logs events 3. Pop operands
Ans 4. Push the result onto the stack
(A) 1 -> 3 -> 2 -> 4
(B) A custom error class created by the programmer (B) 1 -> 2 -> 3 -> 4
User-defined exceptions are Python error classes crafted (C) 3 -> 1 -> 4 -> 2
by developers to represent specific error conditions in (D) 1 -> 4 -> 3 -> 2
their applications. By subclassing Exception or related
classes, programmers can often tailor messages and Ans
responses, offering clearer diagnostics. These custom (A) 1 -> 3 -> 2 -> 4
exceptions improve code readability and modularity When evaluating postfix expressions, first push any
by differentiating unique error scenarios from generic operand onto the stack. When an operator appears,
built-in errors. pop the required number of operands, perform the
operation, then push the result back. So, the sequence
19. Which file mode in Python is used for both reading and is push operands (1), pop operands (3), apply operator
writing in a text file without overwriting the existing (2), and finally push the result (4) correctly.
content?
(A) w+ 22. Why is a stack considered a LIFO structure?
(B) r+ (A) Because the last item removed is the first item
(C) a+ inserted
(D) x+ (B) Because the last item inserted is the first item
Ans removed
(C) Because items can only be removed in a fixed
(B) r+ sequence
The ‘r+’ mode opens an existing text file for both (D) Because it automatically sorts elements
reading and writing, starting at the beginning without
automatically truncating the file’s content. Developers Ans
can then properly update or append within the same (B) Because the last item inserted is the first item
session and handle text operations effectively. This removed
option requires that the file already exists before A stack follows the Last-In, First-Out principle. The
opening. most recently added element is removed first, akin to a
stack of plates where the top plate is taken before those
20. Which of the following is NOT true about Python’s beneath. This structured approach supports operations
finally clause? like undo functionality, expression evaluation, and
(A) It always executes, regardless of exceptions function call management in many computing scenarios
(B) It is used to close resources or clean up tasks quite effectively.
(C) It prevents the except block from running
(D) It can appear after the else clause 23. What is the time complexity of pushing an element onto
Ans a stack implemented with a Python list, assuming no
resizing cost?
(C) It prevents the except block from running (A) O(n)
24. Which queue operation removes an element from the 27. Which searching algorithm inspects elements in a
front? sorted list by repeatedly halving the search space?
(A) ENQUEUE (A) Sequential Search
(B) DEQUEUE (B) Binary Search
(C) PEEK (C) Linear Search
(D) INSERT (D) Hash Search
Ans Ans
(B) DEQUEUE (B) Binary Search
A queue is a First-In, First-Out structure, where elements Binary search begins by comparing the target value
inserted first are removed first. DEQUEUE specifically to the middle element of a sorted list. If the target is
takes the front element out, shifting the remaining items smaller, the algorithm continues in the left sub-list; if
forward in some implementations. ENQUEUE adds larger, it proceeds in the right sub-list. Repeated halving
elements at the rear. This organization is widely used for dramatically reduces comparisons, yielding an O(log n)
scheduling processes and handling asynchronous tasks time complexity, making searching efficient overall.
efficiently in many systems.
28. Which statements are true about sequential search?
25. What is a DQueue (or Deque)? 1. It checks each element until a match is found.
(A) A queue that only allows insertion at the front 2. It requires the list to be sorted.
(B) A queue that only allows deletion at the rear 3. Its worst-case time complexity is O(n).
(C) A queue that supports insertion and deletion at 4. It cannot find an element if it is not unique.
both ends (A) 1 and 3 only
(D) A queue limited to one element (B) 1, 2, and 3 only
Ans (C) 2 and 4 only
(D) 1, 3, and 4 only
(C) A queue that supports insertion and deletion at both
ends Ans
A deque, short for double-ended queue, permits (A) 1 and 3 only
insertion and removal from either the front or the Sequential or linear search scans the list from the start,
rear. This versatility offers more efficient operations in comparing each element until it finds a match or reaches
certain scenarios compared to a standard queue, which the end. Its worst-case complexity is O(n). Sorting is
only allows front removal and rear insertion. Deques not required, and it can locate duplicate items. Hence,
are used for scheduling, caching, and adaptive dynamic statements 1 and 3 are correct, while 2 and 4 are not.
data handling.
29. Assertion (A) : Binary search is more efficient than
26. How does a circular queue differ from a simple linear sequential search for large sorted lists.
queue? Reason (R) : Binary search splits the list into halves,
(A) It doesn’t allow rear insertion reducing the number of comparisons logarithmically.
(B) It uses an array with a wrap-around to reuse vacated (A) Both (A) and (R) are true, and (R) is the correct
space explanation of (A).
(B) Both (A) and (R) are true, but (R) is not the correct (A) Both (A) and (R) are true, and (R) is the correct
explanation of (A). explanation of (A).
(C) (A) is true, but (R) is false. (B) Both (A) and (R) are true, but (R) is not the correct
(D) (A) is false, but (R) is true. explanation.
Ans (C) (A) is true, (R) is false.
(D) (A) is false, (R) is true.
(A) Both (A) and (R) are true, and (R) is the correct
explanation of (A). Ans
Binary search operates in O(log n) time for sorted (A) Both (A) and (R) are true, and (R) is the correct
lists by repeatedly halving the search space. Sequential explanation of (A).
search, with O(n) complexity, is less efficient for large Insertion Sort often excels when data is already close
datasets. The reason directly explains why binary search to sorted because each new element is positioned by
outperforms sequential search under these conditions, shifting only those that are larger. Fewer shifts mean
confirming that both the assertion and reason are faster performance. Bubble Sort, by contrast, repeatedly
indeed correct. swaps adjacent pairs. Thus, the reason directly clarifies
why Insertion Sort outperforms Bubble Sort on nearly
30. Which of the following statements about Bubble Sort is sorted arrays.
NOT correct?
(A) It repeatedly swaps adjacent elements if they are in 33. What is the mean of a dataset?
the wrong order (A) The most frequently occurring value
(B) It can take O(n^2) time in the worst case (B) The middle value when data is sorted
(C) It always completes sorting in exactly n passes (C) The sum of all values divided by the number of
(D) It compares pairs of elements to move larger ones to values
the right (D) The largest minus the smallest value
Ans Ans
(C) It always completes sorting in exactly n passes (C) The sum of all values divided by the number of
Bubble Sort iteratively compares adjacent elements, values
swapping them if out of order, gradually placing larger The mean, or average, is computed by adding all data
values at the end. Its worst-case complexity is O(n^2). points and dividing by the quantity of points. It provides
However, it does not invariably need exactly n passes; a central measure, though it can be skewed by outliers.
the algorithm may conclude earlier if no swaps occur, In contrast, the median is the middle value, and the
indicating the array is fully sorted. mode is the most frequent value in the dataset overall.
31. In Selection Sort, how many swaps occur in the best, 34. Which statistical measure indicates how far data points
average, or worst case for a list of n elements? spread from the mean and is calculated as the square
(A) Up to n*(n-1)/2 root of variance?
(B) Exactly 1 per pass, resulting in n-1 swaps (A) Median
(C) It depends on whether the list is partially sorted (B) Range
(D) Twice as many swaps as Bubble Sort (C) Standard Deviation
Ans (D) Mode
Expand Your Reach: Your readers can share these PDFs on other platforms, helping your
influence grow exponentially.
Still not convinced? Ask us how, and we’ll walk you through exactly how it works.
Best of all: It’s completely free—no hidden charges.
(B) 1-a, 2-c, 3-d, 4-b Bluetooth offers short-range connectivity, commonly
(C) 1-d, 2-a, 3-c, 4-b for devices like headphones. Infrared does need line-of-
(D) 1-c, 2-b, 3-d, 4-a sight to function effectively. Wi-Fi, or WLAN, powers
Ans moderate-range wireless internet access. Microwave
technology remains relevant for long-distance
(A) 1-b, 2-d, 3-a, 4-c communication links, so claiming it is irrelevant is
ZeroDivisionError arises when dividing by zero. incorrect. Therefore, statements 1, 2, and 4 are accurate.
ValueError emerges if a function receives an argument
of correct type but invalid value. TypeError appears Direction :Carefully read the case study provided and then
when an operation is applied to an incompatible type. thoroughly answer the subsequent five questions.
FileNotFoundError occurs if a requested file cannot Greenfield High School decided to integrate a new relational
be located. Accurately matching exceptions enables database system to manage student records, course
targeted error handling in Python effectively. enrollments, and exam results. The primary objective was
to centralize data across multiple departments, ensuring
39. Which statements are correct regarding network accurate and up-to-date information. The database
security threats? schema included separate tables for students, teachers,
1. A virus replicates itself to infect files courses, and grades, linked via foreign keys to maintain
2. A Trojan horse disguises malicious content as referential integrity. By implementing a robust primary
legitimate software key structure, administrators could quickly retrieve
3. Adware always deletes operating system files details about each student’s profile, along with associated
4. A firewall filters incoming and outgoing traffic class schedules. This initiative also enhanced data security
(A) 1, 2, and 4 only through role-based access, restricting unauthorized
(B) 1 and 3 only modifications. Teachers were trained to input marks
(C) 2 and 3 only directly, reducing manual errors. The success of this system
(D) 1, 2, and 3 only led to faster result generation, simplified record audits,
Ans and an overall improvement in communication among
(A) 1, 2, and 4 only school stakeholders. Administrators saved time during
A virus replicates to spread between files or systems, admissions and routine tasks, increasing efficiency.
while a Trojan horse hides its harmful nature behind a 41. Which key structure in the school’s database ensures
genuine application. A firewall monitors and controls each student has a unique identifier?
network traffic. Adware typically displays unwanted (A) Foreign Key
advertisements rather than deleting system files. Thus, (B) Composite Key
statements 1, 2, and 4 accurately describe network (C) Primary Key
security aspects effectively. (D) Candidate Key
40. Which statements are true about wireless Ans
communication technologies? (C) Primary Key
1. Bluetooth is typically used for short-range The primary key in each table guarantees unique
connections identification of records, such as individual students,
2. Infrared requires line-of-sight for reliable preventing duplicate entries. Other key types, like
transmission candidate keys, are potential primary keys, and foreign
3. Microwave is irrelevant in modern networking keys establish relationships between tables. The primary
4. Wi-Fi (WLAN) provides wireless internet access key is crucial for referencing and organizing data
over moderate distances accurately and systematically.
(A) 1, 2, and 4 only
(B) 1 and 3 only 42. How did role-based access enhance data security in the
(C) 2 and 3 only school’s database?
(D) 1, 2, and 3 only (A) By removing all user restrictions
Ans (B) By allowing only certain users to view or edit data
(C) By providing an auto-save feature every minute
(A) 1, 2, and 4 only (D) By encrypting data using public keys only
43. What advantage resulted from teachers entering marks Direction :Carefully read the case study provided and then
directly into the system? thoroughly answer the subsequent five questions.
(A) Increased manual errors The public library in Rivertown implemented a Python-
(B) Enhanced duplication of data based file management program to track book loans
(C) Reduced manual errors and returns. Librarians used text files to store member
(D) Slower result processing data and borrowed titles. They noticed that frequent
updates sometimes introduced errors, prompting a shift
Ans
to binary files with the pickle module for more reliable
(C) Reduced manual errors data serialization. By catching exceptions, the system
Having teachers directly enter marks into the database avoided crashes when members tried to return non-
decreases reliance on paper records, minimizing existent books or input invalid IDs. Staff created custom
transcription errors. It eliminates additional data entry exceptions to highlight overdue items, simplifying the fine
steps, enhancing accuracy and saving time. Automated calculation process. A robust try-except-finally structure
checks within the system can also validate inputs, ensured that files were closed properly, preventing data
ensuring that potential mistakes are caught early and corruption during unexpected shutdowns. As a result,
corrected before finalizing results very efficiently. library staff gained confidence in the program’s accuracy,
improved record-keeping, and streamlined daily tasks.
44. Which concept ensures linked tables remain consistent,
Fewer mistakes boosted overall patron satisfaction.
preventing orphan records?
This migration reduced manual intervention and saved
(A) Data replication
valuable time.
(B) Referential integrity
(C) Transaction logging 46. Why did the library switch from text files to binary files
(D) Composite indexing with the pickle module?
Ans (A) Text files are always read-only
(B) Binary files cannot store complex objects
(B) Referential integrity
(C) To achieve more reliable data serialization
Referential integrity enforces valid relationships
(D) To prevent librarians from accessing data
between tables. For example, a student ID in the grades
table must match an existing record in the students table. Ans
If a related record is deleted, referential integrity ensures (C) To achieve more reliable data serialization
corresponding entries are handled appropriately. This Binary files using pickle allow Python objects to be saved
safeguard keeps linked data synchronized and prevents and restored with minimal loss or formatting issues.
invalid references effectively. Text files can introduce parsing errors or encoding
conflicts, especially when the data structure is complex.
45. What was a direct benefit of centralizing data across
By adopting pickle, the library ensured dependable and
multiple departments?
consistent records, minimizing errors and preserving
(A) More scattered data storage
data relationships.
(B) Separate databases for each department
(C) Faster result generation and communication 47. How did custom exceptions help the library manage
(D) Removal of all security protocols overdue books?
Ans (A) By hiding all error messages
(B) By automatically destroying files
(C) By highlighting overdue items for fine calculation (C) Enhanced patron satisfaction
(D) By forcing a program restart (D) Mandatory system shutdowns
Ans Ans
(C) By highlighting overdue items for fine calculation (C) Enhanced patron satisfaction
Custom exceptions allowed staff to specifically detect As errors declined, patrons encountered fewer billing
and handle overdue cases, triggering alerts or special disputes, missed due dates, or incorrect records. The
logic for fines. Rather than mixing overdue errors with system’s reliability improved trust in library services,
generic exceptions, these user-defined types made the leading to happier members. Staff also spent less time
code easier to maintain. This approach streamlined troubleshooting problems and more time assisting
the process of identifying late returns and automating visitors. Consequently, overall satisfaction and
penalty assessments very effectively. confidence in the digital system increased.
Expand Your Reach: Your readers can share these PDFs on other platforms, helping your
influence grow exponentially.
Still not convinced? Ask us how, and we’ll walk you through exactly how it works.
Best of all: It’s completely free—no hidden charges.
PRACTICE PAPER 02
1. Which of the following correctly describes the difference (B) ALTER TABLE
between a candidate key and the primary key in a table? ALTER TABLE allows changes to a table’s structure,
(A) A candidate key must contain exactly two columns, including adding or dropping columns, modifying
while the primary key has one column definitions, or renaming the table. CREATE
(B) A candidate key is any potential unique key, while TABLE establishes a new table, UPDATE modifies row
the primary key is the chosen unique identifier data, and USE switches the current database context. By
(C) A candidate key can be repeated, while the primary using ALTER TABLE, administrators adapt schemas to
key cannot evolving data requirements.
(D) There can be multiple primary keys but only one
4. Why is the WHERE clause often used in an UPDATE
candidate key
statement?
Ans (A) To automatically join two tables
(B) A candidate key is any potential unique key, while (B) To filter the rows that should be modified
the primary key is the chosen unique identifier (C) To reorder columns before modification
Candidate keys are attributes or sets of attributes that (D) To generate a new index
uniquely identify table records. The primary key is Ans
selected from among these candidate keys as the main
identifier. While multiple candidate keys can exist, (B) To filter the rows that should be modified
only one is chosen as the primary key. This distinction In SQL, the WHERE clause narrows the scope of
ensures database tables are unambiguously referenced. an UPDATE statement by specifying which rows
to change. Without WHERE, every row in the table
2. In relational algebra, which operation returns a subset of would be updated, potentially causing unintended
columns from a relation? data alterations. By filtering targeted rows, developers
(A) Selection (σ) maintain precision and protect data integrity during
(B) Projection (π) modification operations.
(C) Union
5. Which of the following is NOT a valid DDL (Data
(D) Cartesian Product (×)
Definition Language) command in SQL?
Ans (A) CREATE
(B) Projection (π) (B) DROP
Projection (π) in relational algebra extracts specific (C) TRUNCATE
columns (attributes) from a relation, effectively (D) SELECT
narrowing the data set. By contrast, Selection (σ) filters Ans
rows based on conditions, Unionmerges two relations
with similar attributes, and Cartesian Product (×) pairs (D) SELECT
every row of one relation with every row of another. Data Definition Language includes commands like
CREATE, DROP, and TRUNCATE to define or alter
3. Which command in MySQL modifies the structure of database structures. SELECT is part of Data Query
an existing table, such as adding a new column? Language (DQL), used for retrieving data rather than
(A) CREATE TABLE modifying schema. Thus, while SELECT is critical for
(B) ALTER TABLE querying, it does not define or remove tables, indexes,
(C) UPDATE or constraints.
(D) USE
6. Which statement distinguishes the HAVING clause
Ans from the WHERE clause in SQL?
Expand Your Reach: Your readers can share these PDFs on other platforms, helping your
influence grow exponentially.
Still not convinced? Ask us how, and we’ll walk you through exactly how it works.
Best of all: It’s completely free—no hidden charges.
12. Match each layer of the TCP/IP model with its primary Ring’s declining usage further differentiates it from
responsibility: contemporary wireless networking methods.
Column I Column II 14. How does a switch differ from a hub in local area
1. Network Interface a. Ensures end-to-end networking?
Layer communication and (A) A switch broadcasts incoming data to all ports,
error-checking (e.g., while a hub filters by MAC
TCP, UDP) (B) Both forward packets to all ports, but a switch is
2. Internet Layer b. Interacts with user slower
applications and (C) A hub blindly repeats signals, while a switch
protocols (e.g., HTTP, forwards data selectively using MAC addresses
FTP) (D) Hubs are Layer 3 devices, switches are Layer 1
3. Transport Layer c. Maps IP addresses Ans
to MAC and handles (C) A hub blindly repeats signals, while a switch
physical network forwards data selectively using MAC addresses
details A hub replicates incoming signals to all connected
4. Application Layer d. Routes data across ports, causing unnecessary traffic. A switch reads MAC
multiple networks via addresses to send data only to the intended recipient
IP port, reducing collisions and improving throughput.
Options: This operation occurs at the data link layer, making
(A) 1-a, 2-b, 3-d, 4-c switches more efficient and scalable than basic hubs.
(B) 1-c, 2-d, 3-a, 4-b
15. Which Python statement is used to raise a user-defined
(C) 1-d, 2-a, 3-c, 4-b
exception intentionally?
(D) 1-b, 2-c, 3-a, 4-d
(A) throw
Ans (B) catch
(B) 1-c, 2-d, 3-a, 4-b (C) raise
The Network Interface Layer oversees physical network (D) except
details, including MAC addresses. The Internet Layer Ans
uses IP for routing across networks. The Transport Layer
(C) raise
(TCP/UDP) provides end-to-end reliability or speed.
In Python, the raise statement explicitly triggers an
The Application Layer handles high-level protocols such
exception, often a user-defined subclass of Exception.
as HTTP and FTP. Proper layering ensures modular
Developers employ raise to handle error conditions
design and easier troubleshooting.
programmatically or to communicate invalid states.
13. Which of the following is NOT a wireless communication Other keywords, like except, are used for catching
technology mentioned in typical WLAN/WPAN exceptions, while throw is not a native Python keyword
contexts? for exceptions.
(A) Bluetooth
16. What is the purpose of a finally block in Python
(B) Infrared
exception handling?
(C) Microwave
(A) To disable all error messages
(D) Token Ring
(B) To ensure code within it executes regardless of
Ans exceptions
(D) Token Ring (C) To declare custom exception classes
Token Ring is a wired LAN protocol where a token (D) To skip the except block
circulates in a ring topology to manage access. It Ans
is not a wireless technology like Bluetooth (short-
(B) To ensure code within it executes regardless of
range WPAN), Infrared (line-of-sight connectivity),
exceptions
or Microwave (point-to-point wireless links). Token
A finally block contains statements that run whether
an exception occurs or not. It is frequently used for
cleanup, like closing files or releasing resources. This typical for images or serialized objects, while text mode
design guarantees that critical post-processing steps suits readable data formats.
happen even if errors surface, maintaining program
20. Which Python module allows the serialization of objects
stability and preventing resource leaks or corruption.
to and from binary files with minimal effort?
17. Which built-in exception is raised in Python when an (A) csv
invalid index is used on a list or string? (B) pickle
(A) ValueError (C) sqlite3
(B) TypeError (D) json
(C) IndexError Ans
(D) KeyError
(B) pickle
Ans The pickle module in Python simplifies writing and
(C) IndexError reading serialized objects to binary files. It preserves
IndexError appears when a sequence reference, such object structure, including nested data. Although json
as my_list[5], goes out of valid range. ValueError is popular for text-based serialization, it omits certain
arises from an inappropriate value, TypeError stems Python-specific objects. csv is for comma-separated text
from using incorrect types, and KeyError occurs when data, and sqlite3 is a database interface. pickle best fits
a dictionary key is missing. Understanding these full object serialization.
distinctions helps developers create robust exception-
21. Why is a stack particularly useful for managing function
handling logic in Python.
calls in many programming languages?
18. Which of these file modes in Python does NOT preserve (A) It sorts function names alphabetically
existing file data? (B) It allows the last invoked function to be handled
(A) r first upon return
(B) a (C) It requires all function calls to complete in parallel
(C) r+ (D) It merges multiple return values into a single
(D) w variable
Ans Ans
(D) w (B) It allows the last invoked function to be handled first
Using w overwrites the file, creating a new, empty file upon return
if one does not already exist or discarding existing Stacks implement the Last-In, First-Out principle,
contents if it does. The r mode is read-only, a appends aligning with how function calls nest. When a function
new data, and r+ allows reading and writing without calls another, the return address is pushed onto the stack;
automatically truncating existing content. after completion, that address is popped, resuming the
caller. This mechanism elegantly manages nested calls,
19. How does reading from a binary file in Python differ local variables, and return sequences without confusion.
from reading from a text file?
(A) Binary files cannot be read in Python 22. In infix to postfix conversion using a stack, what role
(B) Text files must only store ASCII content does operator precedence serve?
(C) Binary files store data as raw bytes, while text files (A) It is ignored entirely
store data in human-readable encoding (B) It dictates the order in which operators are popped
(D) There is no difference at all and pushed
Ans (C) It ensures operands are processed before operators
(D) It blocks parentheses from being used
(C) Binary files store data as raw bytes, while text files
store data in human-readable encoding Ans
In Python, reading binary files retrieves a sequence of (B) It dictates the order in which operators are popped
bytes exactly as stored, whereas text files are interpreted and pushed
using an encoding (e.g., UTF-8). This distinction affects When converting infix expressions to postfix, a stack is
how data is processed and displayed. Binary mode is used to temporarily hold operators. Higher-precedence
operators must be popped and output before pushing
lower-precedence ones. Parentheses further override pointer (3) to reflect the new head, and finally return
precedence. This systematic handling of precedence and or record the removed element (4). This straightforward
associativity ensures that the resulting postfix expression sequence maintains the FIFO ordering characteristic of
evaluates correctly. queues.
23. Which operation in a queue is responsible for inserting 26. Match each searching algorithm with its key
a new element at the rear? characteristic:
(A) DEQUEUE Column I Column II
(B) ENQUEUE 1. Linear Search a. Uses a hashing function to
(C) FRONT directly map keys
(D) POP
2. Binary Search b. Checks elements
Ans sequentially until a match
(B) ENQUEUE is found
ENQUEUE adds an element to the rear (tail) of a queue, 3. Hashing c. Locates the middle index,
maintaining its First-In, First-Out structure. DEQUEUE requiring sorted data
removes an element from the front. FRONT or PEEK 4. Interpolation d. Estimates the position
may return the first element without removal. These Search based on the key’s
fundamental operations keep the queue orderly for distribution
scheduling, buffering, or level-order processing tasks. Options:
(A) 1-a, 2-c, 3-d, 4-b
24. Which statement about a circular queue is FALSE?
(B) 1-b, 2-d, 3-c, 4-a
(A) It links the rear back to the front array index
(C) 1-b, 2-c, 3-a, 4-d
(B) It allows unused space to be reused
(D) 1-d, 2-a, 3-b, 4-c
(C) It automatically sorts the queue elements
(D) It prevents the queue from becoming full when Ans
there are free slots (C) 1-b, 2-c, 3-a, 4-d
Ans Linear Search (1-b) checks each element one by one.
Binary Search (2-c) halves a sorted list. Hashing (3-
(C) It automatically sorts the queue elements
a) applies a hash function to directly index data.
A circular queue reuses vacated positions by wrapping
Interpolation Search (4-d) estimates the likely position
around, linking rear and front indexes. This design
by examining key distribution. Correct mapping
prevents false-full conditions when free space exists.
underscores their differing performance and data
However, it does not inherently sort the elements. Any
requirements.
sorting or priority management requires separate logic.
The circular structure simply optimizes space usage in 27. Which statements are true about binary search?
queue implementations. 1. The list must be sorted.
2. Worst-case complexity is O(n).
25. Arrange the operations for deleting an element from a
3. It compares the target with the middle element.
simple (linear) queue in the correct sequence:
4. It consistently splits the data into two halves.
1. Check if queue is empty
(A) 1, 3, and 4 only
2. Remove the front element
(B) 1 and 2 only
3. Increment the front pointer
(C) 2 and 3 only
4. Return or store the removed element
(D) 1, 2, 3, and 4
(A) 1 -> 2 -> 4 -> 3
(B) 1 -> 4 -> 3 -> 2 Ans
(C) 1 -> 2 -> 3 -> 4 (A) 1, 3, and 4 only
(D) 2 -> 3 -> 4 -> 1 Binary search needs a sorted list (statement 1). It
Ans compares the target with the middle element (statement
3) and splits the list roughly in half each iteration
(C) 1 -> 2 -> 3 -> 4
(statement 4). Its worst-case time complexity is O(log
To delete from a queue, first verify it is not empty (1).
Then remove the front element (2), update the front
n), not O(n). Hence, 1, 3, and 4 accurately describe of-place algorithms might copy the entire dataset to
binary search. another structure. In-place sorting conserves space
without inherently changing time complexity.
28. Assertion (A) : Linear search is simpler to implement
than binary search. 31. Which of these statements about Quick Sort is FALSE?
Reason (R) : Linear search requires the data to be sorted (A) It uses a pivot to partition the array
before any lookup. (B) Its average time complexity is O(n log n)
(A) Both (A) and (R) are true, and (R) is the correct (C) It never degrades to O(n²)
explanation of (A). (D) It relies on a divide-and-conquer approach
(B) Both (A) and (R) are true, but (R) is not the correct Ans
explanation.
(C) (A) is true, (R) is false. (C) It never degrades to O(n²)
(D) (A) is false, (R) is true. Quick Sort can degrade to O(n²) performance in
the worst case, particularly when the chosen pivot
Ans consistently produces unbalanced partitions. Its average
(C) (A) is true, (R) is false. performance is O(n log n), and it does employ a divide-
Linear search is indeed simpler to code because it and-conquer method with a pivot. Hence, claiming it
checks each element in turn, but it does not require never hits O(n²) is false.
sorting; it can operate on unsorted data. Binary search
32. Which measure of central tendency is most appropriate
is more complex yet requires sorted data. Therefore, the
assertion is correct, but the stated reason is incorrect for if a dataset has extreme outliers?
linear search. (A) Mean
(B) Median
29. Which sorting algorithm repeatedly divides the array (C) Mode
into halves, sorts each half, and merges them? (D) Range
(A) Bubble Sort Ans
(B) Insertion Sort
(C) Quick Sort (B) Median
(D) Merge Sort The median, being the middle value in an ordered
list, is less sensitive to extreme outliers than the mean.
Ans Outliers can skew the mean significantly, while the
(D) Merge Sort median remains more robust. The mode indicates the
Merge Sort employs a divide-and-conquer approach, most frequent value, and the range only captures the
splitting the array into halves until single or small span between minimum and maximum.
segments remain, then merging them in sorted order.
33. What is variance in statistics?
This method achieves O(n log n) performance in the
worst case. Bubble Sort and Insertion Sort are O(n²) in (A) The middle value of a dataset
worst cases, while Quick Sort has variable performance. (B) The most occurring value in a dataset
(C) The average of the squared deviations from the
30. What does the term in-place mean in the context of mean
sorting algorithms? (D) The difference between the maximum and
(A) Sorting data while using minimal extra space minimum values
(B) Sorting data in the cloud Ans
(C) Storing sorted data in a separate output file
(D) Changing the algorithm’s complexity from O(n²) to (C) The average of the squared deviations from the mean
O(1) Variance calculates how far each data point lies from
the mean, averaging the squared differences. A larger
Ans variance indicates wider spread, while a smaller one
(A) Sorting data while using minimal extra space means data is closely clustered. The standard deviation
An in-place sorting algorithm rearranges elements is the square root of this value, and other measures
within the given data structure, requiring only a (median, mode, range) capture different aspects.
constant or minimal amount of additional storage.
This approach is more memory-efficient, whereas out-
Expand Your Reach: Your readers can share these PDFs on other platforms, helping your
influence grow exponentially.
Still not convinced? Ask us how, and we’ll walk you through exactly how it works.
Best of all: It’s completely free—no hidden charges.
34. Match each descriptive statistic with its description: results, functioning like a unique filter.
(A) Both (A) and (R) are true, and (R) is the correct
Column I Column II
explanation of (A).
1. Standard a. The most frequently (B) Both (A) and (R) are true, but (R) is not the correct
Deviation occurring number in the explanation.
dataset (C) (A) is true, (R) is false.
2. Mode b. The arithmetic average of all (D) (A) is false, (R) is true.
values
Ans
3. Mean c. The amount of spread around
the mean, derived from (C) (A) is true, (R) is false.
variance’s square root While GROUP BY is typically used with aggregate
functions, MySQL syntax allows using GROUP BY
4. Range d. The difference between the
in queries even without them. However, it does not
largest and smallest values
function simply as a distinct filter. Using GROUP BY
Options: without aggregates can lead to nondeterministic results
(A) 1-c, 2-a, 3-b, 4-d unless you specify which columns to group and select
(B) 1-a, 2-b, 3-c, 4-d consistently.
(C) 1-d, 2-c, 3-a, 4-b
(D) 1-b, 2-d, 3-a, 4-c 37. Which statements are true regarding primary and
foreign keys in relational databases?
Ans
1. A primary key uniquely identifies each row in its
(A) 1-c, 2-a, 3-b, 4-d own table.
Standard Deviation (1-c) measures data spread around 2. A table can have multiple primary keys
the mean. Mode (2-a) is the most frequent value. Mean simultaneously.
(3-b) is the sum of all values divided by the count. 3. A foreign key references a column in another table.
Range (4-d) captures the difference between the highest 4. A foreign key always points to multiple rows in the
and lowest. Matching these terms clarifies fundamental referenced table.
descriptive statistics usage. (A) 1 and 3 only
(B) 1, 2, and 4 only
35. How does the median differ from the mean in assessing
(C) 2 and 4 only
central tendency?
(D) 1, 3, and 4 only
(A) The median always equals the mean in every dataset
(B) The median is highly affected by outliers, while the Ans
mean is not (A) 1 and 3 only
(C) The median is the central value when data is sorted, The primary key ensures uniqueness in its table
while the mean is the arithmetic average (statement 1), and a foreign key references a column
(D) The mean always gives integer values, while the (often a primary key) in another table (statement 3). A
median gives fractions table can have exactly one primary key at a time, though
Ans it might be a composite. A foreign key may reference one
or more rows but does not always reference multiples.
(C) The median is the central value when data is sorted,
while the mean is the arithmetic average 38. Match each Python file mode or function with its
The median splits a sorted dataset so half the values lie description:
below it and half above. The mean, in contrast, sums all
values then divides by the total count. Outliers can pull Column I Column II
the mean significantly, whereas the median can remain 1. a a. Creates a new file for writing,
more stable. Both measures provide useful but different fails if file exists
perspectives. 2. x b. Opens a file for appending,
creates if it does not exist
36. Assertion (A) : In MySQL, the GROUP BY clause can be
3. close() c. Writes and reads, truncates file
used without any aggregate functions.
if it exists
Reason (R) : GROUP BY purely ensures distinct row
4. w+ d. Terminates the connection to Direction :Carefully read the case study provided and then
an open file thoroughly answer the subsequent five questions.
TechNova University migrated its student registration
Options:
system to a robust database architecture to cope with
(A) 1-a, 2-d, 3-c, 4-b
increased enrollment. Each department maintained
(B) 1-b, 2-a, 3-d, 4-c
unique tables for courses and prerequisites, leading to
(C) 1-b, 2-c, 3-a, 4-d
complex data relationships. By introducing a single,
(D) 1-d, 2-b, 3-c, 4-a
centralized schema, administrators established strict
Ans primary and foreign key constraints. This change allowed
(B) 1-b, 2-a, 3-d, 4-c department heads to cross-reference course details for
Mode a (1-b) appends and creates a file if none exists. scheduling without duplicating records. A specialized table
Mode x (2-a) insists on creating a new file, failing if it tracked prerequisite chains, ensuring new registrations
already exists. The close() function (3-d) ends interaction met course requirements. The SQL engine enforced data
with an open file, releasing system resources. Mode w+ consistency, rejecting invalid entries automatically. A new
(4-c) opens for reading and writing, truncating existing reporting module generated real-time enrollment stats,
content. aiding timely decisions. Faculty praised the improved
integrity checks, while students benefited from a unified
39. Which network security concept uses a set of rules to portal showing all available electives. Overall, the system’s
allow or block traffic based on IP addresses or ports? reliability enhanced transparency and streamlined the
(A) Firewall registration workflow. This consistent platform reduced
(B) Adware administrative workload significantly.
(C) Worm
(D) Spam filter 41. Which structural adjustment helped departments avoid
duplicating course data?
Ans (A) Using separate databases for each department
(A) Firewall (B) Introducing a single, centralized schema
A firewall monitors and controls incoming and (C) Allowing each department to store identical tables
outgoing network traffic by applying security policies (D) Removing all foreign keys to simplify relationships
to IP addresses, ports, or protocols. Adware displays Ans
unwanted ads, worms self-replicate through vulnerable
systems, and spam filters specifically target unsolicited (B) Introducing a single, centralized schema
emails. Firewalls serve as a perimeter defense By merging departmental data into one unified database
mechanism in many networks and hosts. design, TechNova prevented redundant entries across
departments. This single schema enforced shared
40. Which method best safeguards a database from SQL references for courses and prerequisites, eliminating
injection attacks? conflicts. Rather than each department storing its own
(A) Concatenating user inputs directly into the SQL table duplicates, all courses were integrated, maintaining
query consistency and significantly reducing duplication
(B) Using parameterized queries or prepared hazards.
statements
(C) Disabling all user inputs 42. How did the prerequisite table improve course
(D) Relying on client-side JavaScript for validation registration?
(A) It removed the need to check course requirements
Ans (B) It tracked prerequisite chains to enforce valid
(B) Using parameterized queries or prepared statements enrollment
Parameterized queries keep user inputs separate (C) It assigned random prerequisites to each student
from the query structure, preventing malicious SQL (D) It replaced the primary key in all tables
fragments from altering command logic. Concatenating Ans
user strings is risky, and solely depending on client-side
checks is insufficient because attackers can bypass them. (B) It tracked prerequisite chains to enforce valid
Prepared statements ensure robust server-side input enrollment
handling, effectively mitigating injection risks.
The prerequisite table recorded which courses (A) They were forced to enroll without seeing electives
depended on others, ensuring no student registered for (B) They could only view courses from one department
an advanced subject without the required background. (C) They had a single interface listing all electives and
When a registration command was executed, the requirements
system verified this chain. Invalid enrollments were (D) They had no access to prerequisite checks
rejected, promoting academic standards and preventing Ans
unprepared students from joining advanced classes
prematurely. (C) They had a single interface listing all electives and
requirements
43. What was one direct result of enforcing foreign key A consolidated platform showed every elective
constraints at TechNova University? from all departments, along with prerequisites. This
(A) Automatic acceptance of all invalid entries eliminated confusion caused by scattered course data
(B) Students could register without departmental and empowered students to plan their academic paths
approval holistically. Transparency regarding prerequisites and
(C) Improved data consistency and rejection of scheduling simplified decision-making, enhancing the
incorrect references user experience and reducing errors in course selection.
(D) Departments lost the ability to share tables
Direction :Carefully read the case study provided and then
Ans thoroughly answer the subsequent five questions.
(C) Improved data consistency and rejection of incorrect GridCom Solutions built a Python tool to analyze
references network performance metrics for clients with multiple
Foreign key constraints ensure that any referenced branch offices. They stored logs as binary files, each
record exists in the parent table. This design eliminates containing serialized Python objects detailing packet loss,
orphan records, enforces valid relationships, and helps latency, and jitter measured daily. Network engineers
the database reject erroneous entries automatically. wrote custom exceptions to flag anomalies like extreme
At TechNova, referencing a non-existent course or latency spikes, prompting immediate alerts. The tool
an invalid student ID triggered an error, upholding ran scheduled tasks to read these files, parse objects,
integrity across related tables. and create graphical summaries. Using try-except-
finally ensured that files closed even if an error surfaced
44. Which feature made it easier for departments to see partway, safeguarding data integrity. A mismatch in file
real-time enrollment numbers? structure triggered a ValueError, prompting the system
(A) Manual data reconciliation each night to log it for later review. Over months, the approach
(B) A specialized script that exported CSVs once a helped technicians track performance trends accurately,
week refine bandwidth allocations, and troubleshoot problem
(C) The new reporting module that generated live segments in real time. Client satisfaction rose as diagnoses
statistics became faster and more precise.
(D) The removal of all constraints so queries ran faster
46. Why did GridCom Solutions choose binary files for
Ans
storing network metrics?
(C) The new reporting module that generated live (A) Because text files cannot handle numeric data
statistics (B) Because binary files preserve serialized Python
TechNova’s reporting module gathered current objects efficiently
registration data from the centralized schema. Instead (C) To ensure only large corporations could read the
of waiting for manual synchronization, users accessed data
up-to-date enrollment counts on demand. Such real- (D) To prevent reading the logs from Python
time insights helped administrators manage course
capacity, scheduling, and resource allocation effectively, Ans
avoiding guesswork and reactive decision-making in a (B) Because binary files preserve serialized Python
rapidly changing environment. objects efficiently
Storing metrics as serialized Python objects in binary
45. How did students benefit from this unified portal for files prevents data loss from formatting or encoding
course enrollment? conflicts. The tool can directly load objects with minimal
parsing, retaining structure for parameters like latency engineers to diagnose the mismatch and correct file
or jitter. This streamlined approach improves efficiency generation processes.
and consistency compared to text-based logs, which
50. Which outcome best describes how clients benefited
need additional parsing logic.
from these detailed performance metrics?
47. How did custom exceptions assist in maintaining (A) Slower problem resolution and frequent
network quality? misdiagnoses
(A) They disabled all anomaly detection (B) Complete elimination of latency in all networks
(B) They triggered immediate alerts for critical issues (C) Faster troubleshooting and targeted bandwidth
(C) They forced logs to remain unreadable adjustments
(D) They bypassed error handling automatically (D) Inability to view historical trends
Ans Ans
(B) They triggered immediate alerts for critical issues (C) Faster troubleshooting and targeted bandwidth
By defining specialized exceptions to detect extreme adjustments
latency spikes or abnormal packet loss, the tool With accurate daily metrics on packet loss, latency, and
promptly alerted engineers. This proactive notice let jitter, engineers could pinpoint congested segments
teams address possible configuration errors or network and allocate resources optimally. Rapid anomaly alerts
congestion swiftly. Rather than filtering issues only in meant faster intervention. Historical trends illuminated
logs, custom exceptions escalated critical events in real recurring issues, guiding long-term improvements.
time, preserving service quality. Overall, clients saw better service reliability and more
proactive problem-solving, boosting confidence in
48. Why was try-except-finally crucial for handling file GridCom’s solutions.
operations in this Python tool?
(A) It delayed file closing until the end of the year **************
(B) It guaranteed that files closed even if errors occurred
(C) It prevented reading binary data
(D) It produced random merges of data
Ans
(B) It guaranteed that files closed even if errors occurred
The try block runs the primary logic, while except catches
specific errors that might arise when reading or parsing
metrics. The finally block executes regardless, closing
the file to avoid resource leaks or corrupted writes. This
pattern safeguards data integrity and ensures the system
remains stable under unexpected conditions.
PRACTICE PAPER 03
1. Which of the following best describes the primary key union. By focusing on shared entries, it helps refine
in a relational database? query results and isolate data satisfying both conditions.
(A) A field used for text manipulation Consequently, it ensures consistent data subsets.
(B) A field that uniquely identifies each record
4. Why is using the SELECT-FROM-WHERE structure in
(C) A field for aggregated numeric calculations
(D) A field for storing duplicate values SQL essential for retrieving data effectively?
(A) It forces usage of advanced functions
Ans (B) It enforces mandatory sorting
(B) A field that uniquely identifies each record (C) It structures queries with clarity
The primary key is a unique identifier for each tuple in (D) It hides columns automatically
a relation, preventing duplication. It ensures that every Ans
row in the table can be accessed or referenced uniquely.
By maintaining uniqueness and non-null constraints, it (C) It structures queries with clarity
forms the cornerstone of relational database integrity The SELECT-FROM-WHERE structure organizes data
and effective data retrieval for overall consistency. retrieval by specifying required columns, relevant tables,
and filtering criteria. This standard approach fosters
2. Define the term foreign key in relational database readability, maintainability, and accuracy, allowing
design. queries to be logically formulated. By delineating what,
(A) A key that increases query speed where, and how to extract data, it reduces ambiguities
(B) A field used to store encrypted data and leads to comprehensible and efficient database
(C) A field referencing a primary key in another table operations.
(D) A field for storing only text values
5. Which of the following is NOT a Data Manipulation
Ans Language (DML) command in SQL?
(C) A field referencing a primary key in another table (A) INSERT
A foreign key is a relational database field matching the (B) SELECT
primary key of another table, creating a relationship. (C) UPDATE
It enforces referential integrity by ensuring that linked (D) DROP
records remain consistent across tables. This connection Ans
helps maintain structured data, allowing queries to
combine information accurately and prevent invalid (D) DROP
references or data anomalies. DML commands focus on modifying data within
existing database structures, whereas DROP is a Data
3. Which relational algebra operation returns all rows that Definition Language command used to remove entire
appear in both of two relations? tables or databases. INSERT, SELECT, and UPDATE
(A) Union manipulate data records, but DROP eliminates the
(B) Intersection schema object itself, making it distinct from pure data
(C) Projection manipulation operations.
(D) Selection
6. How does using a primary key differ from using an
Ans alternate key in relational design?
(B) Intersection (A) Both can have null values
Intersection in relational algebra yields only those (B) Primary key identifies records, alternate key
tuples that are common to both relations. It filters out duplicates them
rows not appearing in both sets, which is distinct from (C) Primary key is chosen as main identifier, alternate
Expand Your Reach: Your readers can share these PDFs on other platforms, helping your
influence grow exponentially.
Still not convinced? Ask us how, and we’ll walk you through exactly how it works.
Best of all: It’s completely free—no hidden charges.
key is a candidate key not selected (C) It reduces anomalies and duplicates
(D) They are identical in function Database normalization organizes tables to minimize
Ans redundant data and avoid inconsistencies. By structuring
fields to follow specific forms (1NF, 2NF, 3NF, etc.),
(C) Primary key is chosen as main identifier, alternate normalization combats update, insertion, and deletion
key is a candidate key not selected anomalies. These controlled relationships prevent
Multiple candidate keys might qualify to uniquely duplication and improve integrity, making queries more
identify rows, but only one becomes the primary key. efficient and data maintenance more reliable.
Those not chosen serve as alternate keys. Although
they share uniqueness, the primary key is the official 10. Which of the following commands will NOT remove
identifier. Alternate keys remain potential references any rows from a table directly?
if the primary key changes, ensuring flexible table (A) DELETE
relationships. (B) UPDATE
(C) TRUNCATE
7. Which SQL function is best for converting a string to (D) DROP
uppercase?
(A) MID() Ans
(B) LCASE() (B) UPDATE
(C) UCASE() UPDATE modifies existing rows based on defined criteria
(D) LENGTH() but does not remove them. DELETE and TRUNCATE
Ans eliminate rows (with TRUNCATE removing all records
quickly), whereas DROP eliminates the table structure
(C) UCASE() entirely. UPDATE only changes field values, preserving
UCASE(), also known as UPPER() in some SQL dialects, rows, making it distinct from removal operations.
changes every character of the string to uppercase. While
LCASE() transforms text to lowercase, MID() extracts a 11. Define a tuple in the context of relational databases.
substring, and LENGTH() calculates character count. (A) A column heading
UCASE() is specifically intended for converting letters (B) A single row in a table
to uppercase, aiding in uniform text formatting. (C) A combined foreign key structure
(D) A specialized type of query
8. Which operator in MySQL returns records that meet at
least one of multiple conditions? Ans
(A) AND (B) A single row in a table
(B) OR In relational database terminology, a tuple represents a
(C) NOT single row within a relation (table). Each tuple consists
(D) XOR of specific attribute values that collectively describe an
Ans entity instance. By storing related data in these rows,
relational databases facilitate structured querying, data
(B) OR manipulation, and adherence to defined constraints.
In MySQL, OR is used in the WHERE clause to match
rows that satisfy at least one condition among multiple 12. Which keyword in SQL is used to remove duplicate
specified conditions. If any condition evaluates to results from a query output?
true, the row is selected. Conversely, AND requires all (A) UNIQUE
conditions to be true, while NOT negates a condition, (B) DISTINCT
and XOR is less commonly used. (C) EXCEPT
(D) REDUCE
9. Why is normalization important in database design?
(A) It increases data redundancy Ans
(B) It merges unrelated tables (B) DISTINCT
(C) It reduces anomalies and duplicates DISTINCT ensures that a query returns only unique
(D) It limits indexing rows by eliminating any duplicates in the result set. This
Ans is particularly helpful when a column might contain
repeated values. Without DISTINCT, the query output
would show all entries matching the criteria, including manipulates data contents. SELECT is a DQL (Data
repetitions. Query Language) command for data retrieval.
13. In MySQL, how does the WHERE clause differ from the 16. Why is a Cartesian product in relational algebra seldom
HAVING clause? used alone in database queries?
(A) WHERE filters rows before grouping, HAVING (A) It automatically deletes rows
filters groups after aggregation (B) It often results in excessively large intermediate
(B) They are interchangeable clauses tables
(C) WHERE is used only with JOINs, HAVING only (C) It sorts data irreversibly
with ORDER BY (D) It merges columns incorrectly
(D) WHERE applies to text, HAVING to numbers Ans
Ans (B) It often results in excessively large intermediate
(A) WHERE filters rows before grouping, HAVING tables
filters groups after aggregation A Cartesian product combines every row from one
WHERE limits rows prior to grouping operations like relation with every row from another, rapidly expanding
GROUP BY, whereas HAVING narrows results after the data set. This unfiltered combination is typically
those aggregates are calculated. This distinction helps refined with join conditions to avoid unwieldy results.
refine data sets at different processing stages. WHERE Using Cartesian products alone can produce extraneous
excludes nonmatching rows early, while HAVING tuples that degrade performance and obscure
applies to summarized group results, allowing targeted meaningful data relationships.
filtering of aggregate values.
17. Which of these is NOT a valid data type in MySQL?
14. Which MySQL function returns the current date and (A) VARCHAR
time? (B) INT
(A) DATE() (C) RECORDSET
(B) NOW() (D) DATE
(C) DAYNAME() Ans
(D) MONTH()
(C) RECORDSET
Ans MySQL supports various data types like VARCHAR
(B) NOW() for variable-length text, INT for integers, and DATE
NOW() provides the current date and time on the for calendar dates. RECORDSET is not a MySQL data
server where the MySQL instance runs. DATE() type; it’s a concept in other database frameworks or
extracts only the date portion from a datetime value, environments, not recognized in standard MySQL type
while DAYNAME() returns the weekday name, and definitions.
MONTH() yields the month component. NOW()
18. Which MySQL clause is best for sorting records in
is primarily used for timestamp-related queries and
logging. ascending or descending order?
(A) GROUP BY
15. Which of the following is an example of a DDL (Data (B) HAVING
Definition Language) command in SQL? (C) ORDER BY
(A) INSERT (D) DISTINCT
(B) UPDATE Ans
(C) CREATE
(D) SELECT (C) ORDER BY
ORDER BY arranges the query output in ascending or
Ans descending order based on specified columns. GROUP
(C) CREATE BY clusters rows by shared values, HAVING filters
DDL commands define and modify the structure of aggregated results, and DISTINCT removes duplicates.
database objects, such as tables, indexes, or schemas. ORDER BY remains the principal clause for imposing a
CREATE, DROP, and ALTER belong to DDL. In sorting sequence on the retrieved data.
contrast, INSERT and UPDATE belong to DML, which
19. Which network topology uses a central hub or switch to (D) A domain name on the web
connect all nodes? Ans
(A) Ring
(B) Star (B) A physical address assigned to network interfaces
(C) Bus A MAC (Media Access Control) address is a hardware
(D) Mesh identifier unique to each network interface card.
Typically represented as hexadecimal pairs, it operates
Ans at Layer 2 of the OSI model. It remains constant, unlike
(B) Star IP addresses, which can change.
In a star topology, each node connects to a central hub,
23. How does a switch differ from a hub in a network?
switch, or router. This layout simplifies troubleshooting
because a single cable failure usually isolates only the (A) A switch broadcasts data to all ports, a hub does not
affected node. Although it may require more cable (B) A switch intelligently forwards data to specific
than some alternatives, star topologies offer ease of ports, a hub blindly broadcasts
maintenance and network management. (C) A switch is wireless only, a hub is wired only
(D) They function identically
20. Which device amplifies a signal to extend its range on Ans
a network?
(A) Hub (B) A switch intelligently forwards data to specific ports,
(B) Switch a hub blindly broadcasts
(C) Repeater Switches examine incoming data packets to determine
(D) Gateway their destination port, improving network efficiency.
Hubs, by contrast, repeat incoming signals to
Ans every connected port, causing unnecessary traffic.
(C) Repeater Consequently, switches reduce collisions and
A repeater regenerates or amplifies signals across congestion, making them well-suited for modern
network segments, compensating for signal degradation network infrastructures.
over distance. Hubs broadcast data to all connected
24. Which of the following is NOT a characteristic of a
ports, switches forward frames intelligently, and
gateways enable communication between different Wide Area Network (WAN)?
protocols. Repeaters specifically address weakening (A) Covers a large geographical area
signals to preserve data integrity. (B) Uses local connections only
(C) Often employs public telecommunication links
21. Why is an IP address necessary for devices on a network? (D) Connects multiple smaller networks
(A) It prevents hardware conflicts Ans
(B) It physically secures the device
(C) It uniquely identifies the device’s network location (B) Uses local connections only
(D) It ensures unlimited bandwidth WANs span broad regions or even global distances,
linking multiple local networks. They typically rely on
Ans leased telecommunication lines or satellites, enabling
(C) It uniquely identifies the device’s network location wide coverage. Local connections are more typical of
IP addresses provide logical identification and location LANs, which are confined to a single site like a building
addressing for devices, allowing data packets to be or campus.
routed accurately across networks. Without unique IP
25. Place the following network innovations in chronological
assignments, network communications would fail to
distinguish sender or recipient devices. IP addresses order of development:
facilitate structured data flow, serving as a core element 1. ARPANET
of modern networking. 2. Ethernet
3. World Wide Web
22. Define MAC address. 4. Wi-Fi
(A) A logical identifier that changes frequently (A) 1-2-3-4
(B) A physical address assigned to network interfaces (B) 2-1-3-4
(C) A router’s local IP (C) 1-3-2-4
36. Assertion (A) : A stack is used to evaluate postfix uniquely suited to preserving and retrieving complex
expressions. Python objects in binary form.
Reason (R) : Stacks operate on the principle of FIFO.
39. Which function in Python returns the length of a list?
(A) Both Assertion and Reason are true, and Reason is
the correct explanation (A) size()
(B) Both Assertion and Reason are true, but Reason is (B) length()
not the correct explanation (C) count()
(C) Assertion is true, but Reason is false (D) len()
(D) Assertion is false, but Reason is true Ans
Ans (D) len()
(C) Assertion is true, but Reason is false The built-in len() function returns the number of items
Postfix (Reverse Polish) expressions are naturally in an iterable such as a list, tuple, or string. Python
evaluated using a stack, which uses LIFO. FIFO is does not offer a size() or length() function for this
characteristic of queues. Thus, while the assertion purpose, and count() is used differently (e.g., counting
is valid, the reason is incorrect, invalidating it as an occurrences in sequences).
explanation. 40. Why is variance important in understanding data sets?
37. Assertion (A) : Selection sort can find the minimum (A) It measures the sum of all data points
element during each pass. (B) It indicates how data points deviate from the mean
Reason (R) : Selection sort repeatedly swaps adjacent (C) It shows the oldest data point
out-of-order elements until fully sorted. (D) It directly identifies cause-effect relationships
(A) Both Assertion and Reason are true, and Reason is Ans
the correct explanation (B) It indicates how data points deviate from the mean
(B) Both Assertion and Reason are true, but Reason is Variance shows how far values in a dataset are spread out
not the correct explanation from the average. A high variance suggests data is more
(C) Assertion is true, but Reason is false dispersed, whereas a low variance shows clustering
(D) Assertion is false, but Reason is true around the mean. This metric helps statisticians or
Ans analysts interpret data consistency and distribution.
(B) Both Assertion and Reason are true, but Reason is Direction :Carefully read the case study provided and then
not the correct explanation thoroughly answer the subsequent five questions.
Selection sort locates the smallest element each pass and In a school’s database system, an administrator wants to
places it correctly, but it does not rely on consecutive maintain records of students, teachers, and classes using
adjacent swaps (that is bubble sort’s method). The MySQL. The Students table includes fields like StudentID
assertion stands, yet the reason given describes a (primary key), Name, Age, and ClassID. The Classes
different algorithm, so it is not the correct justification. table holds ClassID (primary key), ClassName, and
38. Which Python module is commonly used for reading TeacherID. Teachers are stored in a separate table with
and writing binary files with object serialization? TeacherID (primary key), TeacherName, and Subject. The
(A) JSON administrator aims to ensure referential integrity so that
(B) pickle each Student record references a valid ClassID, and each
(C) csv Class references a valid TeacherID. Queries commonly
(D) os JOIN these tables to generate class rosters, display teacher
assignments, or produce statistical summaries of student
Ans performance. By carefully defining primary and foreign
(B) pickle keys, the database fosters accuracy, prevents anomalies,
The pickle module serializes Python objects into a byte and supports efficient retrieval of related information
stream and restores them later. JSON deals with text- across tables. Through these strategies, data redundancy
based data, csv manages comma-separated values, is minimized, and updates remain seamless.
and os interfaces with the operating system. pickle is
41. Which field primarily ensures that no two students
share the same identifier?
Expand Your Reach: Your readers can share these PDFs on other platforms, helping your
influence grow exponentially.
Still not convinced? Ask us how, and we’ll walk you through exactly how it works.
Best of all: It’s completely free—no hidden charges.
PRACTICE PAPER 04
1. Which SQL command modifies existing table structures modifies strings, and ISNULL() is used to check for null
by adding or dropping columns? but does not return the first non-null value.
(A) SELECT
4. Why is the GROUP BY clause particularly useful in SQL
(B) ALTER TABLE
(C) GROUP BY queries?
(D) TRUNCATE (A) It duplicates rows
(B) It merges multiple databases
Ans (C) It aggregates rows based on shared column values
(B) ALTER TABLE (D) It ensures only one row is returned
ALTER TABLE belongs to DDL and changes the Ans
structure of a table, such as by adding, dropping, or
modifying columns. SELECT only retrieves data, (C) It aggregates rows based on shared column values
GROUP BY aggregates, and TRUNCATE removes all GROUP BY clusters rows having identical values in
rows while preserving the table schema. ALTER TABLE specified columns. This grouping allows aggregate
is specifically for schema alterations. functions (e.g., SUM, COUNT, AVG) to summarize
those subsets. By focusing on shared attributes, GROUP
2. What is a candidate key in relational databases? BY offers granular insights into categorized data.
(A) A key with repeated values allowed
5. Which of the following would NOT be recognized as a
(B) A key that temporarily replaces a primary key
(C) A minimal set of attributes that can uniquely valid SQL arithmetic operator?
identify a row (A) +
(D) A key used exclusively for text fields (B) -
(C) &
Ans (D) *
(C) A minimal set of attributes that can uniquely Ans
identify a row
Candidate keys are the smallest combinations of fields (C) &
that uniquely identify each record in a table. One Standard SQL arithmetic operators include +, -, *, and
candidate key is chosen as the primary key, while the /. Ampersand (&) may have specialized uses in certain
rest remain alternate keys. These key sets cannot contain database implementations for bitwise operations, but
extraneous attributes if they are to remain truly minimal. it is not part of basic SQL arithmetic. Hence, & is not
generally recognized as a straightforward arithmetic
3. Which function returns the first non-null value in operator.
MySQL among its arguments?
6. How does the MIN() function differ from the COUNT()
(A) CONCAT()
(B) COALESCE() function in SQL?
(C) REPLACE() (A) MIN() tallies rows, COUNT() finds the smallest
(D) ISNULL() value
(B) MIN() returns the smallest value, COUNT()
Ans calculates numeric totals
(B) COALESCE() (C) MIN() yields the smallest value, COUNT() tallies
COALESCE() examines arguments in order and returns rows
the first that is not null. This is especially useful to (D) They perform identical operations
substitute default values when some columns might Ans
contain null. CONCAT() appends strings, REPLACE()
(C) MIN() yields the smallest value, COUNT() tallies filter or calculate values for the outer query. They serve
rows separate but complementary roles.
MIN(column) finds the lowest value in the chosen
10. Which command will NOT change the rows stored in
column, whereas COUNT(*) or COUNT(column)
returns the number of matching rows. Both are aggregate a table?
functions, but they measure different characteristics: (A) INSERT
minimal value vs. row count. (B) UPDATE
(C) DELETE
7. Which function is best to extract the month portion (D) SELECT
from a date in MySQL? Ans
(A) MONTH()
(B) DAYNAME() (D) SELECT
(C) YEAR() SELECT purely reads data without altering any rows.
(D) CONCAT() INSERT adds new records, UPDATE changes existing
ones, and DELETE removes them. SELECT queries
Ans remain read-only operations, crucial for data retrieval
(A) MONTH() or reporting.
MONTH(date) isolates the month component as an
11. Define the term domain in the relational model.
integer. DAYNAME() yields the weekday’s name,
YEAR() isolates the year, and CONCAT() is unrelated (A) The range of valid values an attribute can have
to date slicing. MONTH() is the direct choice for (B) The default table name
extracting the month field from a date. (C) An unlimited set of possible keys
(D) The combined set of all tables in a database
8. Which SQL statement is used to remove an entire table Ans
and its data from a database?
(A) DELETE (A) The range of valid values an attribute can have
(B) DROP TABLE A domain specifies permissible data for a given attribute
(C) TRUNCATE (e.g., integer only, specific text length). This constraint
(D) RENAME prevents invalid inputs and encourages consistent data
structures. Without well-defined domains, attribute
Ans values could become inconsistent and reduce data
(B) DROP TABLE quality.
DROP TABLE eliminates a table’s structure and its
12. Which SQL keyword arranges query results
data entirely. TRUNCATE clears all data but keeps
the schema, DELETE selectively removes rows, and alphabetically by a specified column?
RENAME modifies the table’s name without changing (A) DISTINCT
its data. (B) ROLLUP
(C) ORDER BY
9. How does a join differ from a subquery in SQL? (D) MERGE
(A) Joins combine rows from different tables, Ans
subqueries nest a query within another query
(B) Subqueries always yield faster performance than (C) ORDER BY
joins ORDER BY sorts the output in ascending (alphabetical
(C) They are identical in structure and use for text) or descending order. DISTINCT eliminates
(D) Joins only work with numeric columns duplicates, ROLLUP generates multi-level aggregates,
and MERGE is not a standard sorting mechanism
Ans in SQL syntax. ORDER BY is the direct method for
(A) Joins combine rows from different tables, subqueries arranging output.
nest a query within another query
13. How do LANs differ from WANs?
Joins simultaneously merge data from multiple tables
in a single result set, often using matching columns. A (A) LANs cover large geographic areas; WANs cover
subquery is a query embedded in another, often used to small ones
(B) LANs connect widely dispersed offices; WANs only
layer with DNS. IP addresses are the fundamental unit (C) Worms can spread automatically, viruses often
of network-level identification. need user action
(D) They are the same threat with different names
20. Which protocol is primarily responsible for transferring
web pages? Ans
(A) FTP (C) Worms can spread automatically, viruses often need
(B) SMTP user action
(C) HTTP Worms typically propagate independently across
(D) POP3 networks, while viruses embed in files or executables and
Ans generally need user intervention to trigger replication.
Both can be malicious, but their infection vectors differ:
(C) HTTP worms exploit vulnerabilities directly, whereas viruses
HTTP (Hypertext Transfer Protocol) underpins the attach to host programs or documents.
World Wide Web, enabling browsers to request and
receive web pages from servers. FTP deals with file 24. Which of the following does NOT typically characterize
transfers, SMTP with sending email, and POP3 with spyware?
retrieving email from mail servers. (A) Secretly collects user data
(B) Displays unwanted advertisements
21. Why are domain names used instead of raw IP addresses? (C) Informs the user clearly of its activity
(A) They ensure unlimited bandwidth (D) Sometimes transmits data to third parties
(B) They physically secure computers
(C) They provide human-readable identifiers Ans
(D) They eliminate the need for routers (C) Informs the user clearly of its activity
Ans Spyware functions surreptitiously, gathering data or
monitoring user behavior without consent. It may deliver
(C) They provide human-readable identifiers intrusive ads or forward stolen information elsewhere.
Domain names offer a memorable alternative to numeric Disclosing its presence openly would undermine its
IP addresses, boosting user convenience. DNS converts covert purpose, so it avoids alerting the user.
those names to IP addresses. This arrangement does not
remove routing necessities; it simplifies navigation and 25. Arrange these steps of exception handling in Python
fosters an intuitive Internet experience. from first to last:
1. Attempting risky code in try block
22. Define Trojan horse in the context of network security. 2. Catching exception in except block
(A) A harmless software patch 3. Executing code in finally block
(B) A malicious program disguised as legitimate 4. Handling code in else block if no exception occurs
software (A) 1-2-4-3
(C) A firewall program authorized by the system (B) 2-1-3-4
(D) A standard antivirus tool (C) 1-3-4-2
Ans (D) 4-1-2-3
(B) A malicious program disguised as legitimate Ans
software (A) 1-2-4-3
A Trojan horse masquerades as trustworthy software First, the try block runs. If an exception is raised, the
but conceals harmful functions that let attackers access except block catches it; if none appears, the else block
or damage a system. Unlike viruses that replicate runs. Finally always executes last, whether an exception
themselves, Trojans rely on users to run them. They occurred or not. This sequence ensures thorough
commonly appear as enticing downloads or attachments, handling and cleanup.
jeopardizing security once installed.
26. Organize these steps for performing a binary search on
23. How does a worm differ from a virus in cyber threats? a sorted list:
(A) Worms require user action to replicate, viruses 1. Compare target with middle
spread automatically 2. If target is less, search left sublist
(B) Worms are harmless, viruses are always destructive 3. Set low and high pointers
4. If target is more, search right sublist get(key) returns a value or a default if the key isn’t found,
(A) 3-1-2-4 pop(key) removes and returns the key-value entry,
(B) 1-2-3-4 keys() provides a list-like view of all keys, and items()
(C) 3-2-1-4 provides (key, value) tuples. These methods streamline
(D) 2-3-1-4 dictionary manipulation.
Ans 29. Match the following file operations with their
(A) 3-1-2-4 descriptions in Python:
Binary search starts by setting low and high. Then it
Column I Column II
compares the target with the middle. If smaller, the
search continues in the left portion; if larger, the right. 1. open() a. opens file
Repeating narrows the range until the item is found or 2. read() b. reads file
deemed absent. 3. write() c. writes to file
4. close() d. closes file
27. Match these MySQL data types to typical uses:
Options:
Column I Column II (A) 1-a, 2-b, 3-c, 4-d
1. CHAR(n) a. fixed-length text (B) 1-d, 2-b, 3-c, 4-a
2. INT b. integer (C) 1-b, 2-c, 3-d, 4-a
3. DATE c. date value (D) 1-a, 2-d, 3-b, 4-c
4. DECIMAL(p,q) d. fixed-point numbers Ans
Options: (A) 1-a, 2-b, 3-c, 4-d
(A) 1-a, 2-b, 3-c, 4-d open() initiates a file object, read() retrieves data,
(B) 1-d, 2-b, 3-c, 4-a write() appends or replaces existing file content, and
(C) 1-b, 2-c, 3-d, 4-a close() ends access to the file. Properly closing releases
(D) 1-a, 2-d, 3-b, 4-c resources and finalizes data storage.
Ans 30. Match these computer network security terms with
(A) 1-a, 2-b, 3-c, 4-d their descriptions:
CHAR(n) designates fixed-length text, INT handles
Column I Column II
integer data, DATE stores calendar dates, and
1. Firewall a. protective barrier
DECIMAL(p,q) represents exact numeric values with
specified precision. This configuration covers typical 2. Phishing b. fraudulent attempt to obtain
usage in MySQL table design. info
3. HTTPS c. encrypted web protocol
28. Match the Python dictionary methods with their
4. Spam d. unsolicited messages
outcomes:
Options:
Column I Column II (A) 1-a, 2-b, 3-c, 4-d
1. get(key) a. retrieve value safely (B) 1-d, 2-b, 3-c, 4-a
2. pop(key) b. remove entry (C) 1-b, 2-c, 3-d, 4-a
3. keys() c. return list of keys (D) 1-a, 2-d, 3-b, 4-c
4. items() d. return list of keys Ans
Options: (A) 1-a, 2-b, 3-c, 4-d
(A) 1-a, 2-b, 3-c, 4-d A fire wall restricts unauthorized traffic, phishing lures
(B) 1-d, 2-b, 3-c, 4-a individuals to divulge private data, HTTPS provides
(C) 1-b, 2-c, 3-d, 4-a secure, encrypted web communication, and spam is
(D) 1-a, 2-d, 3-b, 4-c unwanted bulk messaging. Properly identifying these
concepts strengthens overall security knowledge.
Ans
(A) 1-a, 2-b, 3-c, 4-d
31. Match the following Python list methods with their (B) 2, 3
functions: Selection sort can select either the smallest element
for ascending order or the largest for descending, but
Column I Column II
it’s known for doing a single swap per pass. Its average
1. append() a. add element at end time is O(n²). Quicksort is typically faster in practice, so
2. extend() b. add elements from an iterable statement 4 is false, and statement 1 depends on sorting
3. insert() c. insert element at specific index direction.
4. pop() d. remove and return item at
34. Which of the following statements about MySQL JOINs
index
are correct?
Options: 1. INNER JOIN returns matching rows across tables
(A) 1-a, 2-b, 3-c, 4-d 2. LEFT JOIN returns all rows from the left table plus
(B) 1-d, 2-b, 3-c, 4-a matched ones from the right
(C) 1-b, 2-c, 3-d, 4-a 3. RIGHT JOIN returns only matched rows from both
(D) 1-a, 2-d, 3-b, 4-c tables
Ans 4. FULL JOIN includes all rows from both tables with
matches or no matches
(A) 1-a, 2-b, 3-c, 4-d
5. CROSS JOIN merges data based on a related
append(x) places x at the list’s end, extend(iterable)
column
iterates through elements to add them all, insert(i, x)
(A) 1, 2, 4
places x at index i, and pop(i) removes and returns the
(B) 1, 2, 4, 5
item at index i (defaulting to the last if unspecified).
(C) 1, 2, 3, 5
These are fundamental list operations.
(D) 2, 3, 4
32. Which statements about a stack are correct? Ans
1. Topmost element is accessed last
(A) 1, 2, 4
2. Last element pushed is the first to be popped
INNER JOIN gives rows that match in both tables,
3. It follows FIFO
LEFT JOIN keeps all rows from the left table plus
4. pop() removes the last pushed item
matched from the right, and FULL JOIN includes all
(A) 1 and 4
rows from both, matched or unmatched. RIGHT JOIN
(B) 2 and 4
is analogous to LEFT JOIN from the other side. CROSS
(C) 1, 2, and 4
JOIN produces a Cartesian product, not a match on
(D) 2, 3, and 4
related columns.
Ans
35. Which statements about linear search are valid?
(C) 1, 2, and 4
1. It sequentially checks each element
A stack employs LIFO, where the topmost (most recent)
2. It requires sorted data
item is accessed last and popped first. FIFO defines
3. It has O(n) worst-case complexity
queues, not stacks. Hence 1 (top accessed last), 2 (last
4. It stops immediately upon finding a match
pushed is first popped), and 4 (pop removes last pushed)
(A) 1, 3, and 4
describe stack behavior accurately.
(B) 1, 2, and 3
33. Which statements about selection sort are true? (C) 2, 3
1. It selects the largest element in each pass (D) 1 and 2
2. It typically performs one swap per pass Ans
3. It has an average complexity of O(n²)
(A) 1, 3, and 4
4. It is faster than quicksort on average
Linear search moves element by element, from start to
(A) 1, 2, 3
finish, so it is O(n) in the worst case. Data does not have
(B) 2, 3
to be sorted, and once it finds the target, it can terminate
(C) 2, 3, 4
instantly. Statements 1, 3, and 4 hold true for linear
(D) 1, 2, 4
search.
Ans
36. Assertion (A) : An index can speed up SELECT queries. (A) sys
Reason (R) : Indexes replicate entire tables multiple (B) math
times. (C) csv
(A) Both Assertion and Reason are true, and Reason is (D) random
the correct explanation Ans
(B) Both Assertion and Reason are true, but Reason is
not the correct explanation (C) csv
(C) Assertion is true, but Reason is false Python’s built-in csv module provides reader and writer
(D) Assertion is false, but Reason is true objects to handle comma-separated values, enabling
structured import and export of tabular data. The
Ans other listed modules serve different purposes (system
(C) Assertion is true, but Reason is false interaction, math operations, or random number
Indexes can greatly accelerate data retrieval by generation).
referencing key columns, but they do not replicate entire
40. Why is standard deviation important in data analysis?
tables. Instead, an index creates a smaller, more efficient
structure, allowing quicker lookups. The reason given is (A) It represents the mode of a data set
incorrect, even though the assertion itself is valid. (B) It displays the highest value in the set
(C) It measures data spread relative to the mean
37. Assertion (A) : A queue uses first-in-first-out ordering. (D) It only applies to categorical variables
Reason (R) : Elements are removed from the front and Ans
inserted at the rear.
(A) Both Assertion and Reason are true, and Reason is (C) It measures data spread relative to the mean
the correct explanation Standard deviation reveals how closely data points
(B) Both Assertion and Reason are true, but Reason is cluster around the mean or how dispersed they are. A
not the correct explanation larger value indicates broader variability, whereas a
(C) Assertion is true, but Reason is false smaller number signals tight grouping. It’s fundamental
(D) Assertion is false, but Reason is true to statistical insights about consistency and outliers
within a dataset.
Ans
(A) Both Assertion and Reason are true, and Reason is Direction :Carefully read the case study provided and then
the correct explanation thoroughly answer the subsequent five questions.
A queue indeed follows FIFO. Items join at the rear and In a college attendance system, a Python program
leave from the front, meaning the earliest insertion is maintains a stack of daily attendance logs for quick
the earliest removal. The reason accurately explains why checks. Each day’s log is pushed onto the stack, containing
a queue implements FIFO. details such as date, subject, and present students’ roll
numbers. Faculty members can pop the latest log to
38. Which Python statement is used to manually raise an correct or review recent attendance records. If an error
exception? is found, the updated record is pushed again. The system
(A) except helps maintain an orderly record, ensuring that the most
(B) assert current attendance data is readily accessible. The stack
(C) raise approach suits daily logs because it preserves recent data
(D) pass on top, simplifying last-minute revisions. By using this
Ans LIFO structure, administrators reduce confusion and keep
older logs intact below. This design also allows easy data
(C) raise migration and archiving when needed. Consequently,
The raise statement allows developers to generate attendance handling becomes efficient and traceable for
exceptions programmatically when specific conditions academic audits.
occur. except clauses handle exceptions, assert tests
expressions for debugging, and pass does nothing. So 41. Why is a stack an appropriate structure for daily
raise is explicit for triggering an exception. attendance logs?
(A) It stores all logs in sorted order by date
39. Which Python module is typically used for reading and (B) It follows FIFO
writing CSV files?
(C) It keeps the most recent log on top for easy revisions The LIFO property of a stack allows newly inserted
(D) It requires random access to older logs frequently attendance logs to sit on top, enabling fast modifications
Ans when errors arise. Once corrected, faculty push the
updated version back. Older records remain unaffected
(C) It keeps the most recent log on top for easy revisions unless specifically accessed, simplifying immediate fixes
A stack is a LIFO structure, so the newest entry (daily without reorganizing everything.
attendance) sits on top. If that data needs changes,
popping and re-pushing the log is straightforward. 45. How does the system handle data migration or archiving
This avoids random-access complexities, as older data when logs accumulate?
remains below until specifically accessed. (A) By sequentially popping older logs from the bottom
(B) By converting the stack into a queue
42. What happens when a faculty member pops a log? (C) By selectively removing top logs once they’re no
(A) The entire stack is deleted longer needed
(B) The last inserted attendance record is removed (D) By overwriting all logs automatically
from the top
(C) All older logs are re-ordered automatically Ans
(D) The system merges logs from different days (C) By selectively removing top logs once they’re no
Ans longer needed
In a stack, removal occurs from the top. Administrators
(B) The last inserted attendance record is removed from pop the latest logs for archiving or migration, preserving
the top older ones beneath until they reach them through
Popping from a stack removes only the top element, successive pops. This design eliminates accidental
aligning with LIFO. Faculty can then inspect or correct overwrites of older data and ensures controlled, step-
that specific log. No reordering of lower elements by-step record handling.
occurs, and logs from other days remain intact unless
popped later in sequence. Direction :Carefully read the case study provided and then
thoroughly answer the subsequent five questions.
43. Why might older logs remain untouched at lower levels A small startup hosts its data on a local server and
of the stack? wants to securely expand access to remote teams. The
(A) They are automatically sorted by name company decides to establish a Virtual Private Network
(B) The system permanently locks them (VPN) so employees can securely log in from different
(C) LIFO access focuses on the topmost element locations. To safeguard credentials, they enable multi-
(D) The queue prevents random access factor authentication and configure the firewall to permit
Ans VPN traffic only. Additionally, intrusion detection
(C) LIFO access focuses on the topmost element software monitors suspicious activities. The startup
Since a stack’s removal and inspection occur at the top, also uses encryption protocols like SSL/TLS for sensitive
previously inserted logs stay beneath unless those above web-based applications, ensuring that data remains
are popped first. This prevents older entries from being confidential in transit. Regular penetration tests are
displaced or altered inadvertently, maintaining reliable conducted to evaluate any vulnerabilities. If an anomaly
historical data below recent records. is detected, administrators block the source IP temporarily
and investigate further. By blending encryption,
44. Which advantage does this stack system provide for authentication, and proactive monitoring, the startup
last-minute record adjustments? upholds robust security for distributed workflow and
(A) It hides errors permanently resource sharing. This integrated approach fosters trust
(B) It discards older attendance data and prevents data breaches.
(C) It places the newest logs at the top for quick
46. Why did the startup implement a VPN for remote
correction
(D) It prevents new data from being added teams?
(A) To broadcast data to unauthorized users
Ans (B) To circumvent security checks
(C) It places the newest logs at the top for quick (C) To provide a secure, encrypted channel for remote
correction access
PRACTICE PAPER 05
1. Which of the following best defines a database in but rather narrows the columns. This helps optimize
relational data management? data retrieval by focusing only on the relevant fields
(A) A random pile of unstructured data needed for an operation.
(B) A structured collection of related records
4. Which of the following is not an advantage of using
(C) A directory for storing multimedia files
(D) A set of programming instructions Structured Query Language (SQL)?
(A) Consistency in database operations
Ans (B) Capability to easily integrate with multiple DBMS
(B) A structured collection of related records (C) Random creation of data without structure
A database is systematically organized to store and (D) Standardization across various platforms
manage related data. It enforces relationships, ensures Ans
minimal redundancy, and makes it easier to perform
queries. By grouping related records under defined fields, (C) Random creation of data without structure
a database prevents data chaos and provides efficient SQL enforces structured, logical data manipulation. It
retrieval and manipulation for various applications and cannot arbitrarily create disorganized data. It promotes
analyses. standardization and facilitates integration with multiple
systems, ensuring consistent and well-defined database
2. Which key is used to uniquely identify each tuple in a operations. Random or unstructured data creation is
relational table? not supported within the inherent principles of SQL.
(A) Foreign key
5. Which statement correctly contrasts the Cartesian
(B) Primary key
(C) Candidate key Product and a Join in relational operations?
(D) Alternate key (A) Both omit matching rows
(B) Cartesian product only finds matching rows
Ans (C) Join returns all rows regardless of matching
(B) Primary key (D) Join applies a matching condition, while Cartesian
The primary key is a specific candidate key selected product returns all row combinations
to uniquely identify rows in a table. It cannot contain Ans
NULL values and must be unique. This mechanism helps
preserve data integrity, ensuring each record remains (D) Join applies a matching condition, while Cartesian
distinguishable and preventing duplicate entries from product returns all row combinations
polluting the data in the table. A Cartesian product pairs every row from one table
with every row of another, producing all possible
3. In relational algebra, which operation is used to retrieve combinations. A Join specifically aligns rows based on
certain attributes while discarding others? defined conditions. By matching attributes, the Join
(A) Selection (σ) restricts the result set, unlike the unrestricted Cartesian
(B) Projection (π) product.
(C) Union
6. When designing an efficient MySQL database, which
(D) Cartesian product (×)
practice is generally considered the best approach?
Ans (A) Using as many redundant tables as possible
(B) Projection (π) (B) Avoiding primary keys for simplicity
Projection (π) chooses particular columns (attributes) (C) Normalizing tables to reduce redundancy
from a relation, thereby reducing the schema of the (D) Selecting random field names for uniqueness
result. It does not remove rows based on any condition Ans
(C) Normalizing tables to reduce redundancy 1. r a. Opens file for writing, creates
Database normalization organizes attributes into logical file if it doesn’t exist
groupings to minimize duplications and anomalies. This
2. rb b. Opens file for reading in
practice ensures efficient storage, simpler data updates,
binary mode
and consistent data integrity. Redundant tables or
unclear naming conventions complicate maintenance 3. w c. Opens file for reading (default
and reduce overall database performance. mode)
4. wb d. Opens file for writing in
7. Arrange the following steps for creating a MySQL binary mode, creates file if
database in the correct chronological order: absent
1. Specify the desired database name
Options:
2. Establish a connection to the MySQL server
(A) 1-b, 2-c, 3-a, 4-d
3. Use the CREATE DATABASE command
(B) 1-c, 2-b, 3-d, 4-a
4. Check the newly created database
(C) 1-c, 2-b, 3-a, 4-d
(A) 1 → 2 → 3 → 4
(D) 1-d, 2-a, 3-b, 4-c
(B) 2 → 1 → 3 → 4
(C) 2 → 3 → 1 → 4 Ans
(D) 1 → 4 → 2 → 3 (C) 1-c, 2-b, 3-a, 4-d
Ans In Python, r is read mode by default, rb is read in binary,
w writes (creating the file if needed), and wb writes in
(B) 2 → 1 → 3 → 4
binary. These modes handle files differently, especially
First, you establish a connection to the MySQL server.
regarding how data is accessed, stored, or appended.
Next, you decide the name for your new database.
Then you run the CREATE DATABASE command to 10. Match the Relational Keys in Column A with their
create it. Finally, you verify the newly created database Definition in Column B:
using appropriate MySQL commands such as SHOW
DATABASES or USE statements. Column A Column B
1. Primary Key a. Can accept repeated
8. Order these historical developments in networking values, points to
evolution: primary key of another
1. ARPANET table
2. Introduction of Ethernet 2. Foreign Key b. Chosen candidate
3. Emergence of World Wide Web key used to uniquely
4. Widespread adoption of Wi-Fi identify records
(A) 1 → 2 → 3 → 4
3. Candidate Key c. Uniquely identifies
(B) 2 → 1 → 4 → 3
rows but not chosen as
(C) 1 → 3 → 2 → 4
primary key
(D) 2 → 4 → 1 → 3
4. Alternate Key d. Minimal set of
Ans attributes uniquely
(A) 1 → 2 → 3 → 4 identifying each tuple
The U.S. ARPANET project started in the late 1960s, Options:
followed by Ethernet’s invention in the 1970s. The (A) 1-b, 2-a, 3-d, 4-c
World Wide Web came into prominence in the early (B) 1-d, 2-c, 3-a, 4-b
1990s, and Wi-Fi began to see mainstream adoption in (C) 1-b, 2-d, 3-a, 4-c
the late 1990s and early 2000s. (D) 1-a, 2-b, 3-c, 4-d
9. Match the following Python File Modes in Column A Ans
with their Descriptions in Column B: (A) 1-b, 2-a, 3-d, 4-c
Column A Column B A primary key (b) is the chosen candidate key. A foreign
key (a) references a primary key in another table. A
candidate key (d) uniquely identifies each row. An
alternate key (c) is a candidate key not selected as the descending. WHERE (a) filters rows before grouping or
primary key. aggregation, limiting which rows get processed.
11. Match the following Data Communication Terms in 13. Match the following Exception Handling Terms in
Column A with their Meaning in Column B: Column A with their Description in Column B:
Column A Column B Column A Column B
1. Bandwidth a. Device converting digital 1. try a. Block containing code to
signals to analog and back handle exceptions
2. Modem b. Pathway capacity for data 2. except b. Block always executed,
transfer rate regardless of exception
3. Switch c. Directs data to correct 3. finally c. Block where exceptions
destination port in a network might be raised
4. Router d. Connects multiple devices, 4. raise d. Keyword to manually
forwarding data based on trigger an exception
MAC Options:
Options: (A) 1-c, 2-a, 3-b, 4-d
(A) 1-b, 2-a, 3-d, 4-c (B) 1-a, 2-c, 3-d, 4-b
(B) 1-a, 2-b, 3-c, 4-d (C) 1-b, 2-d, 3-a, 4-c
(C) 1-c, 2-d, 3-b, 4-a (D) 1-c, 2-d, 3-a, 4-b
(D) 1-d, 2-c, 3-a, 4-b Ans
Ans (A) 1-c, 2-a, 3-b, 4-d
(A) 1-b, 2-a, 3-d, 4-c In Python, try (c) designates the code block where
Bandwidth (b) is the channel capacity. A modem (a) exceptions could occur. except (a) catches exceptions.
converts between analog and digital signals. A switch finally (b) executes whether an exception happened
(d) forwards frames based on MAC addresses. A router or not. raise (d) explicitly triggers an exception for
(c) routes packets to specific networks or subnets, using handling specific conditions in the code.
IP addresses to determine best paths.
14. Consider the following statements about binary search:
12. Match the SQL Clauses/Statements in Column A with 1. The list must be sorted before searching.
their Function in Column B: 2. It repeatedly divides the list in halves.
3. It compares the target with every element.
Column A Column B
4. Worst-case performance is O(log n).
1. GROUP BY a. Limits records fetched Which combination of statements is correct?
based on a condition (A) 1, 2, 4 only
2. HAVING b. Filters grouped records (B) 2, 3, 4 only
3. ORDER BY c. Sorts query output (C) 1, 3 only
4. WHERE d. Aggregates rows based (D) 1, 2, 3, 4
on common values Ans
Options: (A) 1, 2, 4 only
(A) 1-d, 2-b, 3-c, 4-a Binary search requires a sorted list, repeatedly halves the
(B) 1-b, 2-d, 3-a, 4-c search space, and has a worst-case complexity of O(log
(C) 1-a, 2-c, 3-b, 4-d n). It does not compare the target with every element;
(D) 1-c, 2-a, 3-d, 4-b that is characteristic of linear search. Thus statements 1,
Ans 2, and 4 are correct.
(A) 1-d, 2-b, 3-c, 4-a 15. Evaluate the following statements about data files:
GROUP BY (d) groups rows by shared values in specified 1. A text file stores data in human-readable characters.
columns. HAVING (b) applies conditions on grouped 2. A binary file typically stores data in special formats.
data. ORDER BY (c) sorts results, typically ascending or 3. Opening a file in r mode overwrites its content.
4. Opening a file in w mode overwrites existing data. Bubble sort uses adjacent comparisons. Insertion sort
Which statements are correct? builds a sorted list by inserting each element into its
(A) 1, 2, and 4 only proper place. Selection sort typically swaps once per
(B) 2, 3, and 4 only pass, choosing the smallest element in the unsorted
(C) 1 and 2 only segment. Selection sort generally operates in O(n²) time
(D) 1, 2, 3, and 4 in average cases.
Ans 18. Consider these statements related to Python exceptions:
(A) 1, 2, and 4 only 1. All exceptions must be explicitly declared at the
Text files are human-readable, while binary files store beginning of a file.
data in non-textual formats. Opening a file in r mode 2. You can define custom exceptions with class
does not overwrite content; it only reads. Opening in definitions.
w mode overwrites existing data or creates a new file. 3. The `finally` block executes whether an exception
Therefore, statements 1, 2, and 4 are correct. occurs or not.
4. The `except` block will catch designated exceptions
16. Review these statements about computer networks: in a try block.
1. LAN is limited to a small geographic area. Which combination is correct?
2. WAN spans large areas, often countrywide or (A) 1, 3 only
global. (B) 2, 3, 4 only
3. A hub is a network device that intelligently routes (C) 1, 4 only
data. (D) 2, 3 only
4. A switch can segment a network by forwarding
based on MAC addresses. Ans
Which set is correct? (B) 2, 3, 4 only
(A) 1, 2, 4 only Python does not require exceptions to be declared
(B) 1, 3, 4 only at the beginning of the file. You can define your own
(C) 2, 3 only exceptions with custom classes, and `finally` executes
(D) 1, 2, 3, 4 unconditionally. The `except` block captures specified
Ans exceptions raised in the try block. Hence statements 2,
3, and 4 are correct.
(A) 1, 2, 4 only
LAN covers a small local area, WAN can extend globally, 19. Assertion (A) : A firewall monitors incoming and
and a switch forwards data based on MAC addresses. outgoing network traffic based on security rules.
A hub simply broadcasts signals to all ports without Reason (R) : Firewalls cannot be configured to block
intelligent routing; that is done by switches or routers. specific IP addresses.
Statements 1, 2, and 4 are accurate. (A) Both A and R are true, and R is the correct
explanation of A.
17. Analyze these statements about sorting: (B) Both A and R are true, but R is not the correct
1. Bubble sort compares adjacent elements repeatedly. explanation of A.
2. Insertion sort inserts each element into the correct (C) A is true, but R is false.
position in a growing sorted list. (D) A is false, but R is true.
3. Selection sort can swap an element only at the end
of each pass. Ans
4. Selection sort’s complexity is typically O(n²). (C) A is true, but R is false.
Which combination is correct? Firewalls do examine traffic based on rules, which
(A) 1, 2, 4 only often include blocking certain IP addresses or ports.
(B) 2, 3 only Therefore, the reason stating that firewalls cannot block
(C) 1, 3, 4 only specific IP addresses is false. Firewalls are configurable
(D) 1, 2, 3, 4 to block specific IPs, ports, or protocols.
Ans 20. Assertion (A) : In queues, the front pointer identifies
(D) 1, 2, 3, 4 where elements are removed.
(B) It forwards data packets between networks, choosing easily compromised, and disabling firewalls lowers
optimal paths defenses. Merely renaming the SSID without encryption
A router examines packets’ destination IP addresses and does not provide real security protection.
decides the most efficient path across interconnected
30. In Python, what happens if an exception is raised inside
networks. Unlike a hub or switch, a router can connect
different networks (e.g., LAN to WAN) and base a try block but there is no matching except block?
routing decisions on network protocols, not just signal (A) The program resolves the exception automatically
repetition. (B) The program terminates unless a finally block re-
throws it
27. Which queue variant allows insertion from both front (C) The program immediately terminates after the
and rear? exception
(A) Simple Queue (D) The exception is silently ignored
(B) Circular Queue Ans
(C) Priority Queue
(D) Deque (C) The program immediately terminates after the
exception
Ans If no matching except clause is found, the default
(D) Deque behavior is for Python to terminate execution and
A double-ended queue (deque) is a linear data structure print a traceback of the unhandled exception. A finally
permitting insertion and deletion from both ends. This block still executes, but it cannot fix the missing except
flexibility differs from a regular queue (FIFO), which scenario, so the program ends unless the exception is
typically inserts at the rear and removes from the front. otherwise handled.
Deques are useful in scenarios requiring bidirectional
31. Which of the following sorting algorithms finds the
queue operations.
minimum element in each pass and places it at the
28. What does the ROUND(number, digits) function do in beginning of the unsorted part?
MySQL if digits is set to 2? (A) Insertion Sort
(A) Rounds the number to 2 decimal places (B) Bubble Sort
(B) Produces integer division (C) Selection Sort
(C) Truncates all decimal digits (D) Merge Sort
(D) Returns NULL if number is negative Ans
Ans (C) Selection Sort
(A) Rounds the number to 2 decimal places Selection Sort locates the smallest element in the
MySQL’s ROUND function with a specific digits unsorted portion and swaps it with the first unsorted
parameter adjusts the number to that many decimal position, progressively building a sorted sublist at the
places. For instance, ROUND(123.4567, 2) yields array’s start. Bubble Sort repeatedly compares adjacent
123.46. It does not truncate beyond ignoring extra elements, Insertion Sort inserts elements into a sorted
decimals nor does it conditionally return NULL for sublist, and Merge Sort employs divide-and-conquer.
negative values.
32. Which is not a valid data type in MySQL?
29. Which of the following is generally the best approach to (A) INT
safeguard wireless networks? (B) VARCHAR
(A) Use no encryption but change the default SSID (C) BINARY_FLOAT
(B) Enable WEP encryption only (D) DATE
(C) Enable WPA2 or WPA3 security Ans
(D) Disable the firewall when connected to Wi-Fi
(C) BINARY_FLOAT
Ans MySQL commonly supports INT, VARCHAR, DATE,
(C) Enable WPA2 or WPA3 security and other data types. However, BINARY_FLOAT is
WPA2 and WPA3 are robust wireless security standards specific to some other database systems (like Oracle).
providing better encryption, making eavesdropping or MySQL may support FLOAT, DOUBLE, DECIMAL,
unauthorized access more difficult. WEP is outdated,
but BINARY_FLOAT is not a recognized built-in type 36. Which statement best differentiates a Switch from a
in standard MySQL distributions. Router in networking?
(A) Switches operate at the IP layer, while routers work
33. Which function in MySQL returns the current date and at the MAC layer
time? (B) Switches operate at the data link layer, while routers
(A) DATE() operate at the network layer
(B) NOW() (C) Both operate at the application layer
(C) DAYNAME() (D) Both function only at the physical layer
(D) MONTHNAME()
Ans
Ans
(B) Switches operate at the data link layer, while routers
(B) NOW() operate at the network layer
NOW() retrieves the current date and time in MySQL. Switches use MAC addresses at the data link layer to
DATE() extracts the date portion from a datetime, forward frames. Routers operate at the network layer,
DAYNAME() returns the weekday name for a given relying on IP addresses to direct packets across subnets
date, and MONTHNAME() returns the month name. or networks. This division of labor ensures efficient local
Thus, NOW() is the comprehensive function for both traffic handling versus broader network routing.
date and time.
37. Which Python module is commonly used for reading
34. Which statement correctly describes a foreign key in a and writing binary files with object serialization?
relational model? (A) csv
(A) It is a key that uniquely identifies records within its (B) os
own table (C) math
(B) It can only reference columns of type TEXT (D) pickle
(C) It references a primary key in another table to
establish relationships Ans
(D) It cannot be used to enforce referential integrity (D) pickle
Ans The `pickle` module serializes and deserializes Python
objects to and from binary files. It’s often used to
(C) It references a primary key in another table to preserve program objects across sessions. The `csv`
establish relationships module handles comma-separated text files, `os`
A foreign key enforces referential integrity by tying a provides operating-system-level functionality, and
column in one table to the primary key of another. It `math` handles mathematical functions.
ensures valid links between related rows and prevents
orphaned records or mismatched data across relational 38. Which measure of central tendency sums all data values
tables. and divides by the count?
(A) Mean
35. Which structure uses FIFO (First-In, First-Out) for data (B) Median
handling? (C) Mode
(A) Stack (D) Standard Deviation
(B) Queue
(C) Deque Ans
(D) Binary Tree (A) Mean
Ans The mean is computed by adding up all data points and
dividing by the number of those data points. Median is
(B) Queue the middle value when data is sorted, mode is the most
A queue processes elements in the order they arrive. The frequent value, and standard deviation measures data
first inserted item is the first one removed. This helps dispersion around the mean.
model real-world lines or waitlists where individuals
exit in the same order they entered. By contrast, a stack 39. Which best describes intrusion in network security?
uses LIFO, and a deque allows insertion/removal at both (A) Authorized access to system resources
ends. (B) Unauthorized attempts to access, manipulate, or
disable networks
following hardware crashes or other failures. Neglecting 47. Which Python mechanism ensures that file operations
logs or relying solely on memory endangers data handle exceptions gracefully?
integrity. (A) The `while` loop
(B) The `if-else` structure
45. Which concurrency concern is most relevant for (C) The `try-except` block
multiple librarians editing book details? (D) The `range` function
(A) Data duplication within the primary key
(B) Race conditions leading to inconsistent updates Ans
(C) Maintaining identical user sessions for everyone (C) The `try-except` block
(D) Creating unlimited read-only accounts The `try-except` structure in Python allows you to wrap
Ans file operations in a protective block. If an error such as
a missing file occurs, the corresponding `except` clause
(B) Race conditions leading to inconsistent updates catches and handles it. This prevents abrupt termination,
Concurrency control addresses the possibility of prompting graceful recovery and error messaging.
simultaneous edits overwriting one another. Proper
measures, such as locking or transaction isolation levels, 48. Which data structure ensures each enrollment request is
avoid conflicts that cause partial or conflicting updates. processed in the order it is received?
Race conditions are central concurrency concerns, (A) Stack
ensuring consistent, accurate data. (B) Queue
(C) Deque
Direction :Carefully read the case study provided and then (D) Tree
thoroughly answer the subsequent five questions.
Sanya is learning Python to automate administrative Ans
tasks for a student enrollment system. She needs to (B) Queue
parse large text files containing student records, convert A queue processes items on a first-in, first-out basis.
them into structured data, and insert these details into a Enrollment requests that arrive first are handled first,
MySQL database. She must handle exceptions gracefully ensuring fairness and sequential order. A stack reverses
when files are missing or corrupted, using a `try-except` order (LIFO), a deque permits operations at both ends,
block and custom error messages. Sanya also uses a queue and a tree does not strictly manage insertion order in a
to process bulk enrollment requests in the order they FIFO manner.
arrive. For optimal efficiency, she plans to implement
binary search for quickly verifying student IDs in a sorted 49. Which algorithm would Sanya use to quickly confirm if
list. Data privacy is important, so she enforces secure a student ID exists in a large, sorted list?
network protocols and sets up a firewall. Sanya’s next step (A) Linear Search
is to analyze system logs to detect unauthorized attempts (B) Hash Search
that might compromise student information. (C) Binary Search
(D) Bubble Sort
46. Which file approach would Sanya likely use if records are Ans
stored in plain characters, easy to read in a text editor?
(A) Binary File (C) Binary Search
(B) Text File Binary search splits a sorted list repeatedly, checking the
(C) Encrypted File midpoint to either continue left or right. This approach
(D) Image File operates in O(log n) time, outperforming linear search,
which checks every element. Sorting is a prerequisite
Ans for binary search, but once sorted, lookups become far
(B) Text File more efficient.
Text files store data using ASCII or Unicode characters,
50. Which network security measure can Sanya use to
making them human-readable and easily edited. Sanya
is parsing large text files, so they are neither binary nor protect student data from unauthorized external threats?
inherently encrypted. They can be opened and modified (A) Strictly use open Wi-Fi connections
with standard text editors, facilitating inspection. (B) Disable all forms of encryption
(C) Configure a firewall to block malicious traffic
(D) Share database credentials publicly
Ans
(C) Configure a firewall to block malicious traffic
A firewall inspects inbound and outbound data packets,
filtering harmful or suspicious traffic from reaching the
system. By configuring rules, Sanya can protect sensitive
student data from unauthorized access. Disabling
encryption or sharing credentials publicly compromises
security, while open Wi-Fi is also risky.
**************
PRACTICE PAPER 06
1. Which term describes a minimal set of attributes Selection helps narrow down data to those records
that uniquely identifies a tuple in a relation without satisfying certain predicates.
redundancy?
4. Which of the following is not a valid DML (Data
(A) Composite Key
(B) Candidate Key Manipulation Language) command in SQL?
(C) Foreign Key (A) INSERT
(D) Super Key (B) UPDATE
(C) DELETE
Ans (D) CREATE
(B) Candidate Key Ans
A candidate key is a minimal set of attributes that can
uniquely determine a tuple in a relation. It contains no (D) CREATE
unnecessary attributes, and from among the candidate CREATE is part of the Data Definition Language
keys, one is chosen as the primary key. Other candidate (DDL) used to create database objects like tables.
keys become alternate keys. INSERT, UPDATE, and DELETE belong to the Data
Manipulation Language (DML), focusing on changing
2. Which command in MySQL changes the structure of an data within existing tables rather than defining or
existing table, such as adding a new column? altering structures.
(A) SELECT
5. Which statement contrasts a primary key with an
(B) ALTER TABLE
(C) UPDATE alternate key?
(D) TRUNCATE TABLE (A) Both can remain NULL in some rows
(B) A primary key is a chosen candidate key, while an
Ans alternate key is a candidate key not chosen
(B) ALTER TABLE (C) Alternate keys must be composed of multiple
ALTER TABLE modifies an existing table’s structure, columns, while a primary key is single-column
allowing addition or removal of columns, and changes only
to column data types or constraints. SELECT is for data (D) They are identical in meaning and usage
retrieval, UPDATE is for altering rows, and TRUNCATE Ans
TABLE clears all data but keeps structure intact.
(B) A primary key is a chosen candidate key, while an
3. In relational algebra, which operation corresponds alternate key is a candidate key not chosen
to selecting rows from a table that meet a specific Among candidate keys in a table, one key is designated
condition? as the primary key. Any remaining candidate keys
(A) Projection become alternate keys. This distinction ensures only one
(B) Selection official primary key, but alternate keys can still uniquely
(C) Union identify rows if needed.
(D) Intersection
6. What is generally the best approach to handle
Ans concurrency in SQL databases?
(B) Selection (σ) (A) Disable transactions for speed
Selection (σ) filters rows based on a specified condition, (B) Use transaction isolation levels and locks
returning only the tuples that fulfill the condition. (C) Permit all concurrent writes freely without control
Projection (π) picks columns, while union and (D) Only allow a single user connection
intersection combine rows from multiple relations. Ans
(B) Use transaction isolation levels and locks 3. ROUND() c. Returns current system
Transaction isolation levels, combined with appropriate date and time
locking mechanisms, prevent conflicting data writes
4. NOW() d. Rounds a numeric
and maintain data consistency. Disabling transactions
value to specified
or allowing unregulated writes causes data conflicts.
decimals
Limiting to one user is impractical, so concurrency
controls are the optimal balance between safety and Options:
performance. (A) 1-b, 2-a, 3-d, 4-c
(B) 1-a, 2-b, 3-c, 4-d
7. Arrange these steps in correct order for Python (C) 1-b, 2-c, 3-a, 4-d
exception handling: (D) 1-d, 2-b, 3-a, 4-c
1. Code that might raise an exception
Ans
(A) 4 → 1 → 2 → 3
(B) 1 → 4 → 2 → 3 (A) 1-b, 2-a, 3-d, 4-c
(C) 2 → 4 → 1 → 3 LCASE() / LOWER() (b) converts to lowercase. MOD()
(D) 1 → 2 → 3 → 4 (a) yields a remainder. ROUND() (d) rounds numbers.
NOW() (c) fetches current date and time. These built-in
Ans
SQL functions facilitate text manipulation, arithmetic,
(A) 4 → 1 → 2 → 3 and date/time retrieval.
In Python, you write try to start the block (4), place the
code that may fail (1), specify except blocks (2), and 10. Match the following Network Topologies in Column A
optionally use a finally block (3) that runs regardless. with their Characteristic in Column B:
This sequence ensures errors can be caught and final Column A Column B
steps always executed.
1. Bus a. Every node connected
8. Order these processes involved in the flow of data from to every other node
one networked device to another: 2. Star b. Single backbone cable,
1. Data encapsulation with protocols terminators at ends
2. Routing to the destination network 3. Ring c. Central hub or switch
3. Physical transmission across medium in the middle
4. Application interprets received data 4. Mesh d. Each node connected
(A) 1 → 2 → 3 → 4 in a closed loop
(B) 1 → 3 → 2 → 4
Options:
(C) 3 → 1 → 2 → 4
(A) 1-a, 2-b, 3-c, 4-d
(D) 4 → 3 → 2 → 1
(B) 1-b, 2-c, 3-d, 4-a
Ans (C) 1-c, 2-a, 3-b, 4-d
(A) 1 → 2 → 3 → 4 (D) 1-b, 2-d, 3-a, 4-c
First, data is encapsulated with the necessary protocol Ans
headers. Next, the router determines the path to the
(B) 1-b, 2-c, 3-d, 4-a
destination. Then the bits are physically transmitted
In a bus topology (b), all devices connect to one
over cables or wireless. Finally, the receiving application
backbone cable with terminators. A star (c) has a central
interprets and processes the data.
hub. A ring (d) arranges nodes in a loop. Mesh (a)
9. Match the SQL Functions in Column A with their connects every node to every other node directly.
Purpose in Column B:
11. Match the Python Stack Operations in Column A with
Column A Column B their Description in Column B:
1. LCASE() / a. Returns remainder of
Column A Column B
LOWER() division
1. PUSH() a. Remove the top element
2. MOD() b. Converts a string to
lowercase
(B) 2, 3, 4 only 20. Assertion (A) : Deletion from a queue occurs at the
front pointer.
Reason (R) : In a queue, elements can be inserted and (B) Jump Search
removed from the same end. (C) Sequential Search (Linear Search)
(A) Both A and R are true, and R is the correct (D) Interpolation Search
explanation of A. Ans
(B) Both A and R are true, but R is not the correct
explanation of A. (C) Sequential Search (Linear Search)
(C) A is true, but R is false. Linear or sequential search checks each element one by
(D) A is false, but R is true. one until the target is found or the entire structure is
exhausted. Although straightforward, it can be time-
Ans consuming for large lists, making more sophisticated
(C) A is true, but R is false. algorithms like binary search preferable for sorted data.
A queue deletes elements from the front pointer,
24. In a Star topology, what happens if the central hub fails?
adhering to FIFO. However, standard queues insert and
remove from opposite ends: insertion at the rear and (A) Only half the nodes lose communication
removal at the front. Hence, R stating both operations (B) All network communication stops
occur at the same end is false. (C) The network reconfigures into a ring topology
(D) No effect on communication
21. Which statement accurately describes the purpose of a Ans
gateway in a network?
(A) It simply repeats signals within the same subnet (B) All network communication stops
(B) It connects networks using different protocols or In a star topology, every node connects to a central hub
architectures or switch. If that central device fails, there is no alternate
(C) It only filters broadcast traffic path for data to travel, causing the entire network to lose
(D) It is synonymous with a hub for local connections connectivity, because all data routes through the center
point.
Ans
25. Which of the following is not a recommended security
(B) It connects networks using different protocols or
architectures practice?
A gateway functions at higher layers, enabling data (A) Updating antivirus software regularly
communication between networks that might not (B) Clicking on suspicious email links
share the same protocol or architecture. Unlike simpler (C) Using firewalls to monitor traffic
devices like hubs or switches, gateways can translate (D) Maintaining strong, unique passwords
between different formats and facilitate cross-network Ans
interactions. (B) Clicking on suspicious email links
22. Which Python statement is used to create a user-defined Clicking on suspicious links is a common cause of
exception? malware and phishing attacks. Updating antivirus
(A) except MyError: software, configuring firewalls, and using robust
(B) class MyError(Exception): passwords are sound security measures. Users should
(C) raise SyntaxError always avoid risky links in unsolicited or suspicious
(D) def MyError(): emails to protect systems from compromise.
34. Why is data interpretation using mean, median, and 37. Which MySQL function extracts the month number
standard deviation important? from a date?
(A) It replaces the need for raw data collection (A) MONTH()
(B) It allows no insights into data distribution (B) MONTHNAME()
(C) It helps summarize and understand data variability (C) DAY()
(D) It invalidates data analysis (D) YEAR()
Ans Ans
(C) It helps summarize and understand data variability (A) MONTH()
Statistical measures like mean, median, and standard The MONTH() function returns a numeric month
deviation reveal central tendencies and dispersion within (1 to 12) from a valid date. MONTHNAME() returns
the data. They condense large sets into interpretable the textual month name, DAY() extracts the day of the
metrics, enabling quick insights into typical values and month, and YEAR() extracts the four-digit year value.
the spread of observations. They do not eliminate the These functions help dissect date fields in queries.
need for raw data but complement it.
38. Which of the following is a type of switching technique
35. In Python, which statement is used to deliberately in data communication?
generate an exception? (A) Circuit Switching
(A) continue (B) Loopback Switching
(B) pass (C) MAC Switching
(C) raise (D) Data Repetition Switching
(D) return Ans
Ans (A) Circuit Switching
(C) raise Common switching techniques include circuit
The `raise` statement explicitly triggers an exception switching, packet switching, and message switching.
in Python, allowing developers to create or propagate Circuit switching establishes a dedicated path for the
errors intentionally. The other statements are not duration of a communication session. Loopback and
associated with producing exceptions. `continue` data repetition switching are not standard recognized
and `pass` control flow in loops or placeholders, and switching methods, and MAC is an address concept, not
`return` exits a function. a switching technique.
36. Which statement best differentiates a stack from a 39. Which scenario describes an eavesdropping attack in
queue? network security?
(A) Both remove elements from the front (A) Injecting malicious code into a server
(B) A stack removes the most recently added element, (B) Flooding a network to cause Denial of Service
while a queue removes the least recently added (C) Secretly intercepting and reading transmitted data
element (D) Physically damaging network cables
(C) A queue can only hold numeric data, while a stack Ans
can hold any data type
(C) Secretly intercepting and reading transmitted data
(D) There is no difference; they are interchangeable
Eavesdropping attacks involve unauthorized monitoring
Ans of data traveling across a network. Attackers listen to
traffic seeking confidential information. Injecting code
is more akin to an injection or Trojan scenario, flooding
is a DoS, and damaging cables is physical sabotage, not restricting operations is impractical, while dropping
eavesdropping. tables for updates is destructive and not a concurrency
solution.
40. What is the best measure to prevent dictionary attacks
on user passwords? 42. Which stack-based feature is Raghav likely using to
(A) Using extremely short passwords for convenience support user undo/redo actions in the Python interface?
(B) Storing passwords in plain text on the server (A) FIFO queue
(C) Enforcing minimum complexity rules and salting/ (B) LIFO stack
hashing (C) Circular queue
(D) Publishing all user credentials for transparency (D) Priority queue
Ans Ans
(C) Enforcing minimum complexity rules and salting/ (B) LIFO stack
hashing Undo/redo operations typically rely on a Last-In, First-
Strong password complexity, combined with salted and Out structure. The most recent action is the first to be
hashed storage, prevents straightforward dictionary or reversed (undo). Once undone, reapplying it (redo) also
brute-force attacks. Short, simple passwords are easily follows LIFO logic. Queues, whether simple or circular,
guessed, and storing credentials in plain text or publicly do not naturally handle undo/redo sequences.
is extremely insecure, providing attackers a direct
43. Which of the following SQL functions would help
pathway to sensitive accounts.
Raghav find the average student score?
Direction :Carefully read the case study provided and then (A) MIN()
thoroughly answer the subsequent five questions. (B) MAX()
Raghav manages a computer lab where students practice (C) AVG()
SQL queries on a school database. He stores each student’s (D) COUNT()
progress in a MySQL table that tracks completed topics, Ans
scores, and timestamps. Users log in through a Python
interface, which logs attempts in a text file. Raghav (C) AVG()
implemented a stack to record user navigation for undo/ AVG() computes the arithmetic mean of numeric values
redo actions in the interface. Concurrency arises as in a given column. MIN() returns the lowest score,
multiple students access the same data simultaneously, MAX() returns the highest, and COUNT() gives the
so Raghav configured MySQL with transaction isolation number of rows. For measuring average performance,
levels to maintain data integrity. He also set up a AVG() is the relevant aggregate function.
local network with a firewall to prevent unauthorized 44. Which statement best describes the role of a firewall in
intrusions. To understand trends, Raghav applies basic Raghav’s local network?
statistical functions like AVG() and COUNT() on student (A) It amplifies signals across a wide area
scores, aiming to identify improvement areas and better (B) It performs environment cooling
allocate resources. (C) It inspects and filters incoming/outgoing data
41. Which MySQL feature ensures data consistency when (D) It automatically repairs corrupted files
multiple students modify the same table concurrently? Ans
(A) No concurrency controls (C) It inspects and filters incoming/outgoing data
(B) Transaction isolation levels A firewall monitors data packets entering or leaving
(C) Dropping the table for updates a network, blocking those deemed suspicious or
(D) Only read operations allowed unauthorized. It doesn’t handle physical amplification,
Ans cooling the environment, or file repairs. Firewalls are
(B) Transaction isolation levels network security barriers that protect systems from
Transaction isolation levels define how and when external threats.
changes become visible to concurrent transactions. 45. To store user login attempts in a text file from Python,
This mechanism preserves data consistency amid which mode is most suitable if Raghav wants to keep
simultaneous updates. Disabling concurrency or appending?
**************
PRACTICE PAPER 07
1. What is a primary key in a relational database? entire groups after they have been formed, effectively
(A) An attribute that can only store numeric values making it a second-level condition on grouped data.
(B) A unique identifier for each record
4. Which topology simplifies fault isolation but tends to
(C) A placeholder for missing data
(D) A composite of non-unique columns require more cabling?
(A) Bus
Ans (B) Star
(B) A unique identifier for each record (C) Ring
A primary key is a unique identifier, meaning it (D) Mesh
cannot repeat across rows in a table. It ensures that Ans
each record is distinctly identifiable. This constraint
prevents duplication and maintains data integrity, (B) Star
making it a critical concept in relational database design In a star topology, each device connects through a
for consistency and accuracy across different data central hub or switch, making it easier to isolate faults
management tasks. because each link is independent. However, it usually
needs more cabling than other topologies, increasing
2. Which SQL command removes all rows from a table but cost. Its simplicity in detecting network failures is
retains its structure? balanced by higher hardware expenses and complexity.
(A) DROP TABLE
5. Which of the following is NOT a standard Python file
(B) TRUNCATE
(C) DELETE access mode?
(D) ALTER TABLE (A) r+
(B) a+
Ans (C) x+
(B) TRUNCATE (D) w+
TRUNCATE is a Data Definition Language command Ans
that quickly deletes all records from a table but preserves
its schema. It is typically faster than DELETE when (C) x+
removing every row, because it deallocates data pages Python commonly supports ‘r+’, ‘w+’, and ‘a+’ for
directly. This approach is practical for resetting a table read-update, write-update, and append-update modes.
while maintaining its structural design and integrity. Although ‘x’ is used to open a file exclusively for creation,
‘x+’ is not recognized as a typical mode in most Python
3. Which clause in MySQL is applied to rows before versions. This underscores the importance of using valid
grouping occurs? modes and ensuring correctness when handling files.
(A) WHERE
6. Arrange the steps for pushing an element onto a stack
(B) HAVING
(C) GROUP BY in correct order:
(D) ORDER BY 1. Increment top pointer
2. Place the new element at the top position
Ans 3. Check for stack overflow
(A) WHERE 4. Input the new element
The WHERE clause filters rows before the GROUP BY (A) 3,4,1,2
operation, deciding which rows actually form groups. (B) 3,1,4,2
Rows that fail the WHERE condition never become part (C) 4,3,1,2
of any group. By contrast, the HAVING clause filters (D) 1,2,3,4
Ans Ans
(A) 3,4,1,2 (A) Bubble Sort
Before placing a new element, you check for overflow Bubble Sort repeatedly traverses the array, comparing
to ensure the stack isn’t full. Then you input the data and swapping neighboring items when they are
to push. Afterward, you increment the top pointer misordered. This cycle continues until no swaps occur,
to allocate space for the incoming item. Finally, the indicating a sorted array. Though simple, it is notably
element goes to the updated top location, completing slower than more advanced algorithms. Its direct
the push process successfully. mechanism makes it easy to understand but inefficient
for large datasets overall.
7. Assertion (A) : A queue uses First-In-First-Out (FIFO)
order. 10. Which measure of central tendency is most sensitive to
Reason (R) : A queue removes items from the end and outliers?
inserts at the front. (A) Mean
(A) Both A and R are true, and R is the correct (B) Median
explanation. (C) Mode
(B) Both A and R are true, but R is not the correct (D) Harmonic mean
explanation. Ans
(C) A is true, R is false.
(D) A is false, R is true. (A) Mean
The mean incorporates all data points equally, so an
Ans extremely large or small value shifts it disproportionately.
(C) A is true, R is false In contrast, the median is determined by position, and
A queue enforces FIFO by removing elements from the the mode reflects the most frequent value. Consequently,
front and inserting them at the rear, ensuring earlier large or anomalous observations heavily impact the
enqueued items exit first. The assertion is correct, but mean, making it more sensitive to outliers than other
the reason is reversed, describing the opposite positions measures.
for insertion and removal. Hence, the statement about
11. Match each SQL statement in Column A with its
order is true, whereas its rationale is false.
primary function in Column B:
8. Which data structure offers efficient searching by Column A Column B
halving the search space repeatedly? 1. CREATE P. Modifies existing
(A) Stack TABLE records
(B) Queue
2. SELECT Q. Removes an entire
(C) Linked List
table
(D) Binary Search Tree
3. UPDATE R. Builds a new table
Ans
4. DROP TABLE S. Retrieves data
(D) Binary Search Tree Options:
A binary search tree allows O(log n) average-time (A) 1→R, 2→S, 3→P, 4→Q
lookups, provided it is balanced. Each comparison (B) 1→S, 2→R, 3→Q, 4→P
narrows the search to a left or right subtree, effectively (C) 1→Q, 2→P, 3→S, 4→R
halving the space. This structure significantly (D) 1→P, 2→Q, 3→R, 4→S
outperforms linear searches, especially for larger
Ans
datasets, since it pinpoints targets faster by leveraging
hierarchical ordering of data. (A) 1→R, 2→S, 3→P, 4→Q
CREATE TABLE (1) establishes a new table structure
9. Which sorting method compares adjacent elements and (R), SELECT (2) fetches or retrieves data (S), UPDATE
swaps them if they are out of order? (3) modifies existing table entries (P), and DROP
(A) Bubble Sort TABLE (4) eliminates the table itself (Q). Each statement
(B) Selection Sort belongs to different SQL categories but collectively
(C) Insertion Sort manages table creation, data querying, modification,
(D) Merge Sort and removal.
12. Which of the following are valid Python file access efficiently and ensures data reaches correct destinations
modes? across diverse networks.
1. r+
15. Which data structure is best for implementing a First-
2. w++
3. a+ In-First-Out buffer system?
4. x (A) Stack
(A) 1 and 2 only (B) Queue
(B) 1, 3, and 4 (C) BST
(C) 2 and 4 only (D) Linked list (circular)
(D) 1 and 3 only Ans
Ans (B) Queue
(B) 1, 3, and 4 A queue is ideal for FIFO operations because it ensures
Mode ‘r+’ opens a file for both reading and writing, that the earliest inserted item is the earliest one removed.
‘a+’ allows reading and appending, and ‘x’ creates a In buffering scenarios, items arrive in order and must
file exclusively if it does not already exist. The double- be served in the same order. Thus, inserting at one end
plus variant ‘w++’ is not a standard mode. Python’s (rear) and removing from the other (front) preserves
flexibility with file modes ensures precise operations the sequence.
when modifying existing files or creating new ones. 16. Which MySQL clause helps filter aggregated results
13. Which concept represents the time complexity after grouping?
classification for algorithms? (A) WHERE
(A) Big-O notation (B) HAVING
(B) ASCII code (C) ORDER BY
(C) ASCII value (D) UNION
(D) Left outer join Ans
Ans (B) HAVING
(A) Big-O notation HAVING operates on groups formed by GROUP BY,
Big-O notation categorizes an algorithm’s performance filtering entire groups that don’t satisfy a specified
based on input size growth. It captures worst-case or condition. In contrast, WHERE is applied before rows
average-case scenarios (such as O(n^2) or O(log n)) to are grouped. For instance, you might group records
evaluate efficiency. Programmers use Big-O to compare by department and then use HAVING to exclude
and choose optimal solutions. This theoretical measure departments whose total sales do not exceed a certain
helps forecast behavior under varying sizes, informing threshold.
suitable data structure choices. 17. Match each networking term (Column A) with its
14. Which network device routes data packets between description (Column B):
different networks and directs traffic? Column A Column B
(A) Hub 1. MAC Address P. A unique physical
(B) Switch identifier for a network
(C) Router interface
(D) Repeater
2. IP Address Q. Enables data
Ans transmission between
(C) Router different networks
A router examines incoming data packets, determining 3. Switch R. Logical address for
where they should travel based on IP addresses. Unlike device identification on
a switch, which operates at the local network level, a network
a router connects multiple networks and can apply 4. Gateway S. Forwards data to
routing protocols. This pivotal function directs traffic correct devices within
a LAN
(B) It is efficient for large, unsorted datasets 31. Which statements about Python’s pickle module are
(C) It repeatedly passes through the list accurate?
(D) It can detect a sorted list before completing all 1. It serializes Python objects
passes 2. It stores data in human-readable text format
Ans 3. It can deserialize back into Python objects
4. It is used exclusively for JSON
(B) It is efficient for large, unsorted datasets 5. It works with binary file handling
Bubble Sort compares neighboring items, swapping (A) 1, 3, and 5
them if they’re misordered, and can terminate early (B) 1, 2, and 4
if no swaps occur in a pass (indicating completion). (C) 2, 3, and 5
However, it is generally inefficient for sizable, randomly (D) 1, 4, and 5
ordered data. Time complexity worsens significantly as
dataset size increases, making advanced methods like Ans
Merge Sort more suitable. (A) 1, 3, and 5
Pickle serializes Python objects (1) into a binary
29. Assertion (A) : The HAVING clause in SQL filters representation, which is not human-readable
records individually before grouping. (disqualifying statement 2). It can also recreate objects
Reason (R) : HAVING works on group results, typically (3) from that serialized data. JSON usage (4) is separate
used alongside GROUP BY. from pickle’s binary format. Consequently, it works with
(A) Both A and R are true, and R is the correct binary file operations (5), making (1), (3), and (5) the
explanation. correct statements.
(B) Both A and R are true, but R is not the correct
explanation. 32. Which Python exception arises if you attempt to access
(C) A is true, R is false. a list index beyond its valid range?
(D) A is false, R is true. (A) NameError
Ans (B) IndexError
(C) OverflowError
(D) A is false, R is true (D) IOError
HAVING applies conditions to aggregated group
results after GROUP BY. The assertion is false because Ans
it states HAVING filters rows before grouping, which is (B) IndexError
actually the WHERE clause’s job. The reason is correct: IndexError is thrown when code requests a list element
HAVING is used after grouping, removing entire groups at a position outside the available indices. For example,
that fail specified conditions, often used with aggregate accessing my_list[10] in a list of length 5 triggers
functions. IndexError. This alerts the programmer that the index
is invalid, preventing silent failures or unpredictable
30. Which structure is more suitable for breadth-first behavior during list manipulations in Python.
traversal tasks, such as simulating a print queue?
(A) Stack 33. Which function returns the length of a string in MySQL?
(B) Queue (A) LENGTH()
(C) Linked List (B) MOD()
(D) Tree (C) INSTR()
Ans (D) MID()
(S). Each device operates at distinct layers to manage availability. She also applies normal forms to minimize
traffic flow. anomalies. Through careful table design, Priya fosters
efficient data retrieval and maintains accurate records of
39. Which statements are true about DDL commands in borrowing activities. To ensure reliability, she occasionally
SQL? performs backup and recovery tests using MySQL utilities.
1. They create or modify table structures
2. They query data from tables 41. Which attribute ensures each book entry remains
3. They include CREATE, ALTER, DROP uniquely identifiable?
4. They handle transaction control like COMMIT (A) Foreign key
(A) 1 and 2 (B) Primary key
(B) 1 and 3 (C) INDEX
(C) 2 and 4 (D) CHECK constraint
(D) 1, 3, and 4 Ans
Ans (B) Primary key
(B) 1 and 3 A primary key uniquely tags each row, guaranteeing no
Data Definition Language (DDL) commands, such duplication across book records. In Priya’s books table,
as CREATE, ALTER, and DROP, define or modify book_id is the primary key, letting the system identify
database schema elements (1 and 3). Querying tables each entry independently. Unlike indexes or foreign
uses SELECT, a DQL command, and COMMIT belongs keys, the primary key enforces uniqueness by default
to transaction control statements (TCL). DDL changes and underpins reliable linking with other related tables.
structures, not the data itself, ensuring the integrity and
42. Why did Priya add indexes to certain columns, such as
layout of the database.
title?
40. Which measure describes how data varies around the (A) To create extra duplicates
mean? (B) To speed up searches
(A) Mean (C) To remove constraints
(B) Mode (D) To export data
(C) Standard Deviation Ans
(D) Median
(B) To speed up searches
Ans Indexes function like reference maps, helping MySQL
(C) Standard Deviation locate rows swiftly by bypassing full-table scans. Since
Standard Deviation shows the average distance of title is frequently used in lookups, indexing that column
data points from the mean, reflecting how spread can dramatically improve query performance. Although
out or clustered they are. A large value indicates wide indexes consume storage space, their benefit lies in
variability, whereas a small value suggests the data is quicker data retrieval, especially in libraries where
tightly packed around the average. It’s a fundamental searching by title is common.
metric for analyzing dispersion in statistics.
43. Which type of constraint prevents empty entries for
Direction :Carefully read the case study provided and then critical fields like title?
thoroughly answer the subsequent five questions. (A) UNIQUE
Priya manages a small library database using MySQL. She (B) FOREIGN KEY
created separate tables for books, authors, and borrowers. (C) NOT NULL
The books table includes fields like book_id (primary (D) DEFAULT
key), title, and publication_date. By applying foreign Ans
keys, she links each book to its author in the authors
table. Additionally, Priya sets NOT NULL and UNIQUE (C) NOT NULL
constraints to keep data consistent and avoid duplicates. NOT NULL disallows leaving essential columns
She uses indexes on frequently searched columns—like blank, ensuring that each book record includes a valid
title—to accelerate lookups. When borrowers check title. Empty or missing fields degrade data quality by
out books, Priya updates the records promptly to reflect hampering searches and leading to incomplete entries.
By enforcing NOT NULL, Priya secures meaningful
content in critical columns, sustaining consistent unifies robust file handling with efficient data structures.
recordkeeping and reliable database queries.
46. Why does Arun use try-except blocks in his file
44. What is the main advantage of enforcing normal forms operations?
in Priya’s schema? (A) To speed up CPU cycles
(A) Additional redundancy (B) To automatically fix data errors
(B) Simplified data anomalies (C) To handle runtime issues without halting the
(C) Less duplication and improved consistency program
(D) Random table structures (D) To overwrite existing files unconditionally
Ans Ans
(C) Less duplication and improved consistency (C) To handle runtime issues without halting the
Normalization systematically organizes data into well- program
structured tables, minimizing repeated information and The try-except construct catches errors like missing
inconsistency. By decomposing large tables into focused files or read/write failures, preventing immediate
ones linked by keys, anomalies like update or insertion program termination. Arun’s application can then
errors are significantly reduced. Priya’s adherence to display meaningful messages or create new files if
normal forms thus maintains data integrity, making the needed. This approach protects user data from abrupt
schema cleaner and more manageable over time. crashes, ensuring stable operation and allowing graceful
handling of problems during file input/output routines.
45. Which best describes Priya’s reason for performing
backup and recovery tests? 47. Which data structure does Arun use to process
(A) To deliberately lose data subscription requests in order of arrival?
(B) To disregard data corruption (A) Stack
(C) To validate readiness for data loss events (B) Queue
(D) To slow down the database (C) Dictionary
Ans (D) Tree
Direction :Carefully read the case study provided and then 48. How do custom exceptions help Arun guide users to
thoroughly answer the subsequent five questions. correct file format errors?
Arun built a Python application to handle membership (A) By hiding all error details
data for a school’s sports club. He keeps personal details (B) By automatically deleting corrupted files
in text files, while subscription payments and renewal (C) By providing domain-specific error messages
logs are stored in binary files for quicker access. To (D) By preventing any code execution
prevent unexpected crashes, he employs try-except blocks Ans
whenever reading or writing these files. If a file is missing,
the program automatically prompts the user to create it. (C) By providing domain-specific error messages
By using custom exceptions, Arun identifies specific file Custom exceptions let Arun separate general Python
format errors, guiding users to correct them. He also issues from membership-related format problems.
implemented a queue structure to track subscription When his program encounters malformed data, it raises
requests, ensuring the earliest applicant is processed first. a tailored exception that clearly describes the situation.
For advanced analysis, he occasionally stacks the most This specificity allows him to prompt users about
recent activities in memory for instant lookups. This setup corrective steps, such as reformatting the file, without
resorting to vague or generic error text.
**************
PRACTICE PAPER 08
1. Which key in a relational table can reference the primary failing the specified criterion. In contrast, WHERE
key of another table? filters individual rows before grouping happens. Thus,
(A) Alternate Key if you want to refine which sums or counts are included,
(B) Foreign Key you attach conditions in HAVING instead of WHERE.
(C) Candidate Key
4. Which network topology provides redundant paths at
(D) Composite Key
the cost of more cabling and complexity?
Ans (A) Star
(B) Foreign Key (B) Bus
A foreign key enforces referential integrity by linking (C) Mesh
one table’s column to another table’s primary key. This (D) Ring
relationship ensures valid references across tables, Ans
preventing orphaned records. Unlike alternate or
candidate keys, foreign keys specifically connect distinct (C) Mesh
relations, allowing data consistency and meaningful In a mesh topology, each node can connect to multiple
cross-referencing within the database’s relational other nodes, yielding redundant communication routes
framework. that enhance reliability. If one path fails, traffic can be
rerouted through alternate links. The primary drawback
2. Which SQL command permanently deletes both the is higher cabling demands and network complexity,
table data and its structure? which often suits specialized or critical environments
(A) DELETE needing robust fault tolerance.
(B) DROP TABLE
5. Which is NOT a valid Python exception category?
(C) TRUNCATE
(D) UPDATE (A) ValueError
(B) OSError
Ans (C) KeyError
(B) DROP TABLE (D) FormatError
DROP TABLE eliminates the table entirely, including its Ans
data and definition. TRUNCATE only clears data while
preserving structure, and DELETE removes rows but (D) FormatError
leaves both structure and constraints. DROP TABLE Python includes ValueError for improper values,
is thus the most drastic removal method, effectively OSError for operating system problems like file
discarding all associated objects like indexes or triggers handling, and KeyError for missing dictionary entries.
linked to that table. However, there is no built-in FormatError exception.
Developers usually raise ValueError or TypeError
3. In MySQL, which clause filters groups after aggregation? for formatting issues. Understanding actual built-in
(A) WHERE exceptions helps produce clearer error messages and
(B) SELECT catch specific problems effectively.
(C) HAVING
6. Arrange the steps for popping an element from a stack:
(D) ORDER BY
1. Check if stack is empty
Ans 2. Retrieve the top element
(C) HAVING 3. Decrement the top pointer
The HAVING clause applies a condition to aggregated 4. Return the removed element
groups formed by GROUP BY, discarding entire groups (A) 4,3,2,1
12. Which statements are true about Python’s open() 15. Which data structure is best for implementing a call
function? stack in most programming languages?
1. It can open files in read or write mode (A) Queue
2. It automatically closes files (B) Stack
3. It supports text and binary modes (C) Circular Linked List
4. It raises an exception if the file fails to open (D) Binary Search Tree
(A) 1, 2, and 3 Ans
(B) 1, 3, and 4
(C) 2, 3, and 4 (B) Stack
(D) 1, 2, and 4 Function calls follow Last-In-First-Out semantics. The
most recently called function is the first to complete
Ans and return. This ordering naturally suits stack behavior,
(B) 1, 3, and 4 pushing call frames onto the top and popping them after
Python’s open() can open files in read or write mode execution. Queues do not respect this LIFO mechanism,
(1), supports text (default) and binary modes (3), and and trees or linked lists lack direct LIFO enforcement.
raises exceptions if it cannot access the file (4). However,
16. Which MySQL clause arranges query results in
it does not auto-close files unless used with a context
manager (with statement). Hence, statement 2 is not ascending or descending order?
inherently correct. (A) WHERE
(B) ORDER BY
13. Which notation describes the upper bound of an (C) GROUP BY
algorithm’s running time? (D) HAVING
(A) Ω (Omega) notation Ans
(B) Big-O notation
(C) Big-Theta notation (B) ORDER BY
(D) Asymptotic difference ORDER BY sorts the result set in ascending (ASC)
or descending (DESC) order based on one or more
Ans columns. It’s typically appended at the end of the
(B) Big-O notation SELECT statement. GROUP BY arranges rows by
Big-O notation focuses on worst-case scenarios, groups, HAVING filters those groups, and WHERE
illustrating how runtime or space consumption scales screens individual rows before grouping or ordering
with input size. For instance, O(n²) denotes that runtime occurs.
grows proportionally to the square of n. Ω covers lower
17. Match each network type (Column A) with its typical
bounds, while Θ covers tight bounds. Big-O remains
the standard for expressing upper-limit performance scope (Column B):
constraints. Column A Column B
14. Which device splits a network into separate collision 1. LAN P. Covers large geographic
domains but not necessarily into separate networks? areas, connecting multiple
(A) Repeater cities or countries
(B) Hub 2. WAN Q. Connects devices in a
(C) Switch small, personal range (e.g.,
(D) Router Bluetooth)
Ans 3. MAN R. Spans a city or metropolitan
area
(C) Switch
4. PAN S. Covers a limited area like a
A switch operates at the Data Link layer (Layer 2) and
home, office, or campus
segments the network into distinct collision domains,
reducing data collisions. However, it does not inherently Options:
separate broadcast domains. Routers (Layer 3) divide (A) 1→P, 2→S, 3→Q, 4→R
networks at the IP level. Hubs amplify collisions, and (B) 1→S, 2→P, 3→R, 4→Q
repeaters merely boost signals without domain isolation. (C) 1→Q, 2→R, 3→S, 4→P
a text function (P), extracting a substring. DAY() (4) is a JOIN or SELECT operation. Therefore, (1), (3), and (4)
date function (Q) that returns the day portion of a date. define PROJECTION accurately.
23. Which search method is simpler but less efficient for 26. Which function returns the month name from a date in
large, unsorted data sets? MySQL?
(A) Binary Search (A) MONTH()
(B) Linear Search (B) MONTHNAME()
(C) Depth-First Search (C) DAYNAME()
(D) Interpolation Search (D) YEAR()
Ans Ans
(B) Linear Search (B) MONTHNAME()
Linear search compares each element in turn until MONTHNAME() extracts the textual month name
it finds a match or exhausts the list. Though easy to (e.g., ‘March’) from a date field. By contrast, MONTH()
implement and requiring no sorting, it grows more yields a numeric value (3 for March), DAYNAME()
time-consuming for large data sets. Techniques like returns the weekday name, and YEAR() gives the four-
binary or interpolation search can be far faster when the digit year. MONTHNAME() is particularly helpful
collection is structured or sorted. for generating user-friendly reports, labels, or logs
requiring readable month designations.
24. Which data structure naturally implements recursion
call frames in most programming languages? 27. Which topology links all devices to a single central
(A) Queue cable?
(B) Stack (A) Bus
(C) Tree (B) Star
(D) Heap (C) Mesh
Ans (D) Tree
25. Which statements accurately describe relational 28. Which is NOT a property of Selection Sort?
algebra’s PROJECTION operation? (A) Finds minimum and places it at sorted region’s end
1. It selects certain columns of a relation (B) Performs fewer swaps than Bubble Sort
2. It merges rows based on conditions (C) Has an O(n²) time complexity
3. It is denoted by the Greek letter π (D) Suitable for small datasets, but slower for large ones
4. It is a unary operation Ans
(A) 1, 2, and 3
(B) 1, 3, and 4 (A) Finds minimum and places it at sorted region’s end
(C) 2, 3, and 4 Selection Sort repeatedly locates the smallest element in
(D) 1 and 2 only the unsorted portion and moves it to the sorted portion’s
beginning, not the end. It does feature fewer total swaps
Ans than Bubble Sort, though it remains O(n²). Hence, (A)
(B) 1, 3, and 4 is incorrect, because the minimal element is placed at
PROJECTION picks specific attributes (columns) from the start of the sorted segment.
a relation (statement 1) and is written symbolically as
29. Assertion (A) : Grouping data by columns in MySQL
π (3). It operates on one relation (4), making it unary.
Merging rows based on a condition (2) is more akin to a uses GROUP BY.
Expand Your Reach: Your readers can share these PDFs on other platforms, helping your
influence grow exponentially.
Still not convinced? Ask us how, and we’ll walk you through exactly how it works.
Best of all: It’s completely free—no hidden charges.
Reason (R) : ORDER BY sorts rows in ascending or incorrect). The finally clause (3) executes whether or
descending order by default. not an exception arises, ensuring cleanup code runs.
(A) Both A and R are true, and R is the correct Custom exceptions can be raised (4), and else (5) runs
explanation. exclusively if the try block produces no errors. Hence,
(B) Both A and R are true, but R is not the correct (1), (3), (4), (5) are correct.
explanation.
32. Which function in MySQL counts the number of rows
(C) A is true, R is false.
(D) A is false, R is true. returned by a query?
(A) SUM()
Ans (B) COUNT()
(B) Both A and R are true, but R is not the correct (C) MAX()
explanation (D) LENGTH()
GROUP BY clusters rows based on shared column Ans
values, while ORDER BY arranges rows by specified
columns. Although both statements are accurate, (B) COUNT()
sorting data doesn’t explain grouping’s purpose, which COUNT() returns how many rows match a particular
is to produce aggregates per group. Thus, (B) applies: query condition. For instance, COUNT(*) tallies all
both are correct, but the reason does not explain the rows, whereas COUNT(column_name) omits NULL
assertion. entries in that column. SUM() aggregates numeric
values, MAX() finds the highest value, and LENGTH()
30. Which data structure is more appropriate for a printer measures string size, so COUNT() alone totals the
queue scenario? number of resulting rows.
(A) Stack
33. Which function in MySQL converts all letters of a given
(B) Queue
(C) Linked List string to uppercase?
(D) Heap (A) LCASE()
(B) UCASE()
Ans (C) MID()
(B) Queue (D) RTRIM()
Printers process jobs in the order they arrive, removing Ans
the earliest submitted document first. A queue’s First-
In-First-Out paradigm naturally matches this approach. (B) UCASE()
By contrast, a stack retrieves the last item placed on top, UCASE(), also available as UPPER(), transforms
reversing the submission sequence. Hence, a queue best each character in a string to uppercase. For instance,
simulates a real-world printer job scheduling workflow. UCASE(‘abc’) yields ‘ABC’. LCASE() or LOWER() does
the inverse, MID() extracts substrings, and RTRIM()
31. Which statements about Python’s exception handling removes trailing whitespace. UCASE() helps normalize
are correct? text data for consistent comparisons or display in many
1. It uses try-except blocks database applications.
2. The except block only catches FileNotFoundError
34. Match each Python file handling method (Column A)
3. finally executes regardless of exceptions
4. Custom exceptions can be raised with its description (Column B):
5. else runs if no exception occurs Column A Column B
(A) 1, 3, 4, and 5 1. close() P. Writes a string to the
(B) 1, 2, 3, and 5 file
(C) 2, 4, and 5 only
2. readline() Q. Moves the file pointer
(D) 1, 2, and 4 only
to a specified position
Ans 3. write() R. Reads a single line from
(A) 1, 3, 4, and 5 the file
Python’s try-except blocks (1) capture various 4. seek() S. Terminates the file
exceptions, not just FileNotFoundError (making 2 interface
A foreign key enforces referential integrity by By wrapping file operations in a try-except block, Karan
compelling the items table to map valid supplier intercepts FileNotFoundError. If the requested file is
identifiers. If a supplier row is removed, the database absent, his program notifies the user and can create
prevents orphaned items unless explicitly configured or redirect to the correct file. This proactive handling
for cascading. This design preserves correctness, maintains application stability, avoiding abrupt
guaranteeing any supplier_id in the items table matches termination and improving overall user experience
an existing, legitimate supplier record. when dealing with unexpected file paths.
45. Why does Sneha schedule regular backups of her 47. Which structure is ideal for retrieving the most recently
database? modified registration entry first?
(A) To intentionally corrupt data (A) Queue
(B) To reduce storage usage (B) Stack
(C) To restore information in case of losses (C) Linked List
(D) To eliminate transaction logs (D) Dictionary
Ans Ans
(C) To restore information in case of losses (B) Stack
Scheduled backups protect against unexpected data A stack implements Last-In-First-Out access, which is
loss from hardware failures, software bugs, or user perfect for reversing recent changes promptly. Pushing
mistakes. By keeping current copies of her inventory new modifications onto the stack lets Karan pop them
records, Sneha can recover quickly, preserving her to undo the latest entry first. Queues enforce FIFO,
store’s transactional history and supplier information. so they’re unsuitable for immediate rollback tasks,
Without backups, accidental deletions or crashes could whereas a stack efficiently tracks and reverts recent
irreversibly destroy critical data on stock or orders. modifications.
Direction :Carefully read the case study provided and then 48. Why does Karan employ a queue for older records?
thoroughly answer the subsequent five questions. (A) It deletes data in reverse order
Karan programmed a Python tool to handle event (B) It sorts records alphabetically
registrations for a college festival. He stores participant (C) It processes them on a first-come, first-served basis
details, including names and contact numbers, in text (D) It combines multiple file operations automatically
files. For high-volume data—such as transaction logs— Ans
he uses binary files to boost read-write efficiency. When
reading files, Karan applies try-except blocks to catch (C) It processes them on a first-come, first-served basis
FileNotFoundError and prompts users to either create A queue follows FIFO logic, ensuring the earliest
or locate the missing file. Additionally, he uses a stack to record is handled first. Karan wants older registration
manage recently modified registration entries for quick data to be processed in the order it arrived, so a queue
rollback if an error arises. For older registration records is the natural choice. This setup preserves fairness and
that must be processed in the order received, Karan relies sequence, particularly for structured tasks like archiving
on a queue. By pairing robust file handling with suitable or scheduled event confirmations.
data structures, the application prevents data corruption, 49. How do binary files enhance handling of large log data
streamlines user input, and makes real-time editing or in Karan’s application?
retrieval possible. (A) They convert data to plain text
46. How does Karan safeguard against a missing file (B) They provide slower access times
scenario? (C) They store and read data more efficiently
(A) He ignores the error (D) They remove the need for user input
(B) He forces the program to crash Ans
(C) He catches FileNotFoundError using try-except (C) They store and read data more efficiently
(D) He disables file creation Binary files represent data in a compact, machine-
Ans friendly format, cutting down on overhead from text
(C) He catches FileNotFoundError using try-except encoding or parsing. For extensive logs, this format
can accelerate input/output operations, especially when
**************
PRACTICE PAPER 09
1. Which key in a relational database uniquely identifies (B) A database system provides better data consistency
each row in a table? (A) Foreign key and integrity than a file system
(B) Candidate key Unlike traditional file systems, database systems
(C) Primary key maintain robust mechanisms to ensure consistency,
(D) Alternate key reduce redundancy, and enforce integrity constraints.
Ans They organize data in relational structures and use
concurrency controls, providing more reliable data
(C) Primary key handling. These features strengthen overall reliability
A primary key is selected from candidate keys to and data correctness compared to simple file-based
uniquely identify each record in a relation. It prevents storage.
duplicate entries and ensures every row is identifiable.
This maintains data integrity by guaranteeing that no 4. Which SQL command does NOT belong to the Data
two rows have the same primary key value, making each Manipulation Language (DML) category? (A) INSERT
row unique in the table. (B) UPDATE
(C) DELETE
2. In a relational model, which of the following is NOT (D) CREATE
considered a valid operation of relational algebra? (A)
Selection Ans
(B) Intersection (D) CREATE
(C) Projection DML commands include INSERT, UPDATE, and
(D) Encryption DELETE, which change or query the data within tables.
Ans CREATE belongs to the Data Definition Language
(DDL) group, which structures database schemas and
(D) Encryption objects. DDL commands define or modify the structure
Relational algebra includes operations such as selection, of the database rather than manipulating table contents.
projection, union, set difference, intersection, and
Cartesian product. Encryption, while crucial for data 5. Match the following MySQL data types with their
security, is not part of the fundamental relational descriptions:
algebra operations. It is a separate process for securing
Column A Column B
data rather than manipulating or querying relational
data sets. 1. INT a. Stores large textual data
2. VARCHAR b. Stores numeric integers
3. Which statement best explains the difference between 3. DATE c. Stores variable-length strings
a database system and a file system? (A) A file system
4. TEXT d. Stores calendar values
supports multiple users simultaneously, whereas a
database system cannot Options:
(B) A database system provides better data consistency (A) 1-b, 2-c, 3-a, 4-d
and integrity than a file system (B) 1-b, 2-c, 3-d, 4-a
(C) A file system avoids redundant data completely, but (C) 1-d, 2-a, 3-b, 4-c
a database system does not (D) 1-c, 2-d, 3-a, 4-b
(D) A database system lacks concurrency, unlike a file Ans
system
(B) 1-b, 2-c, 3-d, 4-a
Ans In MySQL, INT is for integer storage, VARCHAR is for
variable-length strings, DATE is for storing date values,
and TEXT is for large text fields. This classification helps Column A Column B
ensure the correct data type is applied to each column
1. Union a. Rows in Table1 not in
and supports data integrity.
Table2
6. Match each SQL clause with its purpose: 2. Intersection b. All rows common to
Table1 and Table2
Column A Column B
3. Set Difference c. Combines rows
1. GROUP BY a. Sorts the result
from both without
2. HAVING b. Filters aggregate results duplication
3. ORDER BY c. Groups rows based on shared 4. Cartesian Product d. Pairs each row of
values Table1 with each row
4. WHERE d. Filters individual rows of Table2
Options: Options:
(A) 1-c, 2-b, 3-a, 4-d (A) 1-c, 2-b, 3-a, 4-d
(B) 1-a, 2-d, 3-c, 4-b (B) 1-d, 2-a, 3-b, 4-c
(C) 1-b, 2-c, 3-d, 4-a (C) 1-b, 2-a, 3-d, 4-c
(D) 1-d, 2-c, 3-a, 4-b (D) 1-c, 2-d, 3-a, 4-b
Ans Ans
(A) 1-c, 2-b, 3-a, 4-d (A) 1-c, 2-b, 3-a, 4-d
GROUP BY consolidates rows with the same values, Union merges rows while removing duplicates,
HAVING filters aggregates, ORDER BY sorts output, Intersection keeps only rows common to both tables, Set
and WHERE filters individual rows. This logical Difference takes rows in one table but not the other, and
sequence allows more refined queries, ensuring accurate Cartesian Product pairs each row of the first table with
aggregated metrics and properly ordered final output, all rows of the second.
fulfilling diverse data analysis requirements.
9. Match the following SQL functions with the correct
7. Match the following aggregate functions with their category:
correct descriptions:
Column A Column B
Column A Column B 1. POWER(x,y) a. Date function
1. COUNT() a. Returns the highest value 2. LCASE(str) b. Mathematical function
2. AVG() b. Returns the lowest value 3. NOW() c. Text function
3. MAX() c. Returns total number of rows 4. MID(str, n, m) d. Text function
4. MIN() d. Returns mean of numeric
Options:
values
(A) 1-b, 2-c, 3-a, 4-d
Options: (B) 1-c, 2-b, 3-d, 4-a
(A) 1-a, 2-b, 3-c, 4-d (C) 1-a, 2-d, 3-b, 4-c
(B) 1-c, 2-d, 3-a, 4-b (D) 1-b, 2-a, 3-c, 4-d
(C) 1-c, 2-b, 3-d, 4-a
Ans
(D) 1-d, 2-c, 3-b, 4-a
(A) 1-b, 2-c, 3-a, 4-d
Ans
POWER(x,y) is math-related, LCASE(str) is text-
(B) 1-c, 2-d, 3-a, 4-b based, NOW() is a date/time function returning the
COUNT() calculates the total row count, AVG() current timestamp, and MID(str, n, m) is also a text-
calculates the mean for numeric columns, MAX() finds manipulation function extracting a substring. Accurate
the largest value, and MIN() retrieves the smallest. classification ensures correct function usage and avoids
These aggregate functions simplify data summarization query errors.
and support deeper insight into the stored information.
10. Which statements about JOIN in SQL are correct?
8. Match each relational operation to its example outcome: 1. A JOIN combines rows from two or more tables.
Expand Your Reach: Your readers can share these PDFs on other platforms, helping your
influence grow exponentially.
Still not convinced? Ask us how, and we’ll walk you through exactly how it works.
Best of all: It’s completely free—no hidden charges.
2. INNER JOIN returns rows when there is at least In Bus topology, all devices share one backbone cable,
one match. while Mesh topology links every node with every other
3. LEFT JOIN returns matching rows and all rows node. A Star topology has a central hub, and a Ring
from the left table. topology arranges nodes in a loop, not with a central
4. CROSS JOIN duplicates rows based on matching hub.
columns only.
13. Which statements are correct about IP addresses?
(A) 1 and 4
(B) 1, 2, and 3 1. They uniquely identify devices on a network.
(C) 2 and 4 2. They are identical to MAC addresses.
(D) 2, 3, and 4 3. IPv4 uses 32-bit addresses.
4. IPv6 uses 128-bit addresses.
Ans (A) 1 and 3
(B) 1, 2, and 3 (B) 2 and 4
JOIN merges rows across tables based on matching (C) 1, 3, and 4
conditions. INNER JOIN needs at least one common (D) 2, 3, and 4
match, while LEFT JOIN includes all left-table rows Ans
plus matching right-table rows. CROSS JOIN produces
a Cartesian product, not just matched rows. (C) 1, 3, and 4
IP addresses serve as unique identifiers for network
11. Which statements about computer networks are TRUE? devices. IPv4 employs 32 bits, while IPv6 employs 128
1. A WAN covers a small geographic area. bits. MAC addresses, in contrast, are hardware-bound
2. A LAN usually covers a confined site. and differ from IP addresses, which are logical network
3. A MAN spans a large city or metropolitan area. identifiers.
4. LAN, MAN, WAN are the only existing network
14. Which statements about the Internet and the Web are
types.
(A) 1 and 2 TRUE?
(B) 2 and 3 1. The Web is a collection of interconnected
(C) 1, 2, and 3 documents and resources.
(D) 2, 3, and 4 2. The Internet only consists of Web pages.
3. The Internet is the underlying global network
Ans infrastructure.
(B) 2 and 3 4. The Web is essentially the same as the Internet.
A LAN typically serves a small, localized area, and a (A) 1 and 3
MAN extends across a metropolitan region. A WAN (B) 2 and 3
may span countries or continents. There are also other (C) 2 and 4
network classifications, so stating only LAN, MAN, and (D) 1, 3, and 4
WAN exist is incomplete. Ans
12. Regarding topologies, identify the correct statements: (A) 1 and 3
1. A Bus topology has a single cable for all nodes. The Internet is a vast global network that supports a
2. A Star topology places all nodes in a ring. variety of services. The Web is one service on top of
3. A Mesh topology connects every node with every that network, comprising interlinked digital resources.
other node. Hence, the Internet is broader, while the Web is a subset
4. A Ring topology has one central hub. of Internet services.
(A) 1 and 3
15. Assertion (A) : Exception handling in Python allows
(B) 1, 2, and 4
(C) 2 and 4 programs to recover gracefully from errors.
(D) 1, 3, and 4 Reason (R) : The `try-except` block forces Python to
ignore all runtime errors without reporting them.
Ans (A) Both (A) and (R) are true, and (R) is the correct
(A) 1 and 3 explanation of (A)
(B) Both (A) and (R) are true, but (R) is NOT the
17. Arrange these steps in the correct sequence for handling 20. Which term describes the concept of removing an item
an exception in Python: from the top of a stack?
1. Identify error location (A) Enqueue
2. Execute finally block if defined (B) Pop
3. Jump to the matching except block (C) Peek
4. Attempt to execute try block (D) Push
(A) 4 → 1 → 3 → 2 Ans
(B) 4 → 3 → 1 → 2
(C) 1 → 4 → 2 → 3 (B) Pop
(D) 4 → 1 → 2 → 3 Stacks follow the Last-In-First-Out principle, where
items are added with the push operation and removed
Ans with the pop operation. Pop always removes the top
(A) 4 → 1 → 3 → 2 element, ensuring that the most recently inserted item
Python first attempts the try block. If an error occurs, is the first to be retrieved.
the interpreter identifies where it happened, then looks
21. In a queue, which operation inserts a new element at the
for an except block to handle it. Finally, it runs any
defined finally block. This sequence ensures proper rear?
error detection and handling. (A) Dequeue
(B) Pop
18. Put these stack operations in the correct order to push (C) Enqueue
and pop elements: (D) Shift
the average of the two central values. This statistic 3. Data transfer rate is measured only in bytes per
is particularly useful when dealing with skewed second.
distributions or outliers. 4. Bandwidth can be expressed in Hertz or bits per
second.
28. Which of the following best describes the purpose of a (A) 1, 2, and 4
foreign key in a relational database? (B) 2 and 3
(A) To reference rows in the same table (C) 1, 3, and 4
(B) To store duplicate primary key values (D) 1 and 4
(C) To link related rows in different tables
(D) To enforce identical data types across columns Ans
34. What is the best definition of a firewall in network A queue inserts elements at the rear and removes
security? (A) A software or hardware solution to block them from the front, enforcing a FIFO pattern. Stacks
unauthorized access utilize LIFO, deques support insertion and deletion at
(B) A physical barrier for the server room both ends, and linked lists are more general structures
(C) A device to connect multiple networks securely without an inherent FIFO requirement.
(D) A password-protected user interface
38. Which type of virus spreads by replicating itself and
Ans doesn’t need host files to propagate? (A) Trojan Horse
(A) A software or hardware solution to block (B) Worm
unauthorized access (C) Spyware
A firewall monitors incoming and outgoing network (D) Logic Bomb
traffic based on established security rules, blocking or Ans
allowing specific data packets. It can be implemented in
software or hardware form, serving as a crucial defense (B) Worm
against external threats and malicious intrusions. A worm replicates autonomously across networks
without directly altering host files. It exploits
35. Which threat involves users receiving unsolicited, vulnerabilities to spread quickly, consuming bandwidth
irrelevant messages clogging their inboxes? (A) Trojan and resources. Trojans masquerade as legitimate
(B) Spam software, logic bombs trigger under specific conditions,
(C) Worm and spyware secretly gathers user information.
(D) Adware
39. In hashing, what term describes two different keys
Ans generating the same hash value?
(B) Spam (A) Collision
Spam refers to unwanted bulk messages, often sent for (B) Overload
advertising or phishing purposes. It can overwhelm (C) Redundancy
email systems and waste storage or bandwidth. While (D) Duplication
adware, Trojans, and worms are also security concerns, Ans
they typically perform different harmful functions.
(A) Collision
36. In Python, which statement ensures a file closes correctly A collision occurs when two distinct inputs produce the
regardless of exceptions? (A) use try-finally around file same hash output. Efficient hash functions minimize
operations collisions, but they are often unavoidable in large data
(B) only read in text mode sets. Collision resolution methods like chaining or open
(C) store file object in a global variable addressing handle these events effectively.
(D) rename the file after usage
40. Which function in MySQL returns the current date and
Ans time?
(A) use try-finally around file operations (A) DATE()
Wrapping file operations in a try-finally (or using a (B) CURDATE()
`with` statement) ensures the file is closed even if (C) NOW()
an exception arises. This prevents resource leaks and (D) TIME()
maintains data integrity, making it a recommended Ans
practice in file handling.
(C) NOW()
37. Which data structure uses the principle First In, First The NOW() function provides both the current date
Out? (A) Stack and time as a single timestamp. DATE() extracts only
(B) Queue the date portion, CURDATE() returns only the current
(C) Deque date, and TIME() yields the current time without the
(D) Linked List date component. (48 words — needs 50)
Ans Revised The NOW() function supplies the current date
and time as a single timestamp in MySQL. DATE()
(B) Queue extracts only the date part, while CURDATE() similarly
returns today’s date. TIME() focuses purely on the orphan records and maintains consistent relationships
current time. Hence, NOW() is the comprehensive between orders and customers, strengthening overall
function for date-time retrieval. data reliability and reducing errors.
Direction :Carefully read the case study provided and then 43. How might the administrators use aggregate functions
thoroughly answer the subsequent five questions. to analyze sales data? (A) By automating user
Many companies rely on MySQL databases to store authentication
customer information, sales records, and employee (B) By summarizing key metrics like total or average
data. A national retail chain wants to migrate from sales
spreadsheets to a central MySQL system. The database (C) By completely replacing the need for primary keys
includes tables for products, orders, and customers, each (D) By removing the necessity for table relationships
with a primary key. The company uses complex JOIN Ans
queries to combine tables for detailed reporting. They also
implement foreign keys to maintain referential integrity, (B) By summarizing key metrics like total or average
ensuring data consistency across orders and associated sales
customer records. Administrators plan to use SQL’s Aggregate functions (e.g., SUM, AVG, COUNT) quickly
aggregate functions for sales analysis, quickly extracting compute comprehensive metrics from large volumes
totals, averages, and maximum purchase values. By of data. They can total product sales, calculate average
adopting MySQL, the retail chain aims to streamline purchase amounts, or count distinct transactions,
data management, reduce duplication, and better secure helping administrators make data-driven decisions with
vital business records, ultimately enhancing its decision- minimal effort.
making processes. 44. In this scenario, which SQL operation would help the
41. Which advantage is the company seeking by replacing chain combine data from the customers and orders
spreadsheets with MySQL? (A) Increased data tables in a single query? (A) DELETE
redundancy (B) DROP
(B) Enhanced data security and consistency (C) JOIN
(C) Reduced concurrency (D) TRUNCATE
(D) Elimination of network access Ans
Ans (C) JOIN
(B) Enhanced data security and consistency A JOIN statement merges rows from two or more tables
MySQL reduces spreadsheet-related inconsistencies based on related columns, enabling comprehensive
by establishing a centralized database, preventing queries. In this case, the chain can retrieve order details
scattered files and mismatched entries. It enforces alongside corresponding customer information in one
security measures like user privileges and foreign result set, facilitating advanced reporting.
keys for referential integrity. This setup boosts overall 45. Which benefit will the chain likely gain by using MySQL
consistency, minimizing issues that commonly arise for its sales records? (A) Unstructured data storage
from multiple, unlinked spreadsheets. (B) Complex data retrieval using SQL features
42. Why are foreign keys critical in the company’s database (C) Only local file-based access
design? (A) They remove the need for JOIN operations (D) Limited concurrency control
(B) They allow multiple primary keys in the same table Ans
(C) They enforce referential integrity between related (B) Complex data retrieval using SQL features
tables MySQL supports sophisticated SQL queries, enabling
(D) They increase table sizes exponentially the organization to perform powerful data retrieval
Ans and reporting. Unlike spreadsheets, structured query
(C) They enforce referential integrity between related capabilities like JOIN, GROUP BY, and aggregate
tables functions provide nuanced insights into sales trends,
Foreign keys link tables by ensuring that references to boosting strategic decision-making.
primary keys in other tables are valid. This prevents Direction :Carefully read the case study provided and then
48. Why might the firm use binary files alongside text files
for storing backups? (A) Binary files are easier to read
manually
(B) Binary files often provide more efficient storage and
PRACTICE PAPER 10
1. What does the term domain signify in a relational robust multi-user coordination, whereas databases are
database model? (A) The entire dataset in the database designed to handle complex data interactions.
(B) The permissible set of values for an attribute
4. Which of these is NOT a valid MySQL DDL (Data
(C) The set of all foreign keys in a table
(D) The complete backup repository Definition Language) command? (A) CREATE TABLE
(B) DROP TABLE
Ans (C) ALTER TABLE
(B) The permissible set of values for an attribute (D) SELECT
In relational databases, a domain defines the acceptable Ans
range or type for an attribute’s values. It ensures data
integrity by restricting what can be inserted into (D) SELECT
a column, aiding in maintaining consistency and DDL commands (CREATE, DROP, ALTER) define and
reliability of stored information. modify database structures. SELECT is a Data Query
Language (DQL) command, used to retrieve data. Thus,
2. Which key in a relation is a candidate key that has NOT while SELECT is crucial, it is not categorized under
been chosen as the primary key? (A) Alternate key Data Definition Language. (48 words — needs 50)
(B) Primary key Revised Data Definition Language comprises
(C) Foreign key commands that build or alter schema objects (CREATE,
(D) Composite key DROP, ALTER). SELECT belongs to Data Query
Ans Language, serving to retrieve records from existing
tables. Therefore, SELECT is not a DDL command, even
(A) Alternate key though it is fundamental for data retrieval operations.
An alternate key is any candidate key not selected to
serve as the primary key. A candidate key is an attribute 5. Match these MySQL statements with their function:
or set of attributes uniquely identifying a row. The
Column A Column B
primary key is ultimately chosen from these candidates,
leaving others as alternates. 1. INSERT a. Removes selected rows
2. UPDATE b. Modifies existing rows
3. Which of the following statements about file systems 3. DELETE c. Adds new rows
and databases is TRUE? (A) File systems strictly prevent
4. SELECT d. Retrieves data
data redundancy
(B) Databases provide concurrency control and data Options:
integrity mechanisms (A) 1-c, 2-b, 3-a, 4-d
(C) Databases are less structured than file systems (B) 1-a, 2-c, 3-d, 4-b
(D) File systems exclusively enforce relational (C) 1-d, 2-b, 3-c, 4-a
constraints (D) 1-c, 2-d, 3-b, 4-a
Ans Ans
(B) Databases provide concurrency control and data (A) 1-c, 2-b, 3-a, 4-d
integrity mechanisms INSERT adds new records, UPDATE modifies existing
Database Management Systems include features like ones, DELETE removes selected rows, and SELECT
transactions, concurrency control, and constraints that retrieves data. These operations are fundamental to data
preserve data consistency, unlike file systems. File-based manipulation, forming the basis for typical database
approaches can encounter redundant copies and lack interactions and ensuring effective record handling.
6. Match each MySQL numeric function with its outcome: 8. Match these text functions with their use:
Column A Column B Column A Column B
1. MOD(x, y) a. Returns x to the power 1. UCASE(str) a. Extract a substring
of y 2. SUBSTR(str, n) b. Convert to lowercase
2. ROUND(x) b. Returns x remainder y 3. LCASE(str) c. Calculate string length
3. POWER(x, y) c. Returns integer part 4. LENGTH(str) d. Convert to uppercase
of x
Options:
4. FLOOR(x) d. Returns x rounded to (A) 1-b, 2-d, 3-a, 4-c
the nearest integer (B) 1-d, 2-a, 3-b, 4-c
Options: (C) 1-c, 2-a, 3-d, 4-b
(A) 1-b, 2-d, 3-a, 4-c (D) 1-a, 2-c, 3-b, 4-d
(B) 1-d, 2-a, 3-c, 4-b Ans
(C) 1-b, 2-a, 3-d, 4-c
(D) 1-c, 2-b, 3-a, 4-d (B) 1-d, 2-a, 3-b, 4-c
UCASE() changes text to uppercase, SUBSTR() extracts
Ans a substring, LCASE() converts text to lowercase,
(A) 1-b, 2-d, 3-a, 4-c and LENGTH() gives the string’s character length.
MOD(x, y) gives the remainder of x/y, ROUND(x) These functions help manipulate text efficiently when
rounds x to the nearest integer, POWER(x, y) computes retrieving or formatting database output. (49 words —
x raised to y, and FLOOR(x) yields the greatest integer needs 50)
less than or equal to x. Each function serves distinct Revised UCASE() raises all letters to uppercase,
numeric manipulations. SUBSTR() extracts a portion of the string starting at
position n, LCASE() lowers all letters to lowercase, and
7. Match each SQL operation with its description: LENGTH() measures the number of characters. These
Column A Column B functions support diverse text manipulation tasks,
1. Cartesian Product a. Common rows from aiding in consistent output formatting and analysis.
both tables 9. Match each SQL date function with its result:
2. Intersection b. All rows in first table
but not second Column A Column B
3. Minus c. Rows from both tables 1. DAYNAME(date) a. Numeric month
without duplicates 2. MONTH(date) b. Full name of weekday
4. Union d. Combines each row 3. YEAR(date) c. Four-digit year
of one table with each 4. DAY(date) d. Day of the month
row of another Options:
Options: (A) 1-c, 2-a, 3-d, 4-b
(A) 1-d, 2-a, 3-b, 4-c (B) 1-b, 2-a, 3-c, 4-d
(B) 1-a, 2-b, 3-d, 4-c (C) 1-b, 2-d, 3-a, 4-c
(C) 1-c, 2-d, 3-a, 4-b (D) 1-a, 2-b, 3-c, 4-d
(D) 1-b, 2-c, 3-a, 4-d Ans
Ans (B) 1-b, 2-a, 3-c, 4-d
(A) 1-d, 2-a, 3-b, 4-c DAYNAME() yields the weekday name (e.g., Monday),
Cartesian Product produces every possible row pairing, MONTH() returns the month number (1–12), YEAR()
Intersection extracts only shared rows, Minus excludes provides the four-digit year, and DAY() gives the day of
rows present in the second table, and Union merges the month (1–31). These functions facilitate date-based
rows from both tables, removing duplicates. This queries and formatting.
classification clarifies how data can be combined or
10. Which statements about GROUP BY in SQL are correct?
filtered.
1. It groups rows sharing the same values in specified
Expand Your Reach: Your readers can share these PDFs on other platforms, helping your
influence grow exponentially.
Still not convinced? Ask us how, and we’ll walk you through exactly how it works.
Best of all: It’s completely free—no hidden charges.
(A) Both (A) and (R) are true, and (R) is the correct file automatically. This workflow guarantees proper file
explanation of (A) handling and closure.
(B) Both (A) and (R) are true, but (R) is NOT the
18. Put these phases of exception handling in Python in the
correct explanation of (A)
(C) (A) is true, but (R) is false correct order:
(D) (A) is false, but (R) is true 1. Encounter an exception in try block
2. Execute the except block if matching
Ans 3. Move to finally block if present
(C) (A) is true, but (R) is false 4. Continue execution if no critical errors remain
Python’s try-except can address both specific and (A) 1 → 2 → 3 → 4
unexpected errors if an appropriate except block exists. (B) 2 → 3 → 1 → 4
If an error isn’t caught by any except, Python will raise (C) 3 → 1 → 4 → 2
it and potentially terminate unless handled. It does not (D) 1 → 4 → 2 → 3
run indefinitely. Ans
16. Assertion (A) : Using a `with` statement to open files in (A) 1 → 2 → 3 → 4
Python automatically closes the file after usage. When an exception arises in the try block, Python
Reason (R) : The `with` statement triggers the file checks for a matching except block. If found, it executes
object’s context manager methods to handle closure. that block. Then any finally block is executed. If the
(A) Both (A) and (R) are true, and (R) is the correct program recovers, execution proceeds normally.
explanation of (A)
19. Which operation places a new element onto the top of a
(B) Both (A) and (R) are true, but (R) is NOT the
correct explanation of (A) stack? (A) Append
(C) (A) is true, but (R) is false (B) InsertFront
(D) (A) is false, but (R) is true (C) Push
(D) Reverse
Ans
Ans
(A) Both (A) and (R) are true, and (R) is the correct
explanation of (A) (C) Push
The `with` statement invokes the file object’s context In a stack, push adds an item to the topmost position,
manager methods (enter and exit), ensuring automatic following the Last-In-First-Out principle. Once pushed,
closure once the code block finishes. This feature the element remains at the top until popped, ensuring a
simplifies file handling by preventing resource leaks and fixed, predictable order for removal operations.
streamlining cleanup tasks. 20. Which operation removes the front element from a
17. Arrange the process of writing to a text file in Python in queue? (A) Pop
correct order: (B) Dequeue
1. Use `with open(filename, ‘w’) as f` (C) Enqueue
2. Write data using `f.write()` (D) ShiftLeft
3. File is automatically closed after the block Ans
4. The file is created or overwritten in write mode (B) Dequeue
(A) 1 → 4 → 2 → 3 In a queue, enqueue adds an element at the rear, while
(B) 4 → 1 → 3 → 2 dequeue removes the frontmost element, adhering to
(C) 1 → 2 → 4 → 3 the First-In-First-Out principle. This structure ensures
(D) 2 → 3 → 1 → 4 that requests or items are processed in the exact order
Ans they arrive.
(A) 1 → 4 → 2 → 3 21. Why is binary search faster than sequential search on
First, `with open(filename, ‘w’)` is used. This creates or large sorted lists? (A) It compares each element twice
overwrites the file (write mode). Next, data is written (B) It eliminates half of the search interval each step
via `f.write()`. Finally, exiting the with-block closes the (C) It stores all elements in a queue
(D) It automatically indexes all elements
A finally block always runs once try and except blocks case. Statement 2 is incorrect because Binary Search
finish, ensuring that cleanup tasks (e.g., closing files generally outperforms sequential for large n.
or releasing resources) happen no matter what. This
32. Which statements about Sorting are true?
promotes robust error handling and reduces resource
leaks in applications. 1. Bubble Sort compares and swaps adjacent elements.
2. Selection Sort selects the highest value each pass.
29. What does LIFO stand for regarding stacks? (A) Last In, 3. Insertion Sort inserts each element into its proper
First Out place.
(B) Longest Item, First Observed 4. Merge Sort splits and merges sublists.
(C) List Index, First Operand (A) 1, 3, and 4
(D) Local Instance, Fast Operation (B) 1, 2, and 3
(C) 2, 3, and 4
Ans
(D) 1 and 4
(A) Last In, First Out
Ans
LIFO means the most recently inserted element is
the first to be removed, reflecting how stacks operate. (A) 1, 3, and 4
Each new push places an item on top, and the next pop Bubble Sort repeatedly swaps adjacent pairs if out
removes that top item, following this principle strictly. of order, Insertion Sort places the current element
correctly among sorted elements, and Merge Sort splits
30. Which data structure adds elements at one end and the list and merges them back. Selection Sort finds the
removes them from the opposite end? (A) Stack smallest element each pass, not always the highest.
(B) Queue
(C) Hash Table 33. Which measure of central tendency is found by
(D) Linked List identifying the most frequently occurring value in a
dataset? (A) Mean
Ans
(B) Mode
(B) Queue (C) Median
A queue follows the First-In-First-Out principle, (D) Range
inserting elements at the rear (enqueue) and removing
Ans
them from the front (dequeue). This arrangement is
crucial for tasks that must process items in the same (B) Mode
sequence they arrive. The mode is the value that appears most often in the data
set. Unlike the mean or median, it focuses on frequency
31. Which statements about Searching are correct? rather than sums or positional order. Multiple modes
1. Binary Search requires a sorted list. can exist if values tie for highest frequency.
2. Sequential Search is always faster than Binary
Search. 34. Which SQL command changes the structure of an
3. Binary Search has O(log n) complexity in the best existing table, such as adding a new column?
cases. (A) UPDATE TABLE
4. Sequential Search has O(n) complexity in the worst (B) ALTER TABLE
case. (C) MODIFY ROW
(A) 1, 2, and 3 (D) DROP COLUMN
(B) 1, 3, and 4 Ans
(C) 2, 3, and 4
(B) ALTER TABLE
(D) 1, 2, 3, and 4
ALTER TABLE is used to modify table definitions,
Ans including adding or removing columns, changing
(B) 1, 3, and 4 column types, or renaming columns. UPDATE affects
Binary Search needs a sorted list and operates in data within a table, whereas DROP COLUMN is part of
O(log n) time for the best, average, and worst typical an ALTER TABLE command that specifically removes
scenarios. Sequential Search can be O(n) in the worst a column.
35. Which network device translates data from one protocol Ans
to another, allowing communication between different (C) DATE()
network architectures? DATE(datetime) extracts just the date segment from a
(A) Hub combined date-time value. CURTIME() gets only the
(B) Switch current time, NOW() yields both date and time, and
(C) Router DAY() returns the day of the month as a numeric value.
(D) Gateway
39. In MySQL, which clause is used to specify a condition
Ans
on groups formed by GROUP BY? (A) WHERE
(D) Gateway (B) HAVING
A gateway operates at higher layers to convert data (C) ORDER BY
formats or protocols between networks, ensuring they (D) INTO
can exchange information. Routers direct traffic between
Ans
IP networks, switches work at the data link layer, and
hubs simply broadcast data to connected devices. (B) HAVING
HAVING filters grouped rows after the GROUP BY
36. Which threat involves creating unauthorized copies of operation has formed them. WHERE, on the other
data passing through a network? (A) Snooping hand, filters rows before grouping. ORDER BY sorts the
(B) Spam final result, and INTO does not filter rows at all.
(C) Worm
(D) Adware 40. Which technology uses light pulses to transmit data at
high speed? (A) Twisted Pair
Ans
(B) Coaxial Cable
(A) Snooping (C) Optical Fiber
Snooping is the unauthorized interception or (D) Infrared
monitoring of data flows, potentially leading to privacy
Ans
breaches or information theft. Spam is unwanted
messages, worms replicate themselves, and adware (C) Optical Fiber
displays advertisements. Snooping specifically involves Optical fiber conducts data via light signals through
covertly observing sensitive data transmissions. thin glass or plastic strands, enabling fast data transfer
over long distances. Twisted pair and coaxial cables use
37. Which of these acts as the software or hardware electrical signals, while infrared is a wireless technology
boundary that monitors and controls incoming and for short-range communication.
outgoing network traffic based on security rules? (A)
URL Filter Direction :Carefully read the case study provided and then
(B) Firewall thoroughly answer the subsequent five questions.
(C) Network Switch An educational institution maintains a Python-based
(D) DHCP Server system that tracks library book transactions and student
details in a relational database. The database uses MySQL
Ans
tables for students, books, and borrow records. Each table
(B) Firewall has a primary key, and foreign keys link a borrow record
A firewall enforces defined security policies, scrutinizing to both a student and a book. The system’s interface uses
data packets entering or exiting a network. It can block queries with JOIN operations to generate overdue lists and
or permit communication based on configurable rules, usage statistics. Students can check real-time availability,
protecting internal systems from external threats. Other aided by aggregate functions like COUNT() to see how
listed devices serve different, more specialized network many copies remain. Additionally, the application
functions. employs file handling to export daily transaction logs
as text files, preserving a record of each borrow, return,
38. Which function in MySQL returns only the date part
or renewal event. Proper exception handling ensures
from a date-time value? (A) CURTIME()
the system continues running smoothly during network
(B) NOW()
disruptions or invalid user inputs.
(C) DATE()
(D) DAY()
41. Which is the main purpose of foreign keys in the borrow the error
records table? (A) To store random data in each row (C) It discards all pending transactions
(B) To disconnect borrow entries from books or (D) It hides errors without reporting them
students Ans
(C) To relate each record to specific student and book
entries (B) It allows the code to attempt reconnection or log the
(D) To delete all associated data automatically error
Proper exception handling can capture network-related
Ans errors and gracefully respond, perhaps by retrying the
(C) To relate each record to specific student and book connection or logging relevant error information. This
entries approach maintains system stability, avoiding abrupt
Foreign keys ensure that each borrow record references crashes and helping administrators diagnose and
a valid student and book by linking to their primary correct issues effectively.
keys. This maintains consistent relationships among
45. Which SQL concept does the interface likely use to
tables, preventing orphaned or untraceable transaction
entries. generate a list of students who currently have overdue
books along with the specific titles borrowed? (A) JOIN
42. How does the system benefit from using COUNT() in (B) TRUNCATE
queries? (A) It produces random numeric outputs (C) UNION ALL
(B) It ensures no data is ever aggregated (D) REVOKE
(C) It quickly calculates how many copies of a book are Ans
available
(D) It replaces the primary key fields (A) JOIN
A JOIN combines rows from the students, borrow
Ans records, and books tables based on matching foreign
(C) It quickly calculates how many copies of a book are keys and primary keys. This allows the system to display
available each student’s overdue books and relevant details in a
COUNT() provides a straightforward way to total single unified view.
specific rows matching certain conditions (e.g., copies
of a book still in the library). This function aids in real- Direction :Carefully read the case study provided and then
time availability checks and quick numeric aggregation thoroughly answer the subsequent five questions.
A startup develops a networked application to analyze
of records.
real-time data for e-commerce trends. The system relies on
43. Why is file handling for daily transaction logs MySQL for storing sales transactions and product details,
important? (A) It is unnecessary because the database with powerful SQL queries to gather and aggregate
stores everything insights. On the application side, Python’s exception
(B) It creates a separate record for auditing and backup handling protects against malformed data inputs and
(C) It cancels the user’s borrow request automatically sudden service outages. The platform also stores daily
(D) It ensures no network is required snapshots in text files and archives large amounts of
structured data in binary form. To handle a surge of
Ans
incoming events, the system uses a queue, ensuring
(B) It creates a separate record for auditing and backup sequential processing. Additionally, advanced searching
Exporting logs to files provides a secondary record and sorting algorithms are implemented for swift data
outside the database, beneficial for audits, data recovery, retrieval and ranked lists of best-selling products. Security
or historical reviews. If database corruption or network measures like firewalls and encryption are employed to
failure occurs, these logs serve as an additional resource keep transactions and user credentials safe from threats.
for reconstructing transaction history.
46. Why might the application store some data in binary
44. How does exception handling help the system during files rather than solely in text files? (A) To make manual
network disruptions? (A) It permanently terminates the reading simpler
application on errors (B) To facilitate more compact and efficient data storage
(B) It allows the code to attempt reconnection or log (C) To prevent encryption
(D) To allow only single-user access By placing incoming events in a queue, the system
Ans processes them sequentially, guaranteeing fairness and
preventing overload. This approach helps handle spikes
(B) To facilitate more compact and efficient data storage in traffic while maintaining consistent, orderly data
Binary files often occupy less space and can be faster processing, vital for robust e-commerce platforms.
to read/write for structured data. While text files
are human-readable, large-scale systems can benefit 50. Which security measure is mentioned to protect the
from binary formats for efficiency and performance, platform from external threats? (A) Defragmentation
especially for large volumes of information. (B) Manual packet inspection only
(C) Firewall
47. How do searching and sorting algorithms assist in the (D) Data duplication
platform’s analysis features? (A) They ensure network
connectivity remains constant Ans
(B) They reduce the need for indexing in databases (C) Firewall
(C) They retrieve and order products quickly for A firewall monitors and controls traffic based on
reporting security rules, shielding the system from unauthorized
(D) They replace the SQL engine entirely access or harmful data packets. Alongside encryption, it
Ans bolsters the platform’s defense against malicious attacks,
preserving confidentiality and reliability.
(C) They retrieve and order products quickly for
reporting **************
Searching and sorting algorithms optimize data
handling when generating various reports, such as
top-selling or trending products. By efficiently locating
relevant entries and ranking them, the application
can deliver timely analytics and insights crucial for
e-commerce operations.
PRACTICE PAPER 11
1. Which of the following best describes a ‘domain’ in a A database centralizes information and offers
relational database model? data integrity checks, eliminating duplication. By
(A) The set of all tables in a database controlling how data is stored, updated, and accessed,
(B) The range of valid data values for an attribute databases reduce errors and redundancies. They
(C) A group of related records in a table support concurrent user access, enforce relationships
(D) The structure that defines foreign keys between tables, and apply security constraints, leading
Ans to improved consistency, scalability, and overall data
management efficiency.
(B) The range of valid data values for an attribute
A domain specifies every permissible data value for a 4. Which of the following is NOT a basic relational algebra
particular attribute in a relation. It ensures that each operation?
attribute maintains consistent data types and content. (A) Selection
By defining boundaries for valid values, domains help (B) Intersection
uphold data integrity and accuracy across the entire (C) Projection
database environment, preventing inconsistent or (D) Cartesian Product
invalid entries or future discrepancies. Ans
2. Which key uniquely identifies each record in a relational (B) Intersection
table, ensuring no duplicates? Classical relational algebra includes selection,
(A) Foreign key projection, union, set difference, and Cartesian product
(B) Alternate key as core operations. Intersection, although commonly
(C) Primary key used in extended relational algebra, is not part of the
(D) Candidate key fundamental set. Recognizing these foundational
Ans operations helps students comprehend how queries
manipulate and derive new relations in databases.
(C) Primary key
A primary key is a designated attribute or combination 5. When comparing a candidate key and a primary key,
of attributes that uniquely identifies every row in a table, which statement is most accurate?
prohibiting duplicates. This uniqueness requirement (A) A candidate key always references another table
maintains record distinction, thereby guaranteeing (B) A primary key cannot ever be unique
accurate referencing. Without a primary key, identifying (C) Every primary key is a candidate key, but not every
and managing rows would become error-prone, candidate key is chosen as the primary key
jeopardizing data consistency and reliability. (D) Candidate keys and primary keys must both appear
in other tables
3. Why is a database often considered more efficient than a
traditional file system? Ans
(A) It uses more physical storage (C) Every primary key is a candidate key, but not every
(B) It integrates data redundantly candidate key is chosen as the primary key
(C) It centralizes data control and reduces Candidate keys are potential primary keys that uniquely
inconsistencies identify tuples. Once one candidate key is formally
(D) It only stores small files designated as the primary key, the others remain
Ans alternate keys. All candidate keys share uniqueness, but
only one is ultimately selected as the table’s primary key,
(C) It centralizes data control and reduces inconsistencies preserving distinct records and data integrity.
expressions by reversing the typical order of operators methods. However, it is only applicable if the data is
and operands. sorted, making it unsuitable for unsorted collections.
25. Assertion (A) : Queues are suitable for breadth-first 28. Which of the following is NOT necessary for binary
traversal algorithms. search to function correctly?
Reason (R) : Queues remove elements from the rear and (A) Data in ascending or descending order
insert them at the front. (B) Calculation of a midpoint
(A) Both (A) and (R) are true, and (R) is the correct (C) Checking each element from start to finish
explanation of (A) (D) Comparing the target value with midpoint
(B) Both (A) and (R) are true, but (R) is not the correct Ans
explanation of (A)
(C) (A) is true, (R) is false (C) Checking each element from start to finish
(D) (A) is false, (R) is true Binary search relies on dividing the search space and
focusing on one half each iteration. Consequently,
Ans checking every element from beginning to end is
(C) (A) is true, (R) is false unnecessary. Sorting the list, finding the midpoint,
Breadth-first traversal indeed uses queues to explore and comparing the target to refine the subrange are all
nodes level by level in graphs or trees. However, queue integral to the binary search process.
operations insert new elements at the rear and remove
29. Which sorting method repeatedly compares adjacent
items from the front, maintaining FIFO order. The
reason statement incorrectly reverses this process, pairs and swaps them if they are out of order?
making it false while the assertion remains true. (A) Selection Sort
(B) Insertion Sort
26. Which queue variation allows elements to be added or (C) Bubble Sort
removed from both ends? (D) Merge Sort
(A) Circular Queue Ans
(B) Priority Queue
(C) Deque (C) Bubble Sort
(D) Static Queue Bubble Sort checks neighboring elements and swaps
them when out of sequence, effectively bubbling larger
Ans or smaller values toward the list’s end with each pass.
(C) Deque Despite its simplicity, it is inefficient for large datasets.
A deque, short for double-ended queue, enables insertion Selection Sort locates the minimum each pass, while
and removal operations at both the front and rear. Insertion Sort builds a sorted portion incrementally.
This flexibility makes it useful for scenarios requiring
30. Which algorithm generally performs best for partially
efficient access to both ends. In contrast, typical queues
limit enqueuing at the rear and dequeuing at the front, sorted arrays?
enforcing a strict FIFO policy. (A) Selection Sort
(B) Insertion Sort
27. What is a key advantage of binary search over sequential (C) Bubble Sort
search? (D) Quick Sort
(A) It can search unsorted data quickly Ans
(B) It always checks all elements
(C) It discards half of the data set every iteration (B) Insertion Sort
(D) It requires more time than sequential search Insertion Sort excels when arrays are partially sorted,
as it only requires a few comparisons and shifts to
Ans place each element in the correct spot. It incrementally
(C) It discards half of the data set every iteration expands a sorted sublist. Unlike Quick Sort, which still
Binary search exploits a sorted list by repeatedly partitions extensively, or Bubble Sort, which compares
comparing the target with the midpoint, then discarding many adjacent pairs, Insertion Sort capitalizes on near-
half of the remaining data. This logarithmic reduction order.
provides significantly faster search times than linear
Ans 41. Which key in the MySQL tables of Sunrise Public School
(B) It encrypts transmitted data for confidentiality directly references another table’s primary key?
HTTPS employs SSL/TLS encryption to protect data (A) Primary key
exchanged between clients and servers, preventing (B) Foreign key
eavesdroppers from reading sensitive information. (C) Candidate key
By contrast, HTTP sends data in clear text, leaving (D) Composite key
it vulnerable to interception. HTTPS ensures the Ans
authenticity of the site and confidentiality of user (B) Foreign key
credentials, financial details, or personal data. A foreign key links a field in one table to the primary key
40. Which practice best helps prevent unauthorized data of another table. At Sunrise Public School, the ‘student_
access? id’ field in the attendance and exam tables references the
(A) Sharing passwords among teammates primary key in the student profile table. This relationship
enforces referential integrity and preserves consistent 45. Why are regular backups vital for Sunrise Public School’s
inter-table connections. database?
(A) They slow down the system
42. Which SQL command helps administrators retrieve (B) They help fetch data from multiple tables
combined information from multiple related tables? (C) They restore data if corruption or loss occurs
(A) SELECT (D) They ensure primary key uniqueness
(B) JOIN
(C) GROUP BY Ans
(D) ORDER BY (C) They restore data if corruption or loss occurs
Ans Regular backups preserve the database state and guard
against hardware failures, software bugs, or accidental
(B) JOIN deletions. If data is lost or compromised, administrators
JOIN merges rows from two or more tables based on a can revert to the latest functional copy. In a school
related column. In the school scenario, merging student environment, reliable backups protect critical student
profiles, attendance, and exam data into a single, records, ensuring continuity and avoiding permanent,
unified result requires a JOIN clause. SELECT is used large-scale data disruption.
for choosing columns, but JOIN specifically handles
referencing rows across linked tables. Direction :Carefully read the case study provided and then
thoroughly answer the subsequent five questions.
43. How did the school minimize repetitive data across its Brighton College’s programming club tested a Python
tables? application to convert infix arithmetic expressions into
(A) By using multiple identical fields postfix notation. Club members learned that stacks
(B) By storing all information in one table are essential for holding operators while scanning
(C) Through referential integrity with foreign keys expressions from left to right. Whenever an operator with
(D) By never updating the same record lower precedence appeared, the system popped higher
Ans precedence operators first. After processing the entire
(C) Through referential integrity with foreign keys string, any remaining operators on the stack were popped
Foreign keys ensure each table references a unique and appended to the postfix string. This process made
record in the student profile, avoiding duplication of subsequent evaluations simpler, as postfix expressions
personal details. Rather than storing the same data eliminate parentheses by placing operators after operands.
repeatedly, the attendance and exam tables link back to The application also tested stack-based evaluations to
the principal record. This design saves storage space and quickly compute results by pushing numbers and then
maintains consistency among different data points. applying each operator to the top items. This project
showcased how fundamental stack operations—push and
44. Which MySQL feature can help the school produce pop—streamline expression parsing and computation in
summaries of total attendance or average marks? Python. Students discovered improved performance and
(A) Aggregate functions with GROUP BY reduced complexity using this systematic approach.
(B) TRUNCATE commands for large datasets
46. Which data structure is primarily used in the club’s
(C) DELETE statements for removing duplicates
(D) Only textual queries without any functions application for operator management?
(A) Queue
Ans (B) Stack
(A) Aggregate functions with GROUP BY (C) Linked List
GROUP BY allows grouping rows by a specified (D) Hash Table
column, enabling aggregate functions like AVG, SUM, Ans
or COUNT for each group. In the school’s database,
grouping data by student_id or class can yield total (B) Stack
attendance or average marks. This approach simplifies A stack handles operators in infix-to-postfix conversion
generating structured summaries for informed by holding them until they can be popped in the
administrative decisions. correct precedence order. This last-in, first-out design
ensures that higher-precedence operators are resolved
first, enabling a systematic approach for generating
valid postfix expressions without parenthesis-based remain, completing the conversion and guaranteeing a
complications. valid postfix expression.
47. How does postfix notation simplify arithmetic 50. How did the club evaluate the postfix expressions once
expressions according to the case study? generated?
(A) By inserting parentheses after every operator (A) Ignoring the operator precedence
(B) By requiring explicit operator precedence rules (B) By reversing the string
(C) By placing operators after operands, eliminating (C) Using a stack to push numbers and apply operators
parentheses (D) Asking the user to insert parentheses
(D) By using multiple stacks Ans
Ans (C) Using a stack to push numbers and apply operators
(C) By placing operators after operands, eliminating Once the postfix expression is created, the club’s
parentheses program scans each token and pushes numbers onto the
Postfix, or Reverse Polish notation, removes the stack. Whenever it encounters an operator, it pops the
need for parentheses by writing operators after their necessary operands, applies the operation, and pushes
corresponding operands. This results in fewer syntax the result back. This stack-based execution efficiently
complications and a more streamlined evaluation resolves postfix expressions without extra parentheses.
process. In the club’s application, the final expressions
no longer contain brackets, simplifying interpretation **************
PRACTICE PAPER 12
1. In a relational database model, what does a ‘tuple’ parent table. This prevents invalid entries and orphan
specifically represent? records. By linking tables through consistent references,
(A) A complete column in a table foreign keys bolster relational integrity, making data
(B) A single row containing related data values more reliable and cohesive.
(C) A structural constraint on foreign keys
4. Which of the following does NOT characterize the
(D) A data type definition
relational approach to data management?
Ans (A) Data is organized into tables (relations)
(B) A single row containing related data values (B) Each row represents a tuple
A tuple corresponds to one record or row in a relational (C) Hierarchical structure is mandatory
table, grouping related attribute values together. Each (D) Tables can be linked through keys
tuple represents a unique data entity within that relation. Ans
By storing data in row form, the database can maintain
organized, easily searchable records that align with table (C) Hierarchical structure is mandatory
constraints. The relational model organizes information into tables,
each row forming a tuple. Relations can interconnect
2. Which type of key refers to a candidate key that is not through primary and foreign keys without requiring
chosen to be the primary key? hierarchical paths. In contrast, hierarchical databases
(A) Alternate key impose parent-child data structures. Therefore,
(B) Foreign key hierarchical organization is not a defining characteristic
(C) Composite key of the relational database model.
(D) Partial key
5. Which statement best distinguishes between a file
Ans system and a database system?
(A) Alternate key (A) File systems always use SQL, databases never do
Among the candidate keys, one is selected as the (B) Databases enforce relationships and constraints,
primary key to uniquely identify table records. The file systems generally do not
other candidate keys, which also uniquely identify (C) Databases lack concurrent access, while file systems
rows but are not chosen as the primary key, are called allow multiple users
alternate keys. They remain valid unique identifiers but (D) File systems automatically ensure data consistency
hold secondary status. across multiple files
20. Assertion (A) : A finally block always executes in if the file is absent. Thus, ‘rb’ does not handle textual
Python, even if an exception is not caught. decoding by default.
Reason (R) : The finally block is designed for cleanup
23. Which statements about stack operations in Python are
operations regardless of success or failure.
(A) Both (A) and (R) are true, and (R) is the correct correct?
explanation of (A) 1. pop() removes the last element of a list used as a
(B) Both (A) and (R) are true, but (R) is not the correct stack
explanation of (A) 2. append() inserts a new element at the top
(C) (A) is true, (R) is false 3. The top of the stack is index 0
(D) (A) is false, (R) is true 4. LIFO principle applies
(A) 1, 2, and 4
Ans (B) 2, 3, and 4
(A) Both (A) and (R) are true, and (R) is the correct (C) 1 and 4 only
explanation of (A) (D) 1, 3, and 4
The finally block executes no matter how control leaves Ans
the try-except statement—be it a normal exit or an
unhandled exception. It provides a place for cleanup (A) 1, 2, and 4
code, like closing files or releasing resources. Thus, it Using a list as a stack, append() adds an item at the end
operates regardless of whether the exception is caught (top), while pop() removes the last element. The top of
or not. the stack is typically the final index, not index 0. Stacks
use Last-In, First-Out, meaning the most recently added
21. Which file access mode in Python opens a binary file for item is removed first.
appending?
24. How does prefix notation differ from postfix notation in
(A) ‘a’
(B) ‘ab’ expression evaluation with a stack?
(C) ‘w’ (A) Prefix places operators after operands, postfix
(D) ‘wb’ places them before
(B) Both place operators at the end
Ans (C) Prefix places operators before operands, postfix
(B) ‘ab’ places them after
In Python, ‘ab’ opens a binary file for appending, letting (D) Neither prefix nor postfix uses operators in the
you add new data at the end. ‘a’ opens a text file for expression
appending, while ‘w’ and ‘wb’ overwrite existing files Ans
before writing. Understanding these modes prevents
unintentional data loss and ensures proper handling of (C) Prefix places operators before operands, postfix
text versus binary content. places them after
In prefix (Polish) notation, each operator precedes its
22. Which statement is NOT true about reading files in operands, while postfix (Reverse Polish) notation follows
Python? them. Both formats allow stacks to manage evaluations
(A) ‘r’ mode opens a file for reading by default systematically. However, their scanning sequences
(B) read() returns the entire file content as a string differ, and code must handle the operator-operand
(C) A FileNotFoundError can occur if the file does not order properly for correct arithmetic interpretation.
exist
25. Which statements about queues are accurate?
(D) Using ‘rb’ mode automatically decodes text
encoding 1. They follow FIFO
2. enqueue() places an element at the rear
Ans 3. dequeue() removes an element from the front
(D) Using ‘rb’ mode automatically decodes text encoding 4. They follow LIFO
Opening a file in ‘rb’ reads bytes, not automatically (A) 1, 2, and 4
decoded text. Developers must manually decode if (B) 1, 2, and 3
needed. ‘r’ is the default read mode, read() pulls the (C) 2, 3, and 4
entire content, and Python can raise FileNotFoundError (D) 1, 3, and 4
Ans Ans
(B) 1, 2, and 3 (C) Retrieving items from an unsorted data list
Queues operate under First-In, First-Out ordering, Binary search requires sorted input to systematically
with enqueue() adding items at the rear and dequeue() halve the search space. In an unsorted list, comparing
removing them from the front. This design ensures against a midpoint doesn’t help discard irrelevant
the earliest element inserted is the first served. LIFO is portions. Thus, for unsorted data, binary search fails to
characteristic of stacks, not queues, making statement 4 provide meaningful shortcuts, making linear search or
incorrect in this context. sorting the data first the better approach.
26. Assertion (A) : A circular queue reuses empty positions 29. Which sorting algorithm repeatedly finds the minimum
from the front after items are dequeued. element and places it at the beginning of the list?
Reason (R) : In a simple linear queue, the front pointer (A) Insertion Sort
only moves forward, eventually wasting space. (B) Bubble Sort
(A) Both (A) and (R) are true, and (R) is the correct (C) Selection Sort
explanation of (A) (D) Merge Sort
(B) Both (A) and (R) are true, but (R) is not the correct Ans
explanation of (A)
(C) (A) is true, (R) is false (C) Selection Sort
(D) (A) is false, (R) is true Selection Sort scans the list to find the minimum
element, swapping it with the element at the current
Ans start position. It then repeats this process for the
(A) Both (A) and (R) are true, and (R) is the correct subsequent positions, gradually building a sorted sublist
explanation of (A) at the beginning. This approach is straightforward but
In a standard linear queue, once items are dequeued not highly efficient for large datasets.
from the front, that space can’t be reused unless the
30. Which sorting method is often praised for its average
queue is reset. A circular queue logically connects
the end to the front, making it possible to reuse freed efficiency in practical scenarios, using a divide-and-
locations. This solves the space-wasting limitation of conquer approach?
linear queues. (A) Merge Sort
(B) Bubble Sort
27. Why might sequential (linear) search be preferred over (C) Quick Sort
binary search in certain situations? (D) Selection Sort
(A) It always runs faster for large lists Ans
(B) It does not require sorted data
(C) It is less intuitive to implement (C) Quick Sort
(D) It avoids searching the entire list Quick Sort typically performs well with random data
due to its average O(n log n) complexity. It partitions the
Ans list around a pivot, recursively sorting sublists. Though
(B) It does not require sorted data its worst-case can be O(n^2), proper pivot selection and
Linear search simply checks each element in turn, average conditions often make it faster in practice than
so it can be applied to unsorted data sets. Binary other straightforward sorts.
search, though more efficient on sorted lists, becomes
31. Which measure indicates the most frequently occurring
inapplicable if elements are not in ascending or
descending order. For smaller or unsorted lists, linear value in a data set?
search may be simpler and sufficient. (A) Mean
(B) Median
28. Which situation does NOT indicate a good use of binary (C) Mode
search? (D) Variance
(A) Searching for a name in a sorted phonebook Ans
(B) Looking up a value in a sorted array
(C) Retrieving items from an unsorted data list (C) Mode
(D) Performing repeated lookups in a static sorted list
The mode identifies the most common or frequently 10 meters. This makes it ideal for peripherals like
appearing data point. Unlike the mean or median, headphones, speakers, or keyboards. Wi-Fi covers larger
which focus on central tendencies, the mode highlights areas, Ethernet is wired, and satellite communication is
repetition. For instance, if 10 appears more than any designed for very long-range data transmission.
other number, then 10 is the mode. Some distributions
35. Which statement best contrasts circuit switching with
may have multiple modes or none.
packet switching?
32. Why is standard deviation critical for understanding (A) Both require a dedicated communication path
data spread? (B) Circuit switching dynamically breaks data into
(A) It classifies data into categories packets
(B) It measures the central average of data (C) Packet switching does not need a dedicated path,
(C) It quantifies how much individual values deviate whereas circuit switching does
from the mean (D) Packet switching only applies to voice calls
(D) It automatically sorts the data Ans
Ans (C) Packet switching does not need a dedicated path,
(C) It quantifies how much individual values deviate whereas circuit switching does
from the mean Circuit switching establishes an exclusive channel for
Standard deviation calculates how far data points the call’s duration, as in traditional telephone networks.
typically lie from the average. A small standard deviation Packet switching segments data into packets that may
indicates tightly clustered values around the mean, while traverse different paths, optimizing network usage.
a large one reveals widespread variation. This measure This fundamental difference influences bandwidth
aids in judging consistency, identifying outliers, and allocation, cost, and flexibility in data communication
comparing variability across different datasets. systems.
33. Which of the following is NOT a standard statistical 36. Which of the following is NOT a common data
approach for measuring variability? communication protocol?
(A) Standard deviation (A) HTTP
(B) Range (B) IP
(C) Variance (C) SMTP
(D) Logarithm (D) FMT
Ans Ans
(D) Logarithm (D) FMT
Measures like standard deviation, range, and variance HTTP handles web requests, IP deals with addressing
gauge how widely data points spread around the mean and routing, and SMTP manages email transfers.
or among themselves. A logarithm is a mathematical FMT is not recognized as a core protocol for data
transformation often used for scaling data but is not itself communication. Using established protocols ensures
a measure of variability. Hence, it does not inherently standardized communication procedures, compatibility
indicate data dispersion. across devices, and seamless data exchange over
networks.
34. Which wireless technology commonly operates over
short distances to connect devices such as smartphones 37. Which malicious program often disguises itself as
and headphones? legitimate software but carries harmful code?
(A) Bluetooth (A) Trojan horse
(B) Wi-Fi (B) Worm
(C) Ethernet (C) Spyware
(D) Satellite (D) Rootkit
Ans Ans
(A) Bluetooth (A) Trojan horse
Bluetooth is a low-power, short-range standard for A Trojan horse pretends to be useful or benign but
exchanging data over distances typically within executes malicious operations once installed. Worms
replicate themselves, spyware gathers user data, and (C) Implementing file access permissions and regular
rootkits hide an intruder’s presence. Users must remain audits
cautious about unfamiliar downloads and employ Correct access permissions ensure only authorized
security software to detect such disguised threats. users can view or change sensitive data. Regular audits
detect anomalies and unauthorized access attempts.
38. Which term describes attempts to obtain sensitive Persistently staying logged in, saving passwords in
information by masquerading as a trustworthy entity plain text, or keeping default credentials compromise
via email or messaging? security, exposing networks to breaches or misuse by
(A) Phishing malicious actors.
(B) Pharming
(C) Spoofing Direction :Carefully read the case study provided and then
(D) DDoS thoroughly answer the subsequent five questions.
Ans Hillside University deployed MySQL to manage course
registrations and faculty assignments. Each student record
(A) Phishing featured a unique primary key, while a foreign key in the
Phishing attacks trick users into revealing credentials or enrollment table ensured valid references to each student.
financial details through fraudulent messages or websites For instance, a student_id was used to track individual
that appear authentic. Pharming redirects users to fake progress across various courses. Administrators set up
sites, spoofing alters data packets or email headers, and tables for courses, faculty, and classroom resources, linking
DDoS overloads servers. Recognizing phishing attempts them with carefully defined relationships. The university
helps prevent confidential information from being relied on SQL queries to handle tasks like checking how
exposed. many students were enrolled in each course and how many
39. How do antivirus programs typically detect malicious courses a single faculty member led. Regular backups were
software? maintained to safeguard critical academic data. This
(A) By matching code against a database of known database-driven approach accelerated the registration
signatures and using heuristic checks process, minimized data entry errors, and provided real-
(B) By monitoring only the memory usage in real time time enrollment statistics, all while ensuring strict data
(C) By blocking every incoming file with no scanning consistency across multiple tables and relationships.
(D) By allowing all scripts to run unrestricted 41. Which table likely contains a foreign key pointing to the
Ans primary key in the student table?
(A) By matching code against a database of known (A) Student table itself
signatures and using heuristic checks (B) Faculty table
Antivirus software examines data against a library of (C) Enrollment table
known malware signatures and also uses heuristic (D) Classroom resources table
algorithms to identify previously unknown or modified Ans
threats. Real-time scanning monitors file actions, (C) Enrollment table
memory, and network activities. Blocking everything In Hillside University’s setup, the enrollment table
would hamper normal operations, while unrestricted references the student table’s primary key to link each
script execution would risk undetected malware record to the correct student. This guarantees that
infiltration. no invalid student entries appear in enrollments. The
40. Which action best preserves the security of sensitive faculty and classroom resources tables serve different
data on a shared network? purposes, so their foreign keys typically point elsewhere.
(A) Leaving user accounts logged in constantly 42. Why did the university regularly back up the database?
(B) Storing all passwords in a visible text file (A) To slow down the system
(C) Implementing file access permissions and regular (B) To run multiple SELECT queries simultaneously
audits (C) To avoid data loss in cases of hardware failure or
(D) Allowing default admin/admin credentials mistakes
Ans (D) To prevent the creation of new faculty records
Ans
(A) To remove the concept of a front pointer entirely (B) It processes the newest request first
(B) To reuse dequeued space and prevent wasted (C) It ensures the earliest request is served before later
capacity arrivals
(C) To add priority-based ordering for each request (D) It sorts by agent preference
(D) To bypass exception handling in the main code Ans
Ans (C) It ensures the earliest request is served before later
(B) To reuse dequeued space and prevent wasted arrivals
capacity By enqueuing new requests and serving them from the
A circular queue links the end back to the beginning, front, the system guarantees that older requests receive
letting newly enqueued items occupy previously freed attention first. This prevents newer entries from jumping
positions. Without it, a linear queue’s front pointer can ahead, modeling a fair lineup. Consequently, users are
leave unused space behind as items are dequeued. This served in the order they arrive, consistent with standard
optimization preserves memory efficiency, especially FIFO logic.
during high volumes of incoming requests.
**************
48. Which best describes how the oldest service request is
handled once an agent becomes available?
(A) It is removed from the rear of the queue
(B) It is placed on hold
(C) It is dequeued from the front
(D) It is immediately turned into a stack
Ans
(C) It is dequeued from the front
Under FIFO policy, the earliest enqueued request resides
at the front of the queue. When a service agent is free,
that oldest request is removed (dequeued) first. This
ensures fairness and keeps processing in chronological
order, matching real-world scenarios like customer
support or scheduling tasks.
PRACTICE PAPER 13
1. In the context of relational databases, which of the prevent confusion or duplication, maintaining data
following best describes a domain? integrity while enabling reliable retrieval and updates.
(A) A collection of primary keys in a table
4. Which of the following is NOT a valid MySQL numeric
(B) The permissible set of values for an attribute
(C) A special database partition for temporary tables data type?
(D) The schema definition for all tables (A) INT
(B) FLOAT
Ans (C) DOUBLE
(B) The permissible set of values for an attribute (D) WORD
A domain is the valid set of possible values that an Ans
attribute can hold in a relational database. By restricting
the values an attribute can take, domains help maintain (D) WORD
data integrity and consistency, ensuring each attribute MySQL provides several numeric data types such as
conforms to established rules throughout the table and INT, FLOAT, and DOUBLE for handling integer and
database. floating-point values. WORD is not a numeric data
type in MySQL; it does not exist as a valid type within
2. Which SQL command is used to remove an entire table MySQL’s data definition language.
structure from the database along with its data?
5. What differentiates a DROP TABLE command from a
(A) DROP TABLE
(B) DELETE TABLE TRUNCATE TABLE command in SQL?
(C) TRUNCATE TABLE (A) DROP TABLE only removes rows but keeps
(D) REMOVE TABLE structure
(B) TRUNCATE TABLE removes structure and data
Ans permanently
(A) DROP TABLE (C) DROP TABLE removes structure and data;
The DROP TABLE command eliminates both the table TRUNCATE TABLE only removes rows
structure and its data from the database. DELETE only (D) Both remove structure and data equally
removes rows, TRUNCATE rapidly clears all rows but Ans
keeps the structure, and REMOVE TABLE is not a valid
SQL command. Hence, DROP TABLE is the correct and (C) DROP TABLE removes structure and data;
complete removal method. TRUNCATE TABLE only removes rows
In SQL, DROP TABLE erases the table definition and its
3. In MySQL, why is the concept of a primary key critical data. TRUNCATE TABLE quickly deletes all rows but
for every relational table? retains the table’s structure for future use. They serve
(A) It allows duplicate rows for more flexibility different needs: full removal of a table or clearing rows
(B) It ensures each row can be uniquely identified efficiently while preserving schema.
(C) It prevents user access to sensitive data
6. Arrange the following network evolutions in
(D) It always improves query speed significantly
chronological order:
Ans 1. ARPANET
(B) It ensures each row can be uniquely identified 2. World Wide Web
A primary key enforces uniqueness within a table, 3. NSFNET
allowing each record to be distinctly identified. This 4. Email introduced
facilitates accurate data referencing and efficient (A) 1 → 3 → 2 → 4
relationships across multiple tables. Primary keys also (B) 4 → 1 → 3 → 2
15. Which of the following statements about a stack are (B) 1, 2, 4, and 5 only
correct? In MySQL, NOW() returns the current date and time,
1. It follows LIFO (Last-In, First-Out) principle. YEAR() extracts the year, MONTHNAME() provides
2. PUSH operation adds an item to the top. the month’s name, and DAYNAME() gives the weekday
3. POP operation removes an item from the bottom. name. MINUTE() is valid, but as a Time function that
4. Stacks can be implemented using lists in Python. extracts minutes from a datetime, not typically listed
(A) 1, 2, and 4 are correct under basic Date-only functions.
(B) 2 and 3 are correct
18. Assertion (A) : Union operation in relational algebra
(C) 1, 3, and 4 are correct
(D) 1, 2, and 3 are correct combines all rows from two relations without duplicates.
Reason (R) : Intersection operation includes only rows
Ans present in both relations.
(A) 1, 2, and 4 are correct (A) Both (A) and (R) are true, and (R) is the correct
A stack is a LIFO structure, where PUSH adds to the top explanation of (A).
and POP removes from the top. Python lists can easily (B) Both (A) and (R) are true, but (R) is not the correct
implement stacks using append() and pop(). Statement explanation of (A).
3 is incorrect because the item is removed from the top, (C) (A) is true, but (R) is false.
not the bottom. (D) (A) is false, but (R) is true.
Expand Your Reach: Your readers can share these PDFs on other platforms, helping your
influence grow exponentially.
Still not convinced? Ask us how, and we’ll walk you through exactly how it works.
Best of all: It’s completely free—no hidden charges.
(D) Decreasing Queue In bubble sort, each pass compares adjacent pairs across
Ans the entire list. If every pass needs to traverse almost the
entire array, the total comparisons grow as n(n-1)/2,
(C) Double-Ended Queue (DQueue) simplifying to O(n²). This quadratic behavior arises in
A double-ended queue supports insertion and deletion the worst-case or unsorted scenarios.
operations at both ends. Circular queues optimize space
usage for standard queues, while priority queues insert 24. Which search strategy is generally the most efficient for
elements based on priority, not position. Decreasing large sorted data sets?
queue is not a standard term in basic queue operations. (A) Linear Search
(B) Binary Search
21. In searching algorithms, what is the key difference (C) Fibonacci Search
between Sequential Search and Binary Search? (D) Sequential Search
(A) Sequential Search requires sorted data
(B) Binary Search does not need sorted data Ans
(C) Binary Search repeatedly halves the search space (B) Binary Search
(D) Sequential Search uses recursion by default For large sorted datasets, binary search outperforms
Ans linear and sequential searches by repeatedly dividing
the search interval by two. While Fibonacci search is
(C) Binary Search repeatedly halves the search space also effective for specific cases, binary search remains
Binary Search relies on sorted data and methodically the standard method due to ease of implementation and
divides the search interval in half after each comparison, stable logarithmic performance.
significantly reducing comparisons. Sequential Search
checks each element linearly and does not need the 25. How does a stack differ from a queue in terms of data
data sorted. Thus, halving the search space is the major removal?
distinction. (A) Both remove data from the bottom
(B) A stack removes data from the top, while a queue
22. Which of the following is NOT a valid Python built-in removes data from the front
exception? (C) A stack removes data from the front, while a queue
(A) ValueError removes data from the rear
(B) KeyError (D) Both remove data from the top
(C) MemoryError
(D) NotFoundError Ans
Ans (B) A stack removes data from the top, while a queue
removes data from the front
(D) NotFoundError A stack is a Last-In, First-Out structure removing
Python provides built-in exceptions like ValueError, elements from the top. A queue is First-In, First-Out,
KeyError, and MemoryError for various error removing elements from the front. This fundamental
conditions. NotFoundError is not a standard built-in difference shapes their application in scenarios requiring
Python exception. Programmers can create a similar distinct ordering of operations.
exception manually, but it does not exist by default in
Python’s exception hierarchy. 26. Which relational algebra operation returns only the
tuples present in both relations?
23. Why does bubble sort have a worst-case time complexity (A) Union
of O(n²)? (B) Intersection
(A) It always needs extra space proportional to n² (C) Set Difference
(B) It requires up to n-1 passes, each involving (D) Cartesian Product
comparisons of adjacent elements
(C) It creates n² new arrays in memory Ans
(D) It divides the list into two halves recursively (B) Intersection
Ans The intersection operation yields the rows (tuples)
present in both relations. Union merges tuples from
(B) It requires up to n-1 passes, each involving both without repetition, set difference subtracts the
comparisons of adjacent elements
tuples of one from another, and the cartesian product 30. Which term refers to malicious software designed
forms all possible pairs of tuples from two relations. to replicate itself and spread from one computer to
1. 27. Conceptual Understanding another?
(A) Worm
27. In MySQL, which clause is used to filter groups of data (B) Trojan horse
after a GROUP BY clause has been applied? (C) Adware
(A) WHERE (D) Spyware
(B) ORDER BY
(C) HAVING Ans
(D) DISTINCT (A) Worm
Ans A computer worm is self-replicating malware capable of
spreading independently across networks. Trojan horses
(C) HAVING deceive users into executing them, adware displays
The HAVING clause is specifically designed to unwanted advertisements, and spyware covertly gathers
filter aggregated results following a GROUP BY user information. Worms differentiate themselves by
operation. WHERE applies filters to individual rows their autonomous propagation mechanisms.
before grouping, ORDER BY sorts the result set, and
DISTINCT removes duplicate rows but does not filter 31. Which of the following is NOT a valid file access mode
grouped data like HAVING does. in Python?
(A) rw
28. Which topology connects all devices along a single (B) r
shared cable, with each device tapping into the line? (C) a
(A) Star topology (D) w+
(B) Bus topology
(C) Ring topology Ans
(D) Mesh topology (A) rw
Ans Python supports multiple file modes, including r for
reading, w for writing (overwrite), a for appending,
(B) Bus topology and w+ for writing and reading. However, rw is not a
In a bus topology, every device attaches to one valid built-in mode identifier. Similar functionality can
continuous cable, and data signals pass through this be achieved but requires specifying proper read/write
shared medium. Star topology uses a central hub or modes like r+ or w+.
switch, ring topology connects devices in a loop, and
mesh topology interlinks devices with multiple direct 32. Which exception is raised when a sequence subscript is
paths. out of range in Python?
(A) NameError
29. Which of these is NOT a recognized switching technique (B) TypeError
in data communication? (C) IndexError
(A) Circuit switching (D) IOError
(B) Message switching
(C) Packet switching Ans
(D) Token switching (C) IndexError
Ans Python raises IndexError when an index is outside the
valid range for a list, tuple, or string. NameError occurs
(D) Token switching when a variable is not defined, TypeError emerges when
Common switching techniques include circuit switching an operation is applied to an incompatible object type,
(dedicated path), message switching (store-and- and IOError arises with file or I/O operations.
forward of entire messages), and packet switching (data
broken into packets). Token switching is not a standard 33. Which structure is best suited for implementing
switching technique, although token passing exists as a recursive function call tracking?
channel access method in certain ring networks. (A) Queue
(B) Stack
(C) Dictionary
(C) It is based on Last-In, First-Out, with the newest (C) To maintain referential integrity between related
accessed book on top data
A stack places the most recently accessed item at the A foreign key references a primary key in another
top, making that item the first to be recalled. This is table, enforcing consistent linkages across related
the essence of LIFO ordering, suitable for a recently datasets. This prevents orphaned records and preserves
accessed list, where the last accessed item is displayed meaningful relationships. It does not automatically
first. overwrite data, strictly deals with referencing, and is
unrelated to encryption layout.
45. Which networking consideration is crucial for ensuring
librarians can safely connect from remote locations? 47. Why might the startup use a stack for managing real-
(A) Using an unencrypted public network time notifications?
(B) Implementing secure protocols or VPN solutions (A) First-In, First-Out ordering suits notifications
(C) Eliminating authentication requirements perfectly
(D) Disabling firewalls for convenience (B) Latest notifications are displayed first, leveraging
Ans LIFO
(C) Stacks eliminate the oldest notification first
(B) Implementing secure protocols or VPN solutions (D) It ensures the earliest messages remain visible until
Security in remote connections typically requires read
protocols like SSH, HTTPS, or a VPN to encrypt data
and protect information from eavesdropping. Public Ans
networks without encryption, no authentication, or (B) Latest notifications are displayed first, leveraging
firewall removal would expose library data to significant LIFO
risks. A stack uses Last-In, First-Out ordering. The most
recent notification is placed on top, so users see new
Direction :Carefully read the case study provided and then notifications first. This approach is often adopted
thoroughly answer the subsequent five questions. in alerts or pop-up notifications, where the most
A startup that offers home delivery services employs immediate items should be most visible.
Python for back-end automation and database handling.
They rely on both stacks for managing real-time 48. Which data structure is best for serving customers’
notifications and queues for organizing delivery orders. delivery orders in the sequence they arrive?
MySQL stores customer details, order statuses, and route (A) Stack
information in multiple tables, linked by foreign keys. (B) Queue
The system further utilizes searching algorithms to find (C) Tree
addresses quickly and sorting algorithms to sequence (D) Hash Table
deliveries by priority. Network connectivity and secure Ans
protocols protect sensitive transaction data, ensuring safe
interactions between customers, delivery personnel, and (B) Queue
the central database. As the service expands, database A queue processes elements in the order they enter—
optimization, efficient data structures, and robust First-In, First-Out. This is perfect for sequential tasks
network security become even more important. like serving delivery orders by arrival time. A stack
would reverse the order, while trees and hash tables
46. What is the primary reason for using foreign keys across serve different organizational purposes unsuited to
multiple tables in the startup’s database? queue-based scheduling.
(A) To arrange data for encryption
49. Which searching method offers faster lookups if the
(B) To allow each table to share primary key values
identically addresses are already alphabetically sorted?
(C) To maintain referential integrity between related (A) Linear Search
data (B) Binary Search
(D) To overwrite existing data in other tables (C) Bubble Search
automatically (D) Sequential Search
Ans Ans
(B) Binary Search
**************
PRACTICE PAPER 14
1. In relational databases, what is a tuple? accurate links across tables. Uniqueness constraints,
(A) A column definition within a table encryption, or database merges are separate design or
(B) A single row or record in a table security considerations.
(C) A combination of primary keys in two tables
4. Which of the following MySQL text functions does
(D) A database backup file
NOT exist?
Ans (A) UCASE()
(B) A single row or record in a table (B) MID()
In relational database terminology, each row of a table (C) LTRIM()
is called a tuple. It represents a single, ordered record. (D) CHARUPPER()
Columns are called attributes, and multiple primary Ans
keys across different tables involve relationships, not
tuples. Backup files are separate from relational table (D) CHARUPPER()
data definitions. MySQL includes functions such as UCASE()/
UPPER(), MID(), and LTRIM() to manipulate text.
2. Which one of the following SQL commands is classified CHARUPPER() is not a recognized MySQL function.
as DDL (Data Definition Language)? The valid function to convert strings to uppercase is
(A) SELECT UCASE() or UPPER(), whereas MID() and LTRIM()
(B) UPDATE handle substring extraction and leading space removal,
(C) ALTER TABLE respectively.
(D) INSERT
5. Which statement compares stack and queue data
Ans structures accurately?
(C) ALTER TABLE (A) Both remove elements from the front
SQL’s DDL commands manage structure. ALTER (B) Stack uses LIFO; queue uses FIFO
TABLE modifies an existing table’s structure. SELECT (C) Stack uses FIFO; queue uses LIFO
is a query (DQL), UPDATE and INSERT are DML (D) Both insert elements only at one end
(Data Manipulation Language). Hence, ALTER TABLE Ans
belongs to the Data Definition Language category,
impacting the schema rather than just the data. (B) Stack uses LIFO; queue uses FIFO
Stacks operate on a Last-In, First-Out principle,
3. Why is a FOREIGN KEY integral for linking two removing elements from the top last placed. Queues
relational tables? employ First-In, First-Out, removing elements from
(A) It enforces unique constraints on each row the front that were inserted first. They differ primarily
(B) It automatically encrypts sensitive data in how items are removed, influencing their usage
(C) It references the PRIMARY KEY in another table to scenarios.
maintain referential integrity
6. Arrange these database operations in the order they
(D) It merges distinct databases into one
typically occur in a simple scenario:
Ans 1. INSERT new records
(C) It references the PRIMARY KEY in another table to 2. CREATE a table
maintain referential integrity 3. SELECT data
A foreign key references a primary key or candidate 4. DROP the table
key in a different table, ensuring valid, consistent (A) 2 → 1 → 3 → 4
relationships. This prevents orphan data and safeguards (B) 1 → 2 → 3 → 4
4. TIME() returns only the date part statement 5 is incorrect in naming, so only options 1, 2,
(A) 1 and 2 are correct 3, and 4 are correct.
(B) 1, 2, and 3 are correct
18. Assertion (A) : Selection sort uses minimal swaps
(C) 2, 3, and 4 are correct
(D) 1 and 4 are correct compared to bubble sort.
Reason (R) : Selection sort always places the correct
Ans element in its final position with each outer loop pass.
(A) 1 and 2 are correct (A) Both (A) and (R) are true, and (R) is the correct
DATE() returns only the date portion, and TIME() explanation of (A).
extracts only the time portion. Thus, statements (B) Both (A) and (R) are true, but (R) is not the correct
claiming DATE() includes hour or TIME() returns date explanation of (A).
are incorrect. MySQL separates the components neatly, (C) (A) is true, but (R) is false.
letting you isolate date or time from a combined value. (D) (A) is false, but (R) is true.
1. 16. Combination (4-Statement) Ans
16. Regarding bubble sort, which of these statements are (A) Both (A) and (R) are true, and (R) is the correct
true? explanation of (A).
1. It is comparison-based Selection sort selects the minimum element in each pass
2. Best-case complexity is O(n) and swaps it with the element at the sorted boundary
3. Worst-case complexity is O(n²) only once. This leads to fewer swaps than bubble sort.
4. It uses a pivot for partitioning Each pass definitively places an element in its correct
(A) 1, 2, and 3 are correct location, affirming both statements.
(B) 1 and 4 are correct
19. Assertion (A) : Firewalls inspect inbound traffic only.
(C) 2, 3, and 4 are correct
(D) 1, 3, and 4 are correct Reason (R) : Firewalls filter traffic based on predefined
security rules.
Ans (A) Both (A) and (R) are true, and (R) is the correct
(A) 1, 2, and 3 are correct explanation of (A).
Bubble sort compares adjacent elements, making it (B) Both (A) and (R) are true, but (R) is not the correct
comparison-based. It has a best-case of O(n) (already explanation of (A).
sorted lists) and a worst-case of O(n²). It does not use a (C) (A) is true, but (R) is false.
pivot for partitioning; that concept typically belongs to (D) (A) is false, but (R) is true.
quicksort, not bubble sort. Ans
17. Which of the following are valid text functions in (D) (A) is false, but (R) is true.
MySQL? Firewalls manage and filter both inbound and outbound
1. UCASE() traffic following security guidelines. The assertion that
2. LOWER() they only inspect inbound traffic is incorrect. The reason
3. MID() statement is true, as firewalls do rely on predefined rules
4. INSTR() to allow or block traffic in either direction.
5. CONCATENATE()
20. Which aggregate function in MySQL returns the
(A) 1, 2, 3, and 4 only
(B) 1, 3, 4, and 5 only number of rows in a result set, including duplicates?
(C) 1, 2, 4, and 5 only (A) SUM()
(D) 1, 2, 3, 4, and 5 (B) COUNT(*)
(C) MAX()
Ans (D) AVG()
(A) 1, 2, 3, and 4 only Ans
UCASE() (or UPPER()), LOWER() (or LCASE()), MID()
(or SUBSTRING()), and INSTR() are valid MySQL text (B) COUNT(_)
functions. CONCAT() is the MySQL function for string COUNT(_) counts all rows in a table or query result
concatenation, not CONCATENATE(). Therefore, set, even if duplicates exist. SUM() aggregates numeric
column values, MAX() finds the highest value, and
AVG() computes the average. Hence, COUNT(*) is 24. Which searching method is best suited for small,
specifically used for counting total rows. unsorted lists where simplicity is preferred over speed?
(A) Binary Search
21. What is the primary goal of exception handling in (B) Sequential Search
Python? (C) Fibonacci Search
(A) To automatically correct all coding mistakes (D) Exponential Search
(B) To provide a mechanism to respond gracefully to
runtime errors Ans
(C) To log all errors silently without user notification (B) Sequential Search
(D) To slow program execution and detect memory For small, unsorted datasets, sequential (linear) search
issues is straightforward and easy to implement, despite being
Ans O(n) in time complexity. Binary and Fibonacci searches
require data to be sorted, and exponential search is more
(B) To provide a mechanism to respond gracefully to complex, offering benefits mainly on larger datasets.
runtime errors 1. 25. Comparison/Contrast
Exception handling in Python ensures that unexpected
errors can be managed without crashing the entire 25. How does a stack differ from a double-ended queue
application. It doesn’t fix coding errors automatically (DQueue)?
nor necessarily slow the program. Properly handled (A) Both allow insertion and removal only at the front
exceptions can offer helpful messages or alternative (B) A stack is LIFO, while a DQueue allows insertions/
flows, preserving program stability. removals at both ends
(C) A DQueue supports LIFO exclusively, while a stack
22. Which of these is NOT a recognized Python file mode? uses FIFO
(A) rb (D) They function identically but have different
(B) ab terminologies
(C) xb
(D) ob Ans
(A) It is a random number generated at boot (D) The frequency of the most common value
(B) It is assigned by a router every time a device Ans
connects
(C) It serves as a hardware identifier burned in by the (C) The average squared deviation from the mean
manufacturer Variance is calculated by averaging the squared
(D) It changes when you clear your browser’s cache differences between each data point and the mean.
This indicates how spread out or concentrated the data
Ans distribution is. It does not measure range, typical absolute
(C) It serves as a hardware identifier burned in by the deviations from the median, or mode frequency.
manufacturer
31. Which of the following is NOT an aspect of Python’s
MAC addresses are globally unique identifiers assigned
to network interfaces, encoded by manufacturers, try-except mechanism?
ensuring no two devices share the same address (A) Automatic variable declaration
within a local environment. They do not change with (B) Handling raised exceptions
router settings or browser cache and are not randomly (C) Attempting code in the try block
regenerated. (D) Optional else or finally blocks
Ans
28. Which network topology connects each node to two
other nodes, forming a closed loop? (A) Automatic variable declaration
(A) Ring topology Python’s try-except system manages exceptions by
(B) Bus topology attempting code inside try, catching errors in except,
(C) Star topology and optionally using else or finally blocks. It does
(D) Tree topology not automatically declare variables. Variables must
be declared (assigned) before usage; the try-except
Ans mechanism is about error handling, not variable
(A) Ring topology declarations.
In a ring topology, each device has exactly two
32. Which built-in Python function is used to read text lines
neighbors, creating a continuous loop of data flow. Bus
topology relies on one central cable, star topology uses a from a file object?
central hub, and tree topology is a hierarchical blend of (A) readlines()
star and bus designs. (B) readnums()
(C) readall()
29. Which of the following is NOT a known threat to (D) readlist()
network security? Ans
(A) Eavesdropping
(B) Trojan horse (A) readlines()
(C) Denial of Service (DoS) In Python, readlines() returns a list of all lines from
(D) Open Source an open text file. Alternatives like readline() retrieve a
single line, and read() retrieves the entire file content
Ans as a string. readnums() and readlist() are not standard
(D) Open Source built-in Python file-reading functions.
Eavesdropping, Trojan horses, and Denial of Service 1. 33. Best Answer
attacks are well-known network security threats.
33. Which type of queue is most appropriate for
Open Source typically refers to software licensing and
development methodology, not a malicious threat. implementing job scheduling where priorities must be
While open-source code can have vulnerabilities, it is respected?
not classified as a direct network security threat. (A) Circular Queue
(B) Priority Queue
30. What does the term data variance measure in a dataset? (C) Double-Ended Queue
(A) The difference between the maximum and (D) Linear Queue
minimum values Ans
(B) The average of absolute deviations from the median
(C) The average squared deviation from the mean (B) Priority Queue
A priority queue arranges items based on designated The mean reveals the central tendency, and the variance
priorities, ensuring critical tasks are processed first. (or its square root, standard deviation) indicates data
Circular or linear queues follow FIFO, double-ended spread around the mean. Though other pairs can
queues allow insertion and removal at both ends, but do be useful in specific scenarios, mean-variance (or
not inherently handle differing priority levels. mean-standard deviation) is a classic combination for
quantitative analysis.
34. Why does selection sort have a time complexity of O(n²)
even though it performs fewer swaps? 37. Why is TRIM() used in MySQL text operations?
(A) It requires nested loops to find the minimum in (A) To replace characters within a string
each pass (B) To remove leading or trailing spaces
(B) It uses recursion intensively (C) To duplicate strings a specified number of times
(C) It sorts the list in place using extra arrays (D) To compare two strings for equality
(D) It creates multiple sorted sublists Ans
Ans (B) To remove leading or trailing spaces
(A) It requires nested loops to find the minimum in TRIM() eliminates unwanted whitespace at the
each pass start or end of a string, ensuring data is clean and
Selection sort finds the smallest element by scanning all consistent. It does not handle in-string replacements,
remaining items, resulting in nested looping over the string duplication, or direct comparisons. TRIM()
data. While it performs fewer swaps than bubble sort, is particularly useful to standardize user inputs with
the process of identifying the minimum each time still potential extra spaces.
leads to O(n²) comparisons overall.
38. Which network device routes data between different
1. 35. Comparison/Contrast
networks using IP addresses?
35. How does insertion sort differ from bubble sort in its (A) Switch
approach? (B) Router
(A) Insertion sort always places the largest element at (C) Hub
the end in each pass (D) Repeater
(B) Bubble sort shifts elements backward in a partially Ans
sorted list
(C) Insertion sort picks the next element and inserts it (B) Router
into the correct place in the already sorted sublist A router directs data packets between networks based
(D) Bubble sort’s best-case complexity is O(log n) on their IP addresses. Switches forward frames within
a local network segment using MAC addresses, hubs
Ans broadcast signals to all ports, and repeaters regenerate
(C) Insertion sort picks the next element and inserts it signals but do not handle advanced routing decisions.
into the correct place in the already sorted sublist
39. How do circuit switching and packet switching differ for
In insertion sort, each new element is compared with
elements in the sorted sublist and inserted in the data communication?
appropriate position. Bubble sort focuses on bubbling (A) Circuit switching uses store-and-forward for entire
up out-of-order elements via repeated adjacent swaps. messages, packet switching uses dedicated paths
Insertion sort’s best-case is O(n), not bubble sort’s. (B) Packet switching establishes a constant data path,
circuit switching breaks messages into packets
36. When analyzing a dataset’s central tendency and spread, (C) Circuit switching creates a dedicated channel for
which pair of statistical measures is commonly used the duration of a transmission, whereas packet
together? switching splits data into packets for transmission
(A) Mean and variance on shared channels
(B) Median and mode (D) Both rely on indefinite open connections
(C) Mode and standard deviation Ans
(D) Range and frequency
(C) Circuit switching creates a dedicated channel for the
Ans duration of a transmission, whereas packet switching
(A) Mean and variance
splits data into packets for transmission on shared Foreign keys connect related tables by referencing a
channels primary key in another table. This ensures consistent
Circuit switching reserves a continuous path for the and valid relationships, preventing orphaned records.
entire communication, while packet switching breaks Foreign keys do not automatically remove duplicates
data into smaller units that traverse shared routes or bypass concurrency. They guarantee correct data
dynamically. This distinction significantly impacts linkage between relevant database entities.
resource usage, efficiency, and reliability.
42. Which data structure is best suited to keep a record of
40. Which security measure specifically protects data by the most recently accessed student records?
transforming it into an unreadable format, requiring a (A) Queue
key to decode? (B) Stack
(A) Antivirus (C) Tree
(B) Encryption (D) Priority Queue
(C) Firewall Ans
(D) MAC Address
(B) Stack
Ans A stack uses Last-In, First-Out ordering. Adding a newly
(B) Encryption accessed record to the top means it becomes the first
Encryption scrambles data into an unreadable cipher item to appear when reviewing history. This approach
text, only accessible using the correct decryption key. naturally fits recently accessed functionality, where the
Antivirus detects and removes malware, a firewall filters most recently visited record sits atop the stack.
traffic based on rules, and a MAC address identifies
43. How does robust network security benefit the school’s
a network interface card. Thus, encryption ensures
confidentiality of transmitted or stored data. data handling?
(A) It automatically deletes all logs monthly
Direction :Carefully read the case study provided and then (B) It allows external access with no authentication
thoroughly answer the subsequent five questions. (C) It blocks unauthorized intrusions and protects
A local school manages student records, attendance, and sensitive information
fee transactions using a MySQL database. Various tables (D) It prevents staff from updating any records
store personal details, fee information, and attendance Ans
logs. Relationships between these tables rely on foreign
keys to ensure data consistency. Python scripts handle (C) It blocks unauthorized intrusions and protects
day-to-day updates, using exception handling to manage sensitive information
any runtime issues during data entry or retrieval. Stacks Network security measures, such as firewalls,
are used to maintain a history of accessed records, while encryption, and secure authentication, safeguard
queues manage form submissions in a first-in, first-out confidential student data from malicious access. They
sequence. Secure connections and robust network policies do not remove legitimate logs, and they do not prohibit
help keep student data protected from external threats. authorized staff from updates. Instead, they shield the
Overall, this integrated system simplifies administration system from illegitimate external threats.
and reduces manual errors. 44. Why might queue management be useful for processing
41. Why are foreign keys used among the school’s various form submissions?
tables? (A) Submissions are handled in a Last-In, First-Out
(A) They allow adding unlimited rows in any table manner
(B) They link records across tables to maintain (B) They sort submissions alphabetically by default
referential integrity (C) They handle the earliest forms first in a First-In,
(C) They remove duplicates automatically First-Out manner
(D) They disable concurrency controls (D) They automatically merge duplicate forms
Ans Ans
(B) They link records across tables to maintain referential (C) They handle the earliest forms first in a First-In,
integrity First-Out manner
A queue ensures form requests are processed in the same (C) It follows First-In, First-Out, meaning earlier tasks
order they arrive. The earliest submission in the queue are addressed first
is processed first, providing a fair sequence. It does not A queue schedules tasks in the exact sequence they
sort them alphabetically or merge duplicates. FIFO is arrive, aligning with FIFO operations. New tasks move
ideal for managing consecutive, time-based requests. to the queue’s rear, and earlier tasks exit from the front,
ensuring fairness in task scheduling and preventing
45. Which aspect of Python’s exception handling might newer tasks from overtaking previously created ones.
be most relevant if a database connection fails during
attendance updates? 47. What is the primary role of stacks in the application’s
(A) Using a try block around the connection code and undo/redo functionality?
an except block for connection-related errors (A) They require tasks to be processed in arrival order
(B) Letting the program terminate immediately (B) They store database credentials
(C) Hiding the error messages from administrators (C) They maintain a LIFO structure to revert or reapply
(D) Enabling the code to run without any error checks changes
Ans (D) They compress large files before saving
(A) Using a try block around the connection code and Ans
an except block for connection-related errors (C) They maintain a LIFO structure to revert or reapply
By enclosing connection operations in a try block and changes
catching database-specific exceptions in an except block, Undo/redo systems often store recent operations on
Python can gracefully handle failures without crashing. a stack, reversing changes in the opposite order they
This approach informs administrators about the issue were performed. Once undone, redoing actions can
and potentially retries or logs the error, maintaining also follow the LIFO principle on a separate stack. This
system stability. approach effectively tracks recent modifications for user
convenience.
Direction :Carefully read the case study provided and then
thoroughly answer the subsequent five questions. 48. Which MySQL function can display only the month
A software firm develops an application that tracks name from a date column, such as ‘July’?
employee tasks and deadlines. The system uses MySQL (A) DAY()
to store each task’s details, including start and end dates, (B) MONTH()
which are filtered and aggregated using date functions. (C) MONTHNAME()
Data structures like queues help schedule tasks in the (D) YEAR()
order received, while stacks assist in undo/redo features. Ans
Python exceptions are carefully handled to ensure that
if a file write fails, the app notifies users rather than (C) MONTHNAME()
shutting down unexpectedly. On the networking side, MONTHNAME() extracts and returns the full month
employees connect to the server from various locations, name, for example, July. DAY() returns day of the
secured by VPN protocols. As the system grows, the firm month, MONTH() gives the numeric month (like
continuously refines sorting algorithms for efficient data 7), and YEAR() returns the year component. Thus,
output and invests in robust network safeguards against MONTHNAME() is specifically suited to retrieving the
malicious attacks. text representation of the month.
**************
PRACTICE PAPER 15
1. Which key in a relational database uniquely identifies in queries that require precise row-level condition
each record in a table? checks.
(A) Foreign key
4. Which of the following best describes the function of
(B) Alternate key
(C) Primary key the SELECT statement in SQL?
(D) Candidate key (A) Modifies table structure
(B) Extracts data from tables
Ans (C) Deletes rows from tables
(C) Primary key (D) Updates existing rows in tables
A primary key guarantees that each row is uniquely Ans
identified by prohibiting duplicate values. It cannot
contain NULL and ensures entity integrity. By serving (B) Extracts data from tables
as a unique identifier, it allows developers and database The SELECT statement is used to retrieve data stored in
systems to reference a specific row accurately and one or more tables based on specified criteria. It allows
maintain clear relational connections among tables. data analysts and developers to query specific columns
and rows. This retrieval mechanism is fundamental for
2. Which relational algebra operation is used to extract analysis, reporting, and data manipulation tasks.
specific columns from a table?
5. Which SQL keyword is NOT part of the Data
(A) Union
(B) Cartesian product Manipulation Language (DML)?
(C) Projection (A) INSERT
(D) Selection (B) SELECT
(C) UPDATE
Ans (D) DROP
(C) Projection Ans
Projection retrieves specified columns from a relation,
effectively filtering the dataset by vertical slices. This is (D) DROP
distinct from Selection, which filters rows. Projection DML involves actions like INSERT, UPDATE, and
helps isolate needed attributes for further processing, SELECT that manipulate data. DROP belongs to Data
thereby streamlining data handling and querying for Definition Language (DDL), which deals with altering
more efficient management in relational databases. or removing database structures. Confusing DML with
DDL can lead to structural changes rather than simply
3. In MySQL, which clause is used to restrict rows returned manipulating data content.
by a query based on a specified condition?
6. Which is the best example of a DDL statement for
(A) GROUP BY
(B) ORDER BY changing a column’s data type in an existing table
(C) HAVING Students?
(D) WHERE (A) ALTER TABLE Students MODIFY ColumnName
NewDataType;
Ans (B) SELECT * FROM Students WHERE
(D) WHERE ColumnName=’NewDataType’;
The WHERE clause filters rows from a table that meet (C) INSERT INTO Students VALUES (‘NewDataType’);
specified criteria before grouping or other operations (D) UPDATE Students SET
occur. It is central to narrowing large datasets, ensuring ColumnName=’NewDataType’;
only matching records are returned. WHERE is essential Ans
(A) ALTER TABLE Students MODIFY ColumnName A ring topology forms a continuous circular data path.
NewDataType; Each node connects to exactly two others, creating
DDL (Data Definition Language) manages schema a loop. Data typically travels in one direction until
definitions and structural changes. ALTER TABLE with it reaches the target node. Though simpler for some
MODIFY (or CHANGE in some SQL dialects) adjusts scenarios, a single node failure can disrupt the entire
the column data type. Unlike DML statements like loop.
UPDATE, which alters data values, ALTER modifies the
10. Arrange the evolution of computer networks in
table’s structure directly.
chronological order from earliest to latest:
7. Which network type typically spans a small geographic 1. ARPANET
area like a single building or campus? 2. Internet expansion
(A) LAN 3. Email introduction
(B) WAN 4. Social media dominance
(C) MAN (A) 1 → 3 → 2 → 4
(D) Internet (B) 3 → 1 → 4 → 2
Ans (C) 1 → 4 → 3 → 2
(D) 3 → 2 → 1 → 4
(A) LAN
A Local Area Network (LAN) connects computers Ans
within a confined area, such as an office or campus, (A) 1 → 3 → 2 → 4
using high-speed transmission. It generally offers faster ARPANET appeared first in late 1960s, followed by
data transfer and lower latency compared to broader email in the early 1970s. The broader Internet expansion
networks like WAN or MAN. LAN is ideal for localized occurred in the 1980s and early 1990s, and finally
resource sharing. social media platforms started dominating the digital
landscape in the 2000s onward.
8. Which statement best differentiates a modem from a
router in networking? 11. Which Python statement is used to handle exceptions
(A) Both strictly convert analog signals to digital that might occur during execution?
(B) A modem shares data across internal nodes while a (A) while
router translates signals (B) def
(C) A router directs data between networks; a modem (C) try-except
converts analog signals to digital (D) return
(D) Both primarily manage wireless connectivity Ans
Ans (C) try-except
(C) A router directs data between networks; a modem The try-except block captures and manages exceptions
converts analog signals to digital that arise in code, allowing alternative paths or corrective
A router forwards packets among different networks actions. By catching runtime errors gracefully, programs
using addressing, while a modem modulates and avoid abrupt termination, thus improving robustness
demodulates signals for internet connectivity over and user experience.
telephone or cable lines. These roles are distinct though
12. Which built-in Python exception is raised when a
both devices often coexist in a network infrastructure.
function or operation receives an argument of the
9. In computer networks, which topology arranges each correct type but an inappropriate value?
node in a closed loop, allowing data to circulate in one (A) KeyError
direction? (B) ValueError
(A) Star (C) TypeError
(B) Ring (D) IndexError
(C) Bus Ans
(D) Tree
(B) ValueError
Ans ValueError occurs when an argument with an otherwise
(B) Ring valid type has an invalid value. For example, int(‘abc’)
13. Which Python file access mode is used solely for writing Ans
to a file, creating it if it does not exist, and truncating (C) POP
existing content? POP deletes and returns the top element from the stack.
(A) ‘r’ It is the counterpart to PUSH, which inserts an element
(B) ‘w’ onto the top. Together, these operations enforce LIFO
(C) ‘a’ behavior, forming the fundamental basis of stack usage
(D) ‘r+’ in algorithms and systems.
Ans 17. Which notation is evaluated from left to right, with
(B) ‘w’ operators following their operands, and requires a stack
Mode ‘w’ opens a file for writing. If the file doesn’t exist, for parsing?
it’s created; if it does exist, its contents are removed (A) Infix
before writing begins. This ensures a fresh start for (B) Prefix
writing operations, distinguishing it from ‘a’ (append) (C) Postfix
or ‘r’ (read). (D) Mixed notation
(C) Serialize and deserialize Python objects 18. Which data structure follows the First-In, First-Out
The pickle module in Python serializes objects into a byte principle?
stream for storage and later recovery (deserialization). (A) Stack
This is invaluable for saving complex data types like (B) Binary Tree
lists, dictionaries, or custom classes without manually (C) Queue
implementing conversion logic. (D) Heap
removes an item from the front. Together, they maintain (B) Item not found, leading to end of search
the strict FIFO order crucial for typical queue-based (C) Item found at the second element
algorithms and processes. (D) Item discovered after minimal checks
20. Arrange the steps for deleting an element from a queue Ans
in chronological order: (B) Item not found, leading to end of search
1. Check if the queue is empty Sequential Search’s best case is finding the target
2. Remove the front element immediately, typically in the first or very early positions.
3. Return/Store the removed element If the item is missing, the algorithm performs a complete
4. Move the front pointer pass, which is the worst-case scenario.
(A) 1 → 3 → 2 → 4
24. Which sorting algorithm repeatedly swaps adjacent
(B) 1 → 2 → 3 → 4
(C) 3 → 1 → 2 → 4 elements if they are in the wrong order?
(D) 2 → 4 → 1 → 3 (A) Selection Sort
(B) Merge Sort
Ans (C) Bubble Sort
(B) 1 → 2 → 3 → 4 (D) Insertion Sort
First, confirm the queue isn’t empty. Next, remove the Ans
front element. Then store or return it. Lastly, advance the
front pointer. This order ensures proper FIFO handling (C) Bubble Sort
and consistent updates to internal pointers or indices. Bubble Sort repeatedly compares adjacent pairs,
swapping them if out of order, causing larger values to
21. Which searching technique inspects elements bubble up. While easy to implement, it’s inefficient for
sequentially until a match is found or the list ends? large datasets, typically O(n²) in its average and worst
(A) Binary Search cases.
(B) Interpolation Search
25. Which sorting algorithm works by placing an unsorted
(C) Sequential Search
(D) Fibonacci Search element at its correct position in each iteration by
comparing it with elements to its left?
Ans (A) Merge Sort
(C) Sequential Search (B) Insertion Sort
Sequential (linear) search checks each element in a list (C) Quick Sort
one by one, stopping if a match is identified or the entire (D) Bubble Sort
list is exhausted. It’s simple to implement but can be Ans
slow for large datasets (O(n) complexity).
(B) Insertion Sort
22. In Binary Search, how is the list typically structured for Insertion Sort takes one element from the unsorted part,
optimal efficiency? compares it with elements in the sorted part from right
(A) Disorganized to left, and inserts it at the correct spot. This results in
(B) In ascending or descending sorted order partial lists that are sorted incrementally until the entire
(C) Randomly permuted array is ordered.
(D) Split into multiple chunks
26. How does Selection Sort differ from Insertion Sort in its
Ans approach?
(B) In ascending or descending sorted order (A) Selection Sort inserts elements into sorted positions
Binary Search divides a sorted list into halves repeatedly, incrementally
selecting the relevant half for further searching based on (B) Insertion Sort finds the minimum each pass and
comparisons. If the list is unsorted, the technique fails to places it at the start
systematically reduce the search space. (C) Selection Sort finds the minimum element and
swaps it; Insertion Sort inserts an element in correct
23. Which of these is NOT a best-case scenario for order
Sequential Search? (D) Both implement divide-and-conquer
(A) Item found at first position
Ans 30. Match the SQL Clauses in Column A with their primary
(C) Selection Sort finds the minimum element and function in Column B:
swaps it; Insertion Sort inserts an element in correct Column A Column B
order
1. GROUP BY a. Filter rows after
Selection Sort locates the smallest element each iteration
aggregation
and swaps it with the current position. In contrast,
Insertion Sort takes elements and inserts them within 2. HAVING b. Filter rows before
the already sorted section, shifting elements as needed. aggregation
3. ORDER BY c. Specify sorting of
27. Which statistical measure sums all data points and result set
divides by their count? 4. WHERE d. Group rows based on a
(A) Median column
(B) Mean
(C) Mode Options:
(D) Variance (A) 1-d, 2-a, 3-c, 4-b
(B) 1-a, 2-d, 3-c, 4-b
Ans (C) 1-c, 2-b, 3-d, 4-a
(B) Mean (D) 1-d, 2-b, 3-a, 4-c
The mean is the arithmetic average of a dataset. It Ans
provides a central value but can be skewed by extreme
outliers. It differs from the median, which is the middle (A) 1-d, 2-a, 3-c, 4-b
value, and from the mode, which is the most frequently GROUP BY (d) groups rows by specified columns,
occurring value. HAVING (a) filters aggregated groups, ORDER BY (c)
sets result sorting, and WHERE (b) filters rows before
28. What does standard deviation quantify in a dataset? grouping or aggregation. This sequence ensures correct
(A) The difference between largest and smallest values data grouping and filtering.
(B) How spread out data is around the mean
31. Match each network device in Column A with its
(C) The most frequent value in the distribution
(D) The middlemost value of the distribution description in Column B:
32. Match the file access modes in Python in Column A Column A Column B
with their purpose in Column B:
1. LENGTH() a. Returns remainder
Column A Column B 2. NOW() b. Counts rows
1. ‘r’ a. Read only 3. COUNT() c. Returns length of a
2. ‘w’ b. Write (truncate file string
first) 4. MOD() d. Returns current date
3. ‘a’ c. Append to end and time
4. ‘r+’ d. Read and write Options:
Options: (A) 1-c, 2-d, 3-b, 4-a
(A) 1-a, 2-b, 3-c, 4-d (B) 1-d, 2-c, 3-a, 4-b
(B) 1-c, 2-a, 3-d, 4-b (C) 1-b, 2-a, 3-d, 4-c
(C) 1-d, 2-c, 3-a, 4-b (D) 1-a, 2-d, 3-c, 4-b
(D) 1-b, 2-c, 3-a, 4-d Ans
Ans (A) 1-c, 2-d, 3-b, 4-a
(A) 1-a, 2-b, 3-c, 4-d LENGTH() yields string length, NOW() returns the
The ‘r’ mode is for reading only, ‘w’ truncates or creates current date and time, COUNT() calculates the number
a file for writing, ‘a’ appends content, and ‘r+’ allows of rows, and MOD() computes the remainder of a
simultaneous read/write. Correct mode usage is critical division. Matching them correctly is vital for accurate
for proper file manipulation. SQL operations.
33. Match the Python exceptions in Column A with their 35. Which statements are true about primary and foreign
typical cause in Column B: keys in relational databases?
1. A table can only have one primary key
Column A Column B 2. A foreign key references a primary key in another
1. ZeroDivisionError a. Invalid dictionary table
lookup 3. Primary key values can be duplicated
2. IndexError b. Division by zero 4. Foreign key enforces referential integrity
attempt (A) 1, 2, and 4 only
3. TypeError c. Accessing an out-of- (B) 2 and 3 only
range list index (C) 1 and 3 only
4. KeyError d. Using incompatible (D) 1, 2, 3, and 4
operation on data type Ans
Options: (A) 1, 2, and 4 only
(A) 1-b, 2-c, 3-d, 4-a Only one primary key can exist per table, and a foreign
(B) 1-c, 2-b, 3-a, 4-d key typically references that key in another table.
(C) 1-a, 2-d, 3-c, 4-b Primary keys cannot be duplicated. A foreign key
(D) 1-d, 2-a, 3-b, 4-c maintains referential integrity by linking records across
Ans tables.
(A) 1-b, 2-c, 3-d, 4-a 36. Which of the following statements apply to Bubble Sort?
ZeroDivisionError arises from dividing by zero, 1. It compares adjacent elements.
IndexError from an invalid list index, TypeError 2. It always beats Insertion Sort in performance.
from an incompatible operation with data types, and 3. It has O(n²) worst-case complexity.
KeyError from referencing a non-existing dictionary 4. It may do unnecessary passes if the array is nearly
key. Recognizing causes aids robust error handling. sorted.
5. It repeatedly moves the largest element to the end.
34. Match the following MySQL functions in Column A (A) 1, 3, 4, and 5 only
with their primary usage in Column B: (B) 1, 2, 3, and 4 only
(C) 2, 3, 4, and 5 only
(D) 1, 2, 4, and 5 only (B) Both A and R are true, but R does not explain A
Ans (C) A is true, R is false
(D) A is false, R is true
(A) 1, 3, 4, and 5 only
Bubble Sort compares adjacent pairs, has a worst-case Ans
of O(n²), and pushes the largest element to the end (C) A is true, R is false
each pass. It can also make redundant passes if the list A is correct: accessing a list with an out-of-range index
is nearly sorted. It doesn’t reliably outperform Insertion triggers an IndexError. Python does not automatically
Sort. create new indices; referencing a non-existent index
raises an error, invalidating the reason statement.
37. Which statements describe a gateway in computer
networking? 40. Which of these is NOT a valid way to handle an
1. Operates at the data link layer only exception in Python?
2. Connects networks that use different protocols (A) Using a try-except block
3. Can act as an entry-exit point for a network (B) Raising a custom exception with raise
4. Strictly used for simple LAN traffic routing (C) Relying on the program’s default crash without
(A) 2 and 3 only error handling
(B) 1, 2, and 3 only (D) Defining an else clause after except
(C) 2, 3, and 4 only Ans
(D) 1, 3, and 4 only
(C) Relying on the program’s default crash without error
Ans handling
(A) 2 and 3 only Proper exception handling involves try-except,
A gateway connects networks employing dissimilar optionally with else or finally, or raising custom
protocols, translating data as needed, and it often serves exceptions. Letting the program crash by ignoring
as the network’s entry-exit point. It can work across exceptions entirely is not a valid handling strategy and
multiple layers, not limited to the data link layer, and is leads to ungraceful failures.
more than basic LAN routing.
Direction :Carefully read the case study provided and then
38. Assertion (A) : A firewall monitors incoming and thoroughly answer the subsequent five questions.
outgoing traffic in a network. Raj runs a small e-commerce startup using a Python-
Reason (R) : Firewalls cannot be configured to block based backend that connects to a MySQL database.
specific ports or addresses. His site captures customer details such as username,
(A) Both A and R are true, and R is the correct email, and order history. To optimize performance, Raj
explanation of A implemented a queue system for incoming orders and a
(B) Both A and R are true, but R is not the correct stack to manage rollback operations when exceptions
explanation of A occur during transactional updates. Additionally, he used
(C) A is true, but R is false bubble sort to organize product lists, as they often require
(D) A is false, but R is true repeated rearrangement. However, with the company’s
Ans rapid growth, Raj fears data anomalies in the database
and is considering foreign keys to maintain referential
(C) A is true, but R is false integrity. He also contemplates upgrading from bubble
A firewall filters traffic and can specifically block or sort to more efficient techniques like insertion sort or
allow certain ports, addresses, or protocols. Hence, selection sort for better performance on large inventories.
while a firewall does monitor traffic, it can indeed
be configured for specific blocks, making the reason 41. Why might Raj introduce foreign keys into his MySQL
statement incorrect. tables?
(A) To format numeric data uniformly
39. Assertion (A) : In Python, an IndexError occurs if you (B) To link related tables and ensure referential integrity
try to access a list with an invalid index. (C) To automatically compress rows for storage
Reason (R) : Python automatically creates new indices (D) To randomly partition large datasets
in a list if the referenced index is out of range.
(A) Both A and R are true, and R explains A Ans
(B) To link related tables and ensure referential integrity scenarios. Thus, switching could improve sorting
A foreign key enforces consistent relationships across efficiency.
tables by referencing primary keys, preventing orphaned
45. Assertion (A) : Queue usage for incoming orders
records. In Raj’s case, it helps maintain valid links between
orders and users, thereby reducing data anomalies. This ensures older orders are handled first.
structural constraint safeguards database consistency by Reason (R) : A stack would prioritize the earliest orders
validating inter-table references. automatically.
(A) Both A and R are true, and R is the correct
42. Which Python data structure did Raj implement for explanation of A
undo or rollback operations? (B) Both A and R are true, but R is not the correct
(A) Queue explanation of A
(B) Dictionary (C) A is true, but R is false
(C) Stack (D) A is false, but R is true
(D) Linked List Ans
Ans (C) A is true, but R is false
(C) Stack A queue processes tasks in order of arrival (FIFO).
A stack, employing LIFO (Last-In, First-Out), is highly A stack follows LIFO, reversing that order. Thus, a
effective for undo processes: the most recent change can stack would not prioritize the earliest orders first. The
be reversed first. By pushing operations onto a stack, Raj assertion stands correct; the reason is incorrect because
can pop them in reverse order to revert system states it confuses stack and queue behaviors.
seamlessly.
Direction :Carefully read the case study provided and then
43. How does a queue benefit Raj’s order handling system? thoroughly answer the subsequent five questions.
(A) It encrypts order data for security Priya manages a university’s data analytics platform in
(B) It converts orders to JSON Python. She collects examination scores from multiple
(C) It allows first-placed orders to be processed first departments and stores them in a MySQL database. Each
(D) It merges orders into a single table department’s data is frequently sorted to compute student
Ans rankings. Initially, Priya used bubble sort but noticed
high overhead for large data. After switching to selection
(C) It allows first-placed orders to be processed first sort, she saw moderate improvements, yet she wonders if
A queue ensures requests follow FIFO principles. The insertion sort might be more effective for mostly sorted
earliest incoming orders are handled before later ones, datasets. Additionally, she wants to implement a backup
preventing out-of-turn processing. This mechanism is system using text file handling in Python, ensuring
standard in scheduling systems, enabling a fair sequence exceptions (like file write errors) are properly caught
that matches user expectations. and logged. Given the limited network infrastructure on
44. Why might Raj consider replacing bubble sort with campus, Priya also contemplates establishing a LAN-
insertion sort or selection sort? based environment for secure data exchange.
(A) Bubble sort has a better time complexity than both 46. Which sorting algorithm might be more beneficial if
(B) Insertion and selection sorts give better average student scores are partially sorted most of the time?
performance than bubble sort (A) Bubble Sort
(C) Bubble sort uses advanced recursive logic (B) Selection Sort
(D) Insertion and selection sorts only handle pre-sorted (C) Insertion Sort
data (D) Quick Sort
Ans Ans
(B) Insertion and selection sorts give better average (C) Insertion Sort
performance than bubble sort Insertion Sort excels when data is partially sorted,
Bubble sort typically performs more comparisons requiring fewer shifts and comparisons. It gradually
and swaps, especially with medium or large datasets. inserts each item into a sorted sub-list, leading to better
Insertion Sort and Selection Sort, while still O(n²) in performance over Bubble or Selection in near-sorted
worst cases, can show fewer swaps or steps in practical
conditions. This makes it a practical choice for Priya’s the minimum element and swaps it, minimizing
typical data. unnecessary swaps.
(A) Both A and R are true, and R is the correct
47. How can text file handling help Priya’s backup system? explanation of A
(A) By replacing MySQL entirely with text files (B) Both A and R are true, but R is not the correct
(B) By providing a quick, structured method to store explanation of A
error logs and essential data (C) A is true, R is false
(C) By permanently encrypting all data automatically (D) A is false, R is true
(D) By blocking network access
Ans
Ans
(A) Both A and R are true, and R is the correct
(B) By providing a quick, structured method to store explanation of A
error logs and essential data While both bubble and selection sorts share O(n²)
Text files are straightforward to generate and read, complexity, selection sort typically makes fewer swaps,
making them ideal for backups of logs or essential which can render it more efficient in practice. The reason
records. Python’s file handling enables fast creation and accurately explains the mechanism behind selection
updates, offering a simple fallback mechanism if the sort’s relative performance advantage.
main database encounters issues or needs an external
log record. **************
48. Which exception type should Priya watch for if her file
writing operation fails unexpectedly in Python?
(A) FileNotFoundError
(B) ZeroDivisionError
(C) TypeError
(D) IOError (OSError in newer versions)
Ans
(D) IOError (OSError in newer versions)
When file-writing fails—due to permission issues, disk
errors, or unavailability—Python can raise an IOError
(handled nowadays under OSError hierarchy). Proper
try-except blocks let Priya respond gracefully, logging
the error or shifting to an alternative backup method.
PRACTICE PAPER 16
1. Which statement best describes a database? 4. In MySQL, which clause groups rows that share a
(A) A system of manual recordkeeping common value into summary rows, often used with
(B) A structured collection of data that can be accessed, aggregate functions?
managed, and updated (A) HAVING
(C) A random set of disorganized files (B) WHERE
(D) An operating system feature used for file transfers (C) GROUP BY
Ans (D) ORDER BY
2. Which database key is used to link records in two tables, 5. Which option differentiates HAVING from WHERE in
referencing the primary key of another table? SQL?
(A) Primary key (A) WHERE can only filter numeric data, while
(B) Composite key HAVING filters text data
(C) Foreign key (B) HAVING filters results after GROUP BY, while
(D) Candidate key WHERE filters rows before grouping
Ans (C) WHERE is required, HAVING is optional
(D) HAVING can manipulate table structure
(C) Foreign key
A foreign key points to a primary key in a different Ans
table, forming a link between two relations and (B) HAVING filters results after GROUP BY, while
ensuring referential integrity. This prevents invalid WHERE filters rows before grouping
record references and maintains consistency across WHERE operates on individual rows prior to
interconnected tables. aggregation, whereas HAVING filters aggregated
groups. They serve distinct roles in queries, with
3. Which SQL command removes an entire table from a WHERE cleaning data at the row level, and HAVING
database? refining final grouped results.
(A) DELETE TABLE
(B) DROP TABLE 6. Which of the following is NOT a valid MySQL aggregate
(C) ALTER TABLE function?
(D) TRUNCATE TABLE (A) MAX()
Ans (B) AVG()
(C) MEDIAN()
(B) DROP TABLE (D) SUM()
DROP TABLE permanently deletes the table structure
and data. TRUNCATE TABLE removes all rows but Ans
retains the structure, while DELETE can remove rows (C) MEDIAN()
under certain conditions. ALTER TABLE modifies MySQL has aggregate functions like MAX(), MIN(),
existing structure rather than removing it outright. AVG(), SUM(), and COUNT(). MEDIAN() is not a
(C) Optical Fiber 11. Arrange these Python exception handling steps in the
Optical fibers carry data as light pulses through correct chronological sequence:
thin strands of glass or plastic, providing very high 1. Execute the try block
bandwidth and low signal loss over long distances. They 2. Raise exception if any error
outperform twisted pair and coaxial cables in terms of 3. Jump to except block
speed and resistance to electromagnetic interference. 4. Execute else block if no exception
(A) 1 → 3 → 2 → 4
8. What is the main role of a router in a network? (B) 1 → 2 → 4 → 3
(A) Encrypt all data (C) 1 → 2 → 3 → 4
(B) Facilitate communication between different (D) 2 → 1 → 3 → 4
networks
(C) Serve as a repeater for signal boosting Ans
(D) Intercept malicious software (C) 1 → 2 → 3 → 4
Ans Python executes statements in the try block (1). If an
error occurs, an exception is raised (2). Control moves
(B) Facilitate communication between different to the except block (3). If no exception occurs, the else
networks block executes (4), maintaining a clear, sequential flow.
Routers direct data packets between networks, using
IP addresses to choose the best path. They operate 12. Which Python statement ensures code will run whether
primarily at the network layer, ensuring incoming and an exception occurs or not?
outgoing traffic is properly forwarded to its destination (A) except
network segment. (B) else
(C) finally
9. Which topology might be best for an office environment (D) raise
requiring a central controller and easy addition or
removal of nodes? Ans
(A) Bus (C) finally
(B) Ring The finally block runs unconditionally after try-except
(C) Star blocks finish, enabling resource cleanup or final logging.
(D) Mesh This ensures certain code segments (like closing files)
Ans execute regardless of success or exception within the try
block.
(C) Star
In a star topology, each node connects to a central hub 13. Why might a developer define a custom exception in
or switch. It simplifies adding or removing nodes and Python?
isolates failures to individual links. Though it needs (A) To override standard exceptions without reason
more cable length, its manageability and fault isolation (B) To handle unique error conditions specific to an
often make it the preferred choice for offices. application’s domain
(C) To disable built-in error handling
10. Which IP address version uses a 128-bit address space? (D) To reduce code readability
(A) IPv4
(B) 1 → 3 → 2 → 4 Ans
(C) 1 → 2 → 3 → 4 (B) O(log n)
(D) 1 → 2 → 4 → 3 Binary Search repeatedly halves the search interval,
Ans leading to logarithmic growth relative to the size of the
list. In the worst case, it systematically eliminates half
(C) 1 → 2 → 3 → 4
the remaining data set each comparison, making it very
First, ensure the queue has space. Next, assign the
efficient for large, sorted collections.
element into the rear location, then update the rear
pointer. Finally, record that the element is in the queue. 24. How does Selection Sort differ from Bubble Sort in the
This checks capacity before physically placing the new way it places elements?
item. (A) Selection Sort swaps in every comparison, Bubble
Sort doesn’t swap at all
21. Why is binary search more efficient than sequential
(B) Selection Sort finds the largest element each pass,
search for large, sorted datasets?
Bubble Sort finds the smallest
(A) It reads every element until a match is found
(C) Selection Sort finds the minimum and places it in
(B) It repeatedly narrows down the search space by
the correct position, while Bubble Sort repeatedly
dividing it in half
swaps adjacent elements
(C) It depends on scanning all elements in random
(D) Both sort algorithms are identical
order
(D) It stores data as separate queues Ans
32. Match each part of a stack operation in Column A with 34. Match each network topology in Column A with its
its definition in Column B: characteristic in Column B:
Column A Column B Column A Column B
1. PUSH a. Points to the current 1. Ring a. All nodes connected to
last element in the a central device
stack 2. Bus b. Each node is connected
2. POP b. Adding a new element to every other node
to the top 3. Star c. Nodes arranged in a
3. TOP pointer c. Attempt to pop from closed loop
an empty stack 4. Mesh d.
4. Underflow d. Options:
Options: (A) 1-c, 2-d, 3-a, 4-b
(A) 1-b, 2-d, 3-a, 4-c (B) 1-d, 2-c, 3-b, 4-a
(B) 1-d, 2-b, 3-c, 4-a (C) 1-a, 2-b, 3-d, 4-c
(C) 1-a, 2-c, 3-d, 4-b (D) 1-b, 2-a, 3-c, 4-d
(D) 1-c, 2-a, 3-b, 4-d Ans
Ans (A) 1-c, 2-d, 3-a, 4-b
(A) 1-b, 2-d, 3-a, 4-c A ring topology has each computer in a loop, a bus
PUSH adds to the top, POP removes from the top, the topology uses one backbone cable, a star topology
TOP pointer shows the stack’s current last element, features a central connection point, and a mesh connects
and underflow occurs when removing from an empty every node directly to others for high redundancy.
stack. Correctly handling these ensures stable stack
35. Which of the following statements about computer
operations.
networks are correct?
33. Match each MySQL function in Column A with its 1. Routers operate at the network layer
purpose in Column B: 2. LAN covers a large geographical area
3. Switches send data based on MAC addresses
Column A Column B
4. WAN is smaller than a LAN
1. UCASE() a. Converts text to 5. A hub broadcasts signals to all ports
uppercase (A) 1, 3, and 5 only
2. ROUND() b. Returns the name of (B) 1, 2, 3, and 5 only
the weekday (C) 2, 3, and 4 only
3. DAYNAME() c. Counts rows in a table (D) 1, 2, 4, and 5 only
4. COUNT(*) d. Rounds a numeric Ans
value
(A) 1, 3, and 5 only
Options: Routers function at the network layer, switches make
(A) 1-a, 2-d, 3-b, 4-c decisions based on MAC addresses, and hubs broadcast
(B) 1-b, 2-a, 3-d, 4-c data blindly to all ports. LAN is typically small; WAN
(C) 1-c, 2-d, 3-a, 4-b spans larger areas. Thus, statements 2 and 4 are incorrect.
(D) 1-d, 2-c, 3-b, 4-a
36. Which statements are true about SQL JOINs?
Ans
1. INNER JOIN returns matching rows from both
(A) 1-a, 2-d, 3-b, 4-c tables
UCASE() transforms text to uppercase, ROUND() 2. LEFT JOIN only returns rows that have matching
adjusts a number to the nearest integer or decimal place, entries in both tables
DAYNAME() gives the weekday name from a date, and 3. RIGHT JOIN includes all rows from the second
COUNT(*) tallies all rows in the output of a query. table
4. FULL JOIN includes rows from both tables,
41. Which data structure does Aditya use to process the (C) Plain-text password storage
oldest query first? While Aditya employs encryption, firewalls, and key
(A) Stack constraints to enhance data security and relational
(B) Queue consistency, storing passwords in plain text is unsafe and
(C) Linked List contradicts robust security practices. Proper hashing or
(D) Binary Tree encryption is necessary for credential protection.
Ans 45. Assertion (A) : Aditya’s use of foreign keys helps
(B) Queue maintain relationships among tables.
A queue processes elements in FIFO order, ensuring Reason (R) : Foreign keys ensure related records are
earlier requests are handled before later ones. This deleted automatically without constraints.
arrangement is valuable for fair resource allocation and (A) Both A and R are true, and R is the correct
sequential task management, which fits the hospital’s explanation of A
need for timely query handling. (B) Both A and R are true, but R is not the correct
explanation of A
42. Which data structure is used by Aditya for undo (C) A is true, R is false
functionality when correcting mistakes? (D) A is false, R is true
(A) Array
(B) File Ans
(C) Stack (C) A is true, R is false
(D) Dictionary A foreign key enforces relational integrity by referencing
Ans a primary key in another table. It does not inherently
delete all related records without constraints. Instead,
(C) Stack referential actions (CASCADE, SET NULL, etc.) must
An undo feature aligns perfectly with LIFO behavior. be explicitly defined to handle such deletions.
The most recent change can be popped first to revert
actions quickly. This complements the queue’s FIFO Direction :Carefully read the case study provided and then
strategy for main processes while the stack manages thoroughly answer the subsequent five questions.
reversal tasks effectively. Harini manages a data science lab that processes scientific
experiments. She uses Python for reading and writing
43. Why might Aditya prefer binary search for patient text files containing experiment logs. For advanced
archives? computations, she organizes critical data in MySQL
(A) It checks every record in sequence tables, applying group-related queries with GROUP BY
(B) It can find data in O(log n) if the list is sorted clauses to summarize results. Because some experiments
(C) It rearranges records as they are searched yield large data volumes, Harini employs selection sort
(D) It is always faster than constant-time lookups for demonstration and occasionally insertion sort when
Ans data is nearly sorted. Given the confidential nature
(B) It can find data in O(log n) if the list is sorted of her findings, she secures her network via LAN and
Binary search repeatedly halves the search space in a implements strong firewall rules. Additionally, she
sorted collection, significantly cutting down search time schedules regular backups using Python’s pickle module
from O(n) to O(log n). This is particularly efficient for to serialize objects, ensuring that data states are preserved
large, sorted patient archives, offering quick lookups by for future reference. Balancing efficient data structures,
leveraging order. effective sorting, and robust network security is vital for
her lab’s workflow.
44. Which measure is NOT part of Aditya’s described data
46. Why might Harini use selection sort in demonstrations,
security approach?
(A) Encryption despite its O(n²) complexity?
(B) Firewall implementation (A) It guarantees sub-linear performance
(C) Plain-text password storage (B) It is simpler to understand, with a clear approach to
(D) Setting up strong primary and foreign keys finding minima
(C) It randomly arranges data for better example variety
Ans (D) It only applies to numeric datasets
PRACTICE PAPER 17
1. What is the primary key in a relational database table? (A) Foreign key values can be duplicated, while primary
(A) A field used for sorting rows by name key values must be unique
(B) A unique identifier for each table record Primary keys offer a unique identifier for each row in a
(C) A column that always stores numeric data table. Foreign keys, however, link rows between tables.
(D) A reference to an existing table row Because multiple rows can connect to the same row
Ans in another table, foreign key values can repeat. Thus,
foreign keys allow repeated references, whereas primary
(B) A unique identifier for each table record keys remain strictly unique. This distinction maintains
A primary key is defined as a unique identifier in a relational integrity.
relational table, ensuring no two rows share the same
value. This uniqueness helps maintain data integrity 4. Which principle best maintains consistency across
and facilitates quick data retrieval, as every row can multiple related tables in a database?
be pinpointed using that specific key value. It prevents (A) Applying triggers on every insert operation
duplicate entries and supports efficient record linking (B) Using enforced referential integrity with foreign
within the database. keys
(C) Performing frequent backups of data tables
2. Which key can act as a primary key if the designated (D) Storing all data in a single table to avoid joins
primary key becomes invalid or is no longer suitable?
(A) Foreign key Ans
(B) Alternate key (B) Using enforced referential integrity with foreign
(C) Candidate key keys
(D) Composite key Referential integrity ensures that a foreign key in one
Ans table corresponds to a valid primary key in another.
This mechanism automatically prevents orphan records
(B) Alternate key and data mismatches. By enforcing referential rules,
An alternate key is a candidate key that did not get databases maintain logical connections between rows
chosen as the primary key. If the primary key becomes across tables, thus preserving accuracy and reliability in
unusable, an alternate key can replace it. This guarantees multi-table structures.
consistent row identification. Alternate keys are valid
unique identifiers but are secondary to the key officially 5. Match the following database terms with their
named the primary key. definitions:
3. How does a foreign key differ from a primary key in Column A Column B
relational databases? 1. Domain A. A row in a table
(A) Foreign key values can be duplicated, while primary 2. Tuple B. A set of allowable
key values must be unique values for a column
(B) They are functionally identical keys for data 3. Relation C. An entire table
retrieval
4. Candidate Key D. A column or set of
(C) A foreign key always stores dates, while a primary
columns that can
key stores integers
uniquely identify rows
(D) Foreign key ensures unique data, primary key
enforces referential integrity Options:
(A) 1-C, 2-D, 3-A, 4-D
Ans
(B) 1-D, 2-C, 3-B, 4-A
(C) 1-A, 2-B, 3-D, 4-C
BY specifically addresses the sorting and presentation (B) HAVING filters groups after aggregation, whereas
sequence for retrieved data in the final result set. WHERE filters rows before grouping
WHERE applies to individual rows and eliminates them
11. Which aggregate function in SQL returns the number of before the grouping step. HAVING acts on the resultant
non-NULL rows for a particular column? groups formed by GROUP BY, allowing further filtration
(A) COUNT() based on aggregate calculations (e.g., SUM, AVG). This
(B) SUM() design ensures different filtering stages for raw row data
(C) AVG() and for final grouped results. It offers precise control
(D) MIN() over group-level conditions.
Ans
14. Which JOIN type best retrieves matching rows from two
(A) COUNT() tables where the join condition is satisfied, excluding
COUNT() calculates the total number of non-NULL unmatched rows?
rows in a specified column or even for all rows if (A) LEFT JOIN
COUNT(*) is used. SUM() adds up numeric column (B) RIGHT JOIN
values, AVG() computes average values, and MIN() (C) FULL JOIN
returns the smallest value in a column. COUNT() (D) INNER JOIN
specifically focuses on row counts. It’s crucial for
summarizing query results. Ans
(D) INNER JOIN
12. Which combination of the following statements about INNER JOIN returns rows only when there is a
the SQL GROUP BY clause is correct? matching value in both tables based on the specified
1. It groups rows that have the same value in specified condition. LEFT JOIN includes unmatched rows from
columns the left table, RIGHT JOIN includes unmatched rows
2. It can be used without any aggregate function from the right table, and FULL JOIN includes all rows
3. It must appear before the WHERE clause with or without matches. This distinction defines how
4. It often works with aggregate functions like SUM or non-matching data appears.
MAX
(A) 1 and 4 are correct 15. Which statement best compares LAN and WAN?
(B) 2 and 3 are correct (A) LAN covers large geographical areas, WAN is
(C) 1, 2, and 4 are correct limited to small buildings
(D) 1 and 3 are correct (B) LAN transmits data at slower speeds, WAN
Ans provides higher speeds
(C) LAN is typically for localized networks, WAN
(A) 1 and 4 are correct connects distant sites
GROUP BY collects rows sharing common values in (D) LAN is always wireless, WAN is always wired
certain columns, typically used with aggregate functions
(like SUM, MAX) to summarize data. It cannot precede Ans
WHERE, and while some SQL dialects might permit (C) LAN is typically for localized networks, WAN
GROUP BY without aggregates, common usage pairs connects distant sites
it with functions for summarized grouping. This A Local Area Network (LAN) commonly spans a limited
highlights the interplay of clauses. area such as a building or campus, facilitating high-speed
data transfer. A Wide Area Network (WAN) links widely
13. Why is the HAVING clause used in SQL instead of separated geographical areas. Speed can vary, and both
WHERE with aggregate functions? can be wired or wireless, depending on infrastructure
(A) HAVING is faster for all queries choices and requirements. This distinction underscores
(B) HAVING filters groups after aggregation, whereas their scope and purpose.
WHERE filters rows before grouping
(C) HAVING is mandatory in every SELECT query 16. Assertion (A) : A router directs data packets between
(D) HAVING can only work with numeric columns different networks.
Ans Reason (R) : Routers are responsible for converting
analog signals to digital signals.
Expand Your Reach: Your readers can share these PDFs on other platforms, helping your
influence grow exponentially.
Still not convinced? Ask us how, and we’ll walk you through exactly how it works.
Best of all: It’s completely free—no hidden charges.
(A) Both A and R are true, and R is the correct (B) Switch
explanation of A (C) Hub
(B) Both A and R are true, but R is not the correct (D) Modem
explanation of A Ans
(C) A is true, but R is false
(D) A is false, but R is true (B) Switch
A switch forwards incoming data packets selectively
Ans to specific ports, reducing unnecessary traffic. A hub
(C) A is true, but R is false simply broadcasts all data to every port, while a repeater
Routers manage traffic between distinct networks by regenerates signals. A modem handles modulation
determining optimal paths for data packets. However, and demodulation for communication over telephone
converting analog signals to digital signals is typically lines or cable systems. Switches thereby optimize local
the job of a modem, not a router. Therefore, the network efficiency. This focused delivery elevates
assertion about a router’s function is correct, whereas performance significantly.
the reason provided is incorrect. This mismatch clarifies
19. Which is NOT a built-in Python exception class?
the distinct roles of network devices.
(A) ValueError
17. Match each network topology with its brief (B) KeyError
characteristic: (C) InputMismatchError
(D) ZeroDivisionError
Column A Column B
1. Bus a. Each node connected Ans
sequentially in a closed (C) InputMismatchError
loop ValueError arises when a function receives an argument
2. Star b. All nodes linked directly of inappropriate type. KeyError indicates a missing
to a central device key in a dictionary. ZeroDivisionError is triggered by
3. Ring c. Every node connected to division by zero. InputMismatchError does not exist
every other node in standard Python libraries; it’s found in some other
languages but not Python’s built-in exceptions. This
4. Mesh d. All devices share a single
underscores Python’s specific error hierarchy.
communication line
Options: 20. Why is the ‘finally’ block used in Python exception
(A) 1-c, 2-a, 3-b, 4-d handling?
(B) 1-d, 2-b, 3-a, 4-c (A) It executes only if an exception occurs
(C) 1-b, 2-c, 3-d, 4-a (B) It executes only if no exception occurs
(D) 1-a, 2-d, 3-b, 4-c (C) It ensures specified code runs regardless of
exception status
Ans
(D) It bypasses error messages entirely
(B) 1-d, 2-b, 3-a, 4-c
Ans
In a Bus topology, all devices use a single communication (C) It ensures specified code runs regardless of exception
backbone. Star topology has a central hub or switch status
linking devices individually. Ring topology arranges The ‘finally’ block runs code unconditionally after try-
nodes in a loop structure. Mesh topology creates multiple except blocks, whether an exception was raised or not.
direct links, providing redundancy by connecting each This feature is commonly used for cleanup actions,
node to every other node. This ensures varied fault- like closing files or network connections. Its primary
tolerance and performance outcomes. purpose is to guarantee that crucial operations execute,
independent of whether an error occurred. It fosters
18. Which networking device best expands a local network robust and safe code structure.
by forwarding data to the correct destination segment
only? 21. Which statements are true about opening files in Python
(A) Repeater in different modes?
1. ‘r’ opens a file for reading, error if not found
2. ‘w’ appends content to existing file (B) A stack removes items from the top, a queue
3. ‘a’ creates a file if it doesn’t exist removes items from the front
4. ‘b’ indicates binary mode (C) A stack never removes items, a queue does remove
(A) 1 and 4 are correct items
(B) 2 and 3 are correct (D) A stack uses indices, a queue uses references
(C) 1, 3, and 4 are correct Ans
(D) 2, 3, and 4 are correct
(B) A stack removes items from the top, a queue removes
Ans items from the front
(C) 1, 3, and 4 are correct In a stack, the last inserted element is removed first
‘r’ is used for read mode and raises an error if the file (LIFO). In a queue, the first inserted element is removed
is missing. ‘a’ appends to a file or creates it if absent. ‘b’ first (FIFO). Thus, stacks pop from the top, while queues
indicates binary mode for non-text data. However, ‘w’ dequeue from the front. This fundamental difference
overwrites existing content instead of merely appending defines their usage in different algorithmic scenarios. It
to it. This distinction is critical for correct file handling highlights opposing insertion-removal sequences.
practice.
25. Assertion (A) : A queue processes elements in First In
22. Which Python function best ensures objects are stored First Out order.
in a binary file with their structure preserved? Reason (R) : A queue always places new elements at the
(A) open() with ‘wb’ mode front.
(B) pickle.dump() (A) Both A and R are true, and R is the correct
(C) readlines() explanation of A
(D) input() (B) Both A and R are true, but R is not the correct
Ans explanation of A
(C) A is true, but R is false
(B) pickle.dump() (D) A is false, but R is true
The pickle.dump() function serializes Python objects and
writes them to a binary file, preserving object structure. Ans
While open() with ‘wb’ creates or opens a binary file, (C) A is true, but R is false
pickle.dump() specifically handles the conversion of Queues use FIFO, meaning the earliest enqueued
Python data into a storable format. readlines() and element is served first. However, new elements are
input() are unrelated to object serialization. This method enqueued at the rear, not the front. Front is reserved
maintains complex data integrity. for removal. Consequently, while the assertion about
FIFO order is correct, the reason stating new elements
23. What is the primary characteristic of a stack data go in front is incorrect. This clarifies standard queue
structure? operations.
(A) FIFO (First In First Out)
(B) LIFO (Last In First Out) 26. What is the main difference between a queue and a
(C) Random access retrieval deque (double-ended queue)?
(D) Direct indexing (A) A queue allows insertion only from both ends
Ans (B) A deque allows insertion and deletion at both ends
(C) A queue can only delete elements from both ends
(B) LIFO (Last In First Out) (D) A deque restricts all operations to the front only
A stack follows the Last In First Out principle, meaning
elements added most recently are removed first. This Ans
push-pop mechanism maintains an orderly removal (B) A deque allows insertion and deletion at both ends
sequence. The earliest inserted items remain below A standard queue restricts insertion to the rear and
the topmost entries, awaiting removal once the upper removal from the front. In contrast, a double-ended
items have been popped. It contrasts with queues’ FIFO queue (deque) permits both insertion and deletion
arrangement, effectively. at either end. This flexible structure can function as a
regular queue or a stack, depending on how operations
24. How does a stack differ from a queue in terms of access? are used. It offers greater versatility for data handling.
(A) Both remove items from the front
(C) Median changes drastically with outliers, mean 1. Bluetooth is ideal for short-range communication
remains unaffected 2. Infrared requires direct line of sight
(D) Both remain unaffected by extreme values 3. WLAN (Wi-Fi) covers a maximum of five meters
Ans 4. Microwave links can transmit over long distances
(A) 1 and 2 are correct
(B) Mean is more influenced by extreme outliers than (B) 1, 2, and 4 are correct
median (C) 2 and 3 are correct
The mean is pulled toward extreme high or low values, (D) 3 and 4 are correct
because it factors every data point equally. By contrast,
the median, which is the middle value once data are Ans
sorted, is less affected by extremely large or small points. (B) 1, 2, and 4 are correct
Outliers therefore disproportionately shift the mean. Bluetooth typically operates within a few meters, making
This distinction guides measure selection in skewed it suitable for short-range scenarios. Infrared indeed
datasets. requires line-of-sight transmission. Microwave links
can span significant distances with proper equipment.
33. Which wired communication medium uses light pulses WLAN often covers a broader range than five meters,
to transmit data? so statement 3 is incorrect. This highlights diverse use
(A) Twisted pair cable cases and limitations of wireless technologies.
(B) Optical fiber
(C) Coaxial cable 36. Which protocol best ensures reliable data transmission
(D) Ethernet cable through acknowledgment and retransmission
Ans mechanisms?
(A) HTTP
(B) Optical fiber (B) FTP
Optical fiber transmits data using pulses of light through (C) TCP
extremely thin glass or plastic strands. Twisted pair and (D) UDP
coaxial cables carry electrical signals, and Ethernet cable
generally refers to twisted pair standards like CAT5 Ans
or CAT6. Fiber optics enable higher bandwidth and (C) TCP
longer distances with minimal signal loss. It’s critical for TCP (Transmission Control Protocol) offers guaranteed
modern high-speed networks. delivery by establishing a connection, acknowledging
received segments, and retransmitting lost data. UDP
34. Why is switching important in data communication is connectionless and lacks built-in reliability. HTTP
networks? and FTP rely on TCP underneath but are higher-level
(A) It doubles the bandwidth protocols for web and file transfer, respectively. Thus,
(B) It randomly discards packets TCP ensures robust end-to-end communication control
(C) It decides how data is forwarded through effectively.
intermediate nodes
(D) It always encrypts data before sending 37. Which is NOT typically considered malicious software?
Ans (A) Virus
(B) Worm
(C) It decides how data is forwarded through (C) Trojan horse
intermediate nodes (D) Firewall
Switching techniques determine the path that data takes
from source to destination. By choosing specific routes Ans
in the network, switches (or switching logic) optimize (D) Firewall
delivery efficiency. This does not inherently provide Viruses, worms, and Trojan horses are recognized
encryption or bandwidth doubling, but it helps ensure malware forms that damage or manipulate systems.
data reaches the correct location effectively. This is A firewall, however, is a security mechanism that
foundational for directed data flow. monitors and filters incoming and outgoing network
traffic based on predefined rules, protecting rather than
35. Which statements about wireless technologies are
correct?
harming systems. This distinction emphasizes firewall’s personalization on websites. This mapping clarifies
protective role against threats and unauthorized access. diverse security components and their respective roles.
38. Which statements are true regarding HTTPS (Hypertext 40. How does a Trojan horse differ from a worm in terms
Transfer Protocol Secure)? of spread?
1. It uses encryption to secure data (A) A Trojan self-replicates automatically, whereas a
2. It cannot be used for e-commerce transactions worm needs user installation
3. It employs SSL or TLS protocols (B) Trojans and worms spread identically
4. It is slower than HTTP due to encryption overhead (C) A Trojan requires user action to install disguised
(A) 1, 3, and 4 are correct software, while worms self-replicate
(B) 1 and 2 are correct (D) Worms never replicate, while Trojans always do
(C) 2 and 3 are correct Ans
(D) 1 and 4 are correct
(C) A Trojan requires user action to install disguised
Ans software, while worms self-replicate
(A) 1, 3, and 4 are correct Trojans trick users into installing seemingly harmless
HTTPS implements SSL/TLS encryption to secure programs that secretly contain malicious payloads,
data transmission, commonly used for e-commerce, requiring explicit user action to initiate. Worms, in
login pages, and other sensitive transactions. As a contrast, replicate independently across networks,
result, it is typically slower than plain HTTP due to spreading without direct user intervention. This
encryption overhead, but this performance difference fundamental difference underscores Trojans’ reliance
is often minimal with modern hardware and protocols. on deception. Meanwhile, worms exploit network
Consequently, statements 1, 3, and 4 hold true. vulnerabilities automatically. Hence, infection methods
differ significantly.
39. Match each security concept with its function:
Direction :Carefully read the case study provided and then
Column A Column B
thoroughly answer the subsequent five questions.
1. Antivirus a. Protective software Students in a school are analyzing academic performance
scanning for malware data stored in a MySQL database. They use multiple tables
2. Firewall b. Stores small data in to store student records, including personal details, marks,
user’s browser and attendance. Teachers run complex SELECT queries
3. Hacker c. Controls inbound and with JOIN clauses to correlate exam scores across different
outbound network subjects, applying aggregate functions like AVG and
traffic COUNT. Meanwhile, the IT administrator emphasizes
4. Cookie d. An individual who tries database normalization to prevent redundancy and
to gain unauthorized maintains referential integrity by assigning primary and
access foreign keys. The system also has a Python-based module
for generating result summaries, reading data from CSV
Options:
files and writing them back into a binary file with pickle.
(A) 1-a, 2-c, 3-d, 4-b
For data security, the school implements strong firewalls
(B) 1-d, 2-b, 3-c, 4-a
and regularly scans for malware, ensuring safe network
(C) 1-b, 2-c, 3-d, 4-a
access for teachers and students. This setup showcases
(D) 1-a, 2-d, 3-b, 4-c
practical database management, Python file handling,
Ans and cybersecurity precautions simultaneously.
(A) 1-a, 2-c, 3-d, 4-b
41. Which SQL feature mentioned helps relate exam scores
Antivirus detects and removes malware, while a firewall
from different subject tables?
monitors and filters network traffic. A hacker attempts
(A) GROUP BY
to breach systems without proper authorization.
(B) JOIN clauses
Cookies store small pieces of information locally in
(C) ORDER BY
a user’s browser, enabling session maintenance or
(D) WHERE filters
Ans
(B) JOIN clauses Firewalls filter and monitor inbound and outbound
By using JOIN, tables are linked based on common traffic according to security rules. Normalization only
columns (keys), letting queries correlate data across addresses database schema design, JOIN queries handle
multiple subjects. GROUP BY groups rows, ORDER BY multi-table data retrieval, and CSV files are a storage
sorts results, and WHERE filters rows. JOIN specifically format. Firewalls specifically serve to safeguard network
merges rows from distinct tables into meaningful access by blocking unauthorized traffic. This prevents
combined results. This integration is crucial for multi- external threats from breaching internal systems.
table academic analytics.
45. Why is normalization valuable in a database storing
42. How does the IT administrator maintain referential student records?
integrity among related tables? (A) It duplicates data for faster reading
(A) Using repeated data fields (B) It merges all tables into one giant table
(B) Setting up foreign keys (C) It organizes data to reduce redundancy
(C) Removing all unique constraints (D) It encrypts all columns automatically
(D) Enabling only read operations Ans
Ans (C) It organizes data to reduce redundancy
(B) Setting up foreign keys Normalization structures tables so that each piece
Referential integrity ensures records in a child table of data has a single, optimal location, minimizing
correspond to valid primary keys in a parent table. This unnecessary duplication. This practice helps maintain
is achieved by designating foreign keys that match the data integrity and efficiency. It does not automatically
primary key columns. Repeated data fields and read- encrypt columns or merge tables. Instead, it focuses on
only access do not automatically guarantee integrity; logical design to prevent repetitive, inconsistent storage.
foreign keys do. This method prevents invalid cross- This yields cleaner and more maintainable databases.
references in linked tables.
Direction :Carefully read the case study provided and then
43. Which Python operation is used to store objects in a thoroughly answer the subsequent five questions.
binary file? An e-commerce startup deploys a Python application
(A) open(file.txt, r) managing customer orders. The app logs transactions
(B) pickle.dump() in a MySQL database, using multiple relational tables
(C) write() with string conversion for products, customers, and payments. To maintain
(D) readlines() performance, indexes are applied on frequently searched
Ans columns, and the team uses SELECT queries with JOIN
to generate sales reports. Exception handling in Python
(B) pickle.dump() ensures that payment gateway errors or file I/O issues
The pickle.dump() function in Python serializes objects, are gracefully caught. The system also employs bubble
preserving their structure and data, then writes them to sort for sorting daily order summaries in memory due
a binary file. While open() sets the file mode, dump() to simplicity. Network connectivity relies on a secured
performs the actual serialization. Converting to string Wi-Fi link, with encryption protocols preventing data
and using readlines() are not correct for preserving interception. Firewalls and antivirus software protect
object integrity. This ensures Python data remains intact sensitive payment records. Data backups are performed
upon retrieval. regularly to safeguard order history, and routine updates
44. Which measure mentioned in the scenario protects the keep all security measures current. This integrated
school’s network from malicious attacks? approach illustrates concurrency, security, sorting, and
(A) Normalization robust operations.
(B) Firewalls 46. Which database feature is used to optimize frequently
(C) CSV files searched columns?
(D) JOIN queries (A) Foreign key
Ans (B) Indexes
(B) Firewalls (C) GROUP BY
(D) Triggers
47. Why does the Python application handle exceptions, 50. Why are regular data backups performed?
especially for payment gateway errors? (A) To erase order history daily
(A) To terminate the program immediately (B) To maintain bandwidth usage
(B) To prevent data backups (C) To ensure data restoration in case of system failure
(C) To gracefully recover and maintain system stability (D) To merge all user accounts into one table
(D) To remove the entire database schema Ans
Ans (C) To ensure data restoration in case of system failure
(C) To gracefully recover and maintain system stability Frequent backups protect critical information, enabling
Proper exception handling allows the software to catch system administrators to restore lost or corrupted
and manage runtime issues like payment gateway data after unexpected events. This approach prevents
failures or file I/O errors without crashing. Instead of permanent data loss if hardware malfunctions, software
abruptly stopping, it can log errors, retry operations, bugs, or security breaches occur. It does not relate
or alert administrators. This ensures the application to bandwidth, daily erasures, or table consolidation.
remains stable during unexpected events. Such resilience Backups are essential for robust business continuity.
enhances user trust significantly.
**************
48. Which sorting method mentioned organizes daily order
summaries in memory?
(A) Selection Sort
(B) Bubble Sort
(C) Merge Sort
(D) Quick Sort
Ans
(B) Bubble Sort
Bubble Sort iteratively compares and swaps adjacent
elements to place them in order. Although not the most
efficient for large datasets, it remains straightforward and
was chosen for simplicity in the described application.
Selection Sort, Merge Sort, and Quick Sort each use
different approaches. This choice reflects practicality
over optimal performance.
PRACTICE PAPER 18
1. Which term describes a set of permissible values that backup is unrelated, and primary keys do not enforce
can appear in a particular column of a relational table? repeated data; they prevent it.
(A) Candidate Key
4. Which is NOT a recommended practice in relational
(B) Domain
(C) Tuple database design?
(D) Schema (A) Normalizing tables
(B) Using primary keys
Ans (C) Enforcing referential integrity
(B) Domain (D) Duplicating entire tables with redundant data
In relational databases, the domain of a column defines Ans
the valid range of values that column may contain. This
enforces consistency by preventing invalid entries. A (D) Duplicating entire tables with redundant data
candidate key is a column or group of columns uniquely Best practices include normalizing to reduce duplication,
identifying records; a tuple is a row; a schema outlines designating primary keys for unique identification, and
the database structure. using foreign keys to maintain referential integrity.
Creating multiple copies of the same table with
2. Which key in a database table ensures there are no redundant data undermines consistency and wastes
duplicate values for that column, but does not necessarily storage. Hence, duplicating entire tables is not advisable
serve as the primary identifier? in sound database design.
(A) Foreign key
5. How does a foreign key differ from an alternate key?
(B) Alternate key
(C) Composite key (A) A foreign key references a primary key in another
(D) Secondary index table; an alternate key is an unused candidate key in
the same table
Ans (B) They function identically
(B) Alternate key (C) A foreign key cannot link tables; an alternate key
An alternate key is a candidate key that isn’t chosen to must link tables
be the primary key but still uniquely identifies rows. A (D) A foreign key must always be numeric; an alternate
foreign key links to another table’s primary key, and a key must be text-based
composite key combines multiple columns. A secondary Ans
index may speed searches but doesn’t inherently ensure
uniqueness like an alternate key does. (A) A foreign key references a primary key in another
table; an alternate key is an unused candidate key in the
3. Why are primary keys crucial in a relational database? same table
(A) They store images and videos A foreign key provides a link to a primary key in a
(B) They ensure each row can be uniquely identified different table, creating relationships among tables.
(C) They serve only as backup references An alternate key is simply a candidate key that wasn’t
(D) They enforce repeated data entries chosen as the primary key. They serve different purposes
Ans in relational modeling, emphasizing how external and
internal references differ.
(B) They ensure each row can be uniquely identified
A primary key differentiates each record from any other 6. Which SQL statement is used to remove an existing
in the same table, preventing duplication and fostering table from the database?
reliable lookups. This is foundational for maintaining (A) DELETE TABLE
relational integrity. Storing multimedia or acting as a (B) REMOVE TABLE
as average scores or total sums. These functions don’t (B) INNER JOIN returns matching rows; LEFT JOIN
delete data nor are they restricted to distinct columns returns all rows from the left table and matching rows
only; they handle multiple column types seamlessly. from the right
INNER JOIN results include only rows satisfying the
12. Which of the following is NOT an aggregate function join condition in both tables. LEFT JOIN includes
in SQL? all rows from the left table, plus matched data from
(A) MIN() the right table. Unmatched right table entries become
(B) MAX() NULL in columns. They differ significantly in handling
(C) SUBSTR() incomplete matches.
(D) AVG()
15. Match each network term with its primary characteristic:
Ans
(C) SUBSTR() Column A Column B
SUBSTR() (or SUBSTRING()) is a string function, not 1. LAN a. Interconnects smaller
an aggregate. MIN() and MAX() find minimum and geographic areas like a
maximum values, respectively, while AVG() calculates building
the average. Aggregate functions summarize multiple 2. WAN b. A global network of
rows’ values. String functions like SUBSTR() process interconnected systems
text but do not aggregate over sets of rows. 3. MAN c. Serves large-scale regions,
13. Assertion (A) : The HAVING clause can filter grouped often countrywide or
results. international
Reason (R) : The WHERE clause cannot filter rows 4. Internet d. Covers a city or metropolitan
containing aggregate function output. region
(A) Both A and R are true, and R is the correct Options:
explanation of A (A) 1-a, 2-c, 3-d, 4-b
(B) Both A and R are true, but R is not the correct (B) 1-d, 2-b, 3-c, 4-a
explanation of A (C) 1-b, 2-c, 3-d, 4-a
(C) A is true, but R is false (D) 1-a, 2-d, 3-b, 4-c
(D) A is false, but R is true
Ans
Ans
(A) 1-a, 2-c, 3-d, 4-b
(A) Both A and R are true, and R is the correct A Local Area Network (LAN) spans a small location.
explanation of A A Wide Area Network (WAN) connects distant sites
HAVING is applied after GROUP BY to filter aggregated across large regions. A Metropolitan Area Network
data. WHERE applies to raw rows before grouping, (MAN) covers a city. The Internet is a worldwide set of
so it cannot directly evaluate aggregate outputs. Thus, interconnected networks, transcending local or regional
the statement and reason align: HAVING is essential boundaries.
for conditions involving sums, counts, or averages on
grouped results. 16. Which device is primarily responsible for connecting
multiple networks and directing data based on IP
14. How does an INNER JOIN differ from a LEFT JOIN in addresses?
SQL? (A) Hub
(A) INNER JOIN returns all rows from both tables; (B) Switch
LEFT JOIN returns only matching rows (C) Repeater
(B) INNER JOIN returns matching rows; LEFT JOIN (D) Router
returns all rows from the left table and matching
Ans
rows from the right
(C) They function identically (D) Router
(D) LEFT JOIN omits all matching rows, whereas A router examines IP addresses in data packets and
INNER JOIN omits mismatches forwards them to the appropriate destination network.
Hubs repeat signals to all ports, switches segment local
Ans
traffic by MAC addresses, and repeaters amplify signals. A bus topology indeed involves a single backbone cable
Routers connect distinct networks, facilitating the flow shared by all devices. However, a bus arrangement is
of packets beyond a single LAN. traditionally wired, with nodes tapping into the main
cable. It does not rely on a central wireless access point.
17. Which of the following is NOT typically part of a LAN’s The assertion is correct, but the reason is incorrect.
hardware setup?
(A) Switch 20. Which protocol provides a reliable, connection-oriented
(B) Router configured for local IP traffic data stream between two hosts?
(C) Hub (A) UDP
(D) Satellite transponder for interplanetary (B) IP
communication (C) TCP
Ans (D) ICMP
19. Assertion (A) : A bus topology shares a single central 22. Which built-in Python exception is raised when a
cable for communication. dictionary key is not found?
Reason (R) : In a bus topology, each node connects (A) KeyError
wirelessly to a central access point. (B) IndexError
(A) Both A and R are true, and R is the correct (C) LookupError
explanation of A (D) EOFError
(B) Both A and R are true, but R is not the correct Ans
explanation of A
(C) A is true, but R is false (A) KeyError
(D) A is false, but R is true A KeyError arises specifically when attempting to
access a non-existent key in a dictionary. IndexError
Ans appears when a list index is out of range, LookupError
(C) A is true, but R is false is a broader category for lookup failures, and EOFError
occurs when input() hits an end-of-file condition. 26. How does Python’s write() method differ between text
KeyError is unique to dictionary key retrieval. and binary file modes?
(A) Text mode write() rejects all non-ASCII data;
23. Which of the following modes does NOT open a file for binary mode permits only ASCII
writing in Python? (B) Text mode auto-converts newlines; binary mode
(A) ‘w’ writes raw bytes
(B) ‘a’ (C) They behave identically
(C) ‘x’ (D) Both modes automatically decode data
(D) ‘r+’
Ans
Ans
(B) Text mode auto-converts newlines; binary mode
(D) ‘r+’ writes raw bytes
The ‘r+’ mode opens a file for both reading and writing In text mode, Python may translate \n to the system’s
but does not create a new file if it doesn’t exist, and it native line ending, while binary mode writes byte data
primarily expects existing data. ‘w’ overwrites or creates, exactly as is. They do not behave identically, nor is ASCII
‘a’ appends or creates, and ‘x’ creates a file if it doesn’t data exclusively allowed in one or the other. Automatic
already exist. Hence, ‘r+’ differs. decoding is not done unless explicitly performed.
24. Why might you choose a binary file over a text file in 27. What is the primary role of a stack in evaluating
Python? arithmetic expressions?
(A) Binary files are always smaller (A) It randomly rearranges operators and operands
(B) To store serialized objects or raw bytes accurately (B) It queues all numbers for first-in-first-out
(C) They are easier to edit manually processing
(D) They automatically compress data (C) It temporarily holds operators and operands for
Ans postfix or prefix evaluation
(B) To store serialized objects or raw bytes accurately (D) It automatically sorts the final expression
Binary files retain exact byte patterns, making them Ans
suitable for images, serialized objects, or arbitrary data. (C) It temporarily holds operators and operands for
Text files can corrupt non-text content due to character postfix or prefix evaluation
encoding assumptions. Manual editing is simpler in text Stack-based algorithms are frequently used to convert
files, and binary files don’t always compress or shrink in infix to postfix (or prefix) and then evaluate the
size automatically. expression. The stack holds operators until they can be
25. Which statements are true about Python’s pickle applied, maintaining correct operation order. It doesn’t
module? randomly rearrange or sort; it provides last-in-first-out
1. It serializes Python objects access that matches many expression-processing rules.
2. It is used only for text data 28. Why is a stack considered a LIFO structure?
3. It can write to binary files (A) Items are processed in alphabetical order
4. It automatically encrypts objects (B) The last item pushed is the first to pop out
(A) 1 and 3 are correct (C) It always empties all items automatically
(B) 1, 3, and 4 are correct (D) It maintains items in ascending numerical order
(C) 2 and 3 are correct
(D) 1, 2, and 4 are correct Ans
Ans (B) The last item pushed is the first to pop out
A stack’s defining principle is Last In First Out. Each
(A) 1 and 3 are correct push operation places a new item on top, and the next
The pickle module serializes Python objects (1) and pop removes that top item. The other choices do not
can write them to binary files (3). It does not handle reflect the essential LIFO property. Stacks do not auto-
encryption (4) nor is it limited to text data (2). Pickling empty nor guarantee any sorting of elements.
captures an object’s structure so it can be reconstructed
later. It’s crucial for preserving object states persistently. 29. Assertion (A) : A queue follows FIFO.
Reason (R) : Each new element is always inserted at the
front, and removal is from the rear. (A) 1, 3, and 4 are correct
(A) Both A and R are true, and R is the correct (B) 1 and 2 are correct
explanation of A (C) 2, 3, and 4 are correct
(B) Both A and R are true, but R is not the correct (D) 1 and 4 are correct
explanation of A Ans
(C) A is true, but R is false
(D) A is false, but R is true (A) 1, 3, and 4 are correct
Binary Search needs a sorted list (1), locates the mid-
Ans point for each comparison (3), and discards half the
(C) A is true, but R is false search space with each iteration (4). Its best-case
A queue does indeed follow First In First Out (A is true), complexity is O(1) if the target is immediately found,
but new elements are enqueued at the rear, and items with overall average and worst-case O(log n), not
are removed from the front. The reason incorrectly O(n^2).
states the opposite insertion direction. Hence, the
33. Which sorting algorithm is typically the easiest to
overall explanation fails, even though the queue’s FIFO
principle remains correct. implement but can be inefficient for large datasets?
(A) Merge Sort
30. Which operation is NOT valid for a standard linear (B) Bubble Sort
queue data structure? (C) Quick Sort
(A) Enqueue at the rear (D) Heap Sort
(B) Dequeue from the front Ans
(C) Peek at the front element
(D) Direct insertion in the middle (B) Bubble Sort
Bubble Sort involves repeated passes, swapping adjacent
Ans out-of-order elements. It’s straightforward to code
(D) Direct insertion in the middle and understand, making it popular for educational
A normal queue restricts insertion to the rear and purposes, but with O(n^2) time complexity, it’s slow on
removal from the front. Peeking can show the front large datasets. Merge Sort, Quick Sort, and Heap Sort
element. However, queue design disallows insertion can offer better average performance on bigger inputs.
directly into the middle. That would violate the strict
34. How does Selection Sort differ from Insertion Sort?
FIFO ordering fundamental to the queue concept.
(A) Selection Sort finds the minimum each pass;
31. Which searching algorithm checks each element Insertion Sort inserts elements into their correct
sequentially until the target is found or the list ends? position gradually
(A) Binary Search (B) They both do merges of sublists
(B) Ternary Search (C) Selection Sort requires additional data structures;
(C) Linear Search Insertion Sort is always in-place
(D) Exponential Search (D) They have entirely distinct time complexities, with
Ans Selection Sort at O(1)
Expand Your Reach: Your readers can share these PDFs on other platforms, helping your
influence grow exponentially.
Still not convinced? Ask us how, and we’ll walk you through exactly how it works.
Best of all: It’s completely free—no hidden charges.
(D) Cell Switching (ATM) 4. It forms the basis of data communication for the
Ans World Wide Web
(A) 1, 3, and 4 are correct
(D) Cell Switching (ATM) (B) 1, 2, and 4 are correct
Asynchronous Transfer Mode (ATM) uses a fixed cell (C) 2 and 4 are correct
size (53 bytes) for data transmission. Packet switching (D) 1 and 2 are correct
typically handles variable packet sizes, circuit switching
dedicates a complete channel, and message switching Ans
treats entire messages as units. ATM’s cell switching is (A) 1, 3, and 4 are correct
distinct for its uniform cell length. HTTP is inherently stateless, relying on TCP underneath
for reliable transport, and underpins most web traffic.
42. How does wired Ethernet differ from Wi-Fi in typical It does not automatically encrypt data (that’s HTTPS).
data communication? Statement 2 is false since standard HTTP sends data in
(A) Ethernet uses cables for transmission; Wi-Fi relies plaintext. Hence, 1, 3, and 4 are correct.
on radio waves
(B) Ethernet always has lower speed; Wi-Fi always has 45. Which security feature best ensures data cannot be
higher speed easily read if intercepted over a wireless connection?
(C) Both require line-of-sight connections (A) MAC address filtering
(D) Wi-Fi cannot handle encryption, while Ethernet (B) Strong encryption protocol (e.g., WPA2/WPA3)
can (C) Disabling SSID broadcast
Ans (D) Allocating static IP addresses
explanation of A
(C) A is true, but R is false Phishing deceives victims into revealing credentials.
(D) A is false, but R is true Spyware collects information surreptitiously. Adware
Ans bombards devices with advertisements. Ransomware
denies access to data until a ransom is paid. Each
(C) A is true, but R is false threatens users differently and can cause harm if not
Firewalls indeed inspect and filter traffic based on mitigated properly.
security policies (A is correct). However, they are not
chiefly used for detecting hardware failures. That role 50. How does a Worm differ from a Virus regarding
falls to diagnostic tools and system monitors. Thus, replication?
while the assertion is valid, the reason is inaccurate. (A) A Worm depends on user action to replicate, while
a Virus replicates automatically
48. Which statements correctly describe HTTPS? (B) A Virus requires no host file, while a Worm needs a
1. It encrypts data using TLS or SSL file to infect
2. It is identical to HTTP in all respects (C) A Worm self-replicates over networks; a Virus
3. It is recommended for handling sensitive typically embeds itself in files or programs
information (D) They both require identical user actions to spread
4. It typically uses port 443
(A) 1, 3, and 4 are correct Ans
(B) 1 and 2 are correct (C) A Worm self-replicates over networks; a Virus
(C) 2, 3, and 4 are correct typically embeds itself in files or programs
(D) 1, 2, and 4 are correct Worms spread autonomously through networks,
Ans whereas viruses need to attach to host files and rely
on some user action or execution path. Thus, a virus’s
(A) 1, 3, and 4 are correct replication usually depends on infected file transfers,
HTTPS incorporates encryption (TLS/SSL) to secure while worms replicate independently, highlighting their
data in transit, especially for sensitive content, and distinct infection vectors.
typically runs over port 443. It’s not identical to HTTP
in security features, so statement 2 is wrong. Hence, 1, 3, Direction :Carefully read the case study provided and then
and 4 accurately define HTTPS. thoroughly answer the subsequent five questions.
A small clinic uses a Python-based system to manage
49. Match each threat with its brief description: patient appointments, prescriptions, and billing. The
Column A Column B application stores structured data in a MySQL database
1. Phishing a. Steals sensitive with tables for patients, medical records, and invoices. The
data by imitation of receptionist interacts with a front-end that allows adding
trustworthy entities new appointments, while doctors update patient records
after each consultation. For security, staff members access
2. Spyware b. Shows unwanted
the system through unique credentials, and the clinic
advertisements to
employs a firewall to protect internal devices. Python’s
users
file handling features generate daily summary reports
3. Adware c. Secretly monitors user in both text and binary formats, with pickled objects
activity preserving statistical metrics on patient visits. The system
4. Ransomware d. Encrypts files and also incorporates Bubble Sort when displaying a day’s
demands payment appointments in ascending order of time. Weekly backups
Options: are performed to ensure data recovery in case of hardware
(A) 1-a, 2-c, 3-b, 4-d failure or malware attacks.
(B) 1-d, 2-b, 3-c, 4-a
51. Which MySQL feature likely prevents patient records
(C) 1-b, 2-c, 3-d, 4-a
from duplicating unnecessarily?
(D) 1-a, 2-d, 3-b, 4-c
(A) Using a single table for everything
Ans (B) Normalizing data into separate tables
(A) 1-a, 2-c, 3-b, 4-d (C) Disabling referential integrity
59. Why are weekly backups crucial for this art startup?
(A) They speed up SELECT queries
(B) They ensure data recovery if a system fails or
malware corrupts files
(C) They eliminate the need for Wi-Fi encryption
(D) They update the antivirus software automatically
Ans
(B) They ensure data recovery if a system fails or
malware corrupts files
Regular backups preserve business records, letting
the startup restore them after hardware failures or
cyberattacks. Backups don’t optimize SELECT queries,
handle Wi-Fi encryption, or update antivirus software.
PRACTICE PAPER 19
1. Which key uniquely identifies each row in a relational This clause precedes the HAVING clause, which filters
table? group-based results. ORDER BY handles sorting, while
(A) Foreign key SELECT determines which columns or expressions are
(B) Candidate key returned.
(C) Primary key
4. Which of the following is not a valid DML (Data
(D) Alternate key
Manipulation Language) command?
Ans (A) INSERT
(C) Primary key (B) UPDATE
A primary key is a specific candidate key chosen to (C) DELETE
uniquely identify rows in a relation. It ensures no two (D) ALTER
records share the same value for that field, preserving Ans
data integrity. Other keys may also be unique, but only
one key is designated as primary, forming the table’s (D) ALTER
essential backbone. DML commands manipulate data, such as inserting,
updating, or deleting rows. ALTER is a DDL (Data
2. Which command in MySQL is used to remove an entire Definition Language) command used to change the
table permanently? structure of database objects (e.g., tables). Hence,
(A) DELETE TABLE ALTER is not a DML command. INSERT, UPDATE,
(B) DROP TABLE and DELETE all modify the data within tables.
(C) REMOVE TABLE
5. Which statement best describes the difference between
(D) ERASE TABLE
a LAN and a WAN?
Ans (A) WAN connections are typically faster than LAN.
(B) DROP TABLE (B) LAN covers large geographic areas; WAN covers
The DROP TABLE command completely removes the small areas.
specified table from the database, deleting all its rows, (C) LAN is restricted to a localized area; WAN spans
structure, and associated metadata. This operation wide geographic regions.
is irreversible. In contrast, the DELETE command (D) WAN only uses wireless media; LAN uses wired
removes rows but leaves the table structure intact, only.
and the TRUNCATE command removes all rows but Ans
preserves the table definition.
(C) LAN is restricted to a localized area; WAN spans
3. Which clause in SQL groups rows with the same values wide geographic regions.
in specified columns into summary rows? A Local Area Network (LAN) operates within a limited
(A) HAVING area, such as a building, while a Wide Area Network
(B) GROUP BY (WAN) covers broader geographic regions, possibly
(C) ORDER BY connecting multiple cities or countries. Speeds vary by
(D) SELECT technology, and both LAN and WAN can use wired or
Ans wireless communication media.
(B) GROUP BY 6. Which device regenerates and amplifies signals but does
GROUP BY is used to aggregate records sharing identical not manage traffic between network segments?
values in specified columns, allowing the application of (A) Switch
aggregate functions such as COUNT, SUM, or AVG. (B) Router
11. Match the Python exception types (Column A) with Column A Column B
their description (Column B):
1. UCASE() i. Convert text to
Column A Column B uppercase
1. ValueError i. Dictionary key not 2. ROUND() ii. Get day of week
found 3. DAYNAME() iii. Round numeric values
2. ZeroDivisionError ii. Invalid type operation 4. COUNT(*) iv. Count all rows
3. KeyError iii. Invalid value Options:
4. TypeError iv. Division by zero (A) 1-i, 2-iii, 3-ii, 4-iv
Options: (B) 1-ii, 2-iv, 3-i, 4-iii
(A) 1-iii, 2-iv, 3-i, 4-ii (C) 1-iv, 2-ii, 3-iii, 4-i
(B) 1-iv, 2-iii, 3-ii, 4-i (D) 1-iii, 2-i, 3-iv, 4-ii
(C) 1-i, 2-ii, 3-iv, 4-iii Ans
(D) 1-ii, 2-i, 3-iii, 4-iv
(A) 1-i, 2-iii, 3-ii, 4-iv
Ans UCASE() converts letters to uppercase, ROUND()
(A) 1-iii, 2-iv, 3-i, 4-ii adjusts numeric values to a specified number of decimal
ValueError arises when an operation receives an places, DAYNAME() returns weekday names from date
inappropriate value; ZeroDivisionError occurs when values, and COUNT(*) calculates the total number of
dividing by zero; KeyError triggers when accessing a rows. Each function serves a distinct role in managing
nonexistent dictionary key; TypeError is raised when or analyzing data in SQL queries.
an operation is applied to an object of an inappropriate
14. Which combination of statements about stacks is
type. These exceptions help identify logic or data errors.
correct?
12. Match the following queue operations (Column A) with 1. They follow FIFO.
their description (Column B): 2. Topmost element is accessed last.
3. They follow LIFO.
Column A Column B (A) 1 and 2
1. INSERT i. Element positioned at (B) 2 and 3
the last index (C) 1 and 4
2. DELETE ii. Element removed (D) 3 and 4
from first index Ans
3. FRONT iii. Returns first element
(D) 3 and 4
4. REAR iv. Returns last element A stack employs Last-In, First-Out (LIFO) ordering,
Options: which contradicts FIFO (used by queues). The topmost
(A) 1-i, 2-ii, 3-iii, 4-iv element is indeed the last inserted item, and the pop
(B) 1-iv, 2-i, 3-ii, 4-iii operation removes exactly that last pushed element. So
(C) 1-ii, 2-i, 3-iv, 4-iii statements 3 and 4 correctly describe stack behavior in
(D) 1-iii, 2-iv, 3-i, 4-ii data structures.
Ans
15. Which statements about bubble sort are true?
(A) 1-i, 2-ii, 3-iii, 4-iv 1. Compares adjacent items
In a standard FIFO queue, inserting occurs at the rear 2. Potentially completes in fewer passes if elements
end, removing occurs at the front. The FRONT operation are sorted early
returns the element at the front, while REAR returns the 3. Always requires a single pass
item at the back. This design ensures first-in, first-out 4. Swaps items if out of order
behavior for orderly processing of data elements. (A) 1, 2, and 4
(B) 1, 3, and 4
13. Match the following MySQL functions (Column A) (C) 2, 3, and 4
with their purpose (Column B): (D) 1, 2, and 3
When merging two sorted lists, each element is 24. Which Python statement ensures a block of code always
compared once to decide which sublist to pull from executes, whether or not an exception is raised?
next. This single pass through both lists yields O(n) total (A) except
time, where n is the sum of their lengths. This logical (B) finally
approach guarantees efficient linear merge performance. (C) raise
(D) else
21. Which function in MySQL returns the month number
from a date? Ans
(A) MONTH() (B) finally
(B) MONTHNAME() The finally clause in Python’s try-except-finally construct
(C) DATE() always executes, regardless of whether an exception
(D) DAY() occurred. This is useful for performing cleanup tasks
Ans like closing files or releasing resources. The except clause
handles exceptions, else runs if no exceptions occur, and
(A) MONTH() raise explicitly triggers an exception.
The MONTH() function extracts the month component
(as a numeric value) from a valid date or datetime 25. Which of the following is not an advantage of using
expression. In contrast, MONTHNAME() provides MySQL?
the month’s name, DATE() returns a date portion from (A) Open-source availability
a datetime, and DAY() retrieves the day of the month. (B) Limited cross-platform support
MONTH() supplies the integer month value. (C) Scalability
(D) Large community support
22. What is an alternate key in a relational database?
(A) Key referencing a different table Ans
(B) Candidate key not chosen as primary (B) Limited cross-platform support
(C) Non-unique key for indexing MySQL is open-source, highly scalable, and benefits
(D) Key used for partial matching from robust community backing. It supports multiple
Ans platforms, including Windows, Linux, and macOS,
so limited cross-platform support is incorrect. Its
(B) Candidate key not chosen as primary popularity stems from flexibility across environments,
A table may have multiple candidate keys (all capable plus strong performance and cost-effectiveness for
of uniquely identifying rows). Only one candidate key projects of many sizes.
becomes the primary key, while others are designated
alternate keys. These alternate keys remain unique 26. Which statement contrasts sequential search with
identifiers but are not the official primary. They serve binary search?
redundancy and can later become primary if needed. (A) Sequential search needs a sorted list, while binary
search doesn’t
23. Which network topology connects all devices in a (B) Binary search inspects all elements; sequential
closed loop? search can skip some
(A) Bus (C) Sequential search checks each element linearly,
(B) Ring while binary search halves the search space
(C) Star (D) Both require sorted data
(D) Tree
Ans
Ans
(C) Sequential search checks each element linearly,
(B) Ring while binary search halves the search space
In a ring topology, each device connects to exactly two Sequential (linear) search scans each element one by
others, forming a continuous ring. Data typically travels one, which is O(n). Binary search needs sorted data
around this loop in one or both directions. Bus topology and repeatedly divides the list into halves, achieving
uses a single backbone cable, star has a central node, and O(log n). Binary search cannot skip presorting, whereas
tree combines multiple star structures hierarchically. sequential search works on any data order but is slower
with large lists.
27. Which sorting method is best suited for nearly sorted (C) Tree
data? (D) Graph
(A) Selection sort Ans
(B) Insertion sort
(C) Bubble sort (B) Queue
(D) Merge sort A queue is a linear data structure implementing FIFO
behavior: elements are inserted at one end (rear) and
Ans removed from the other end (front). Stacks use LIFO,
(B) Insertion sort trees represent hierarchical structures, and graphs
Insertion sort performs extremely well on lists that are consist of nodes and edges representing relationships
already or mostly sorted because it effectively places without a strict linear insertion/removal order.
each element in its correct position with minimal
31. Which measure best represents the spread or variability
comparisons. In such scenarios, its complexity
approaches O(n). Other methods often require more in a dataset?
comparisons or merges, yielding less efficiency for (A) Mean
nearly sorted arrays. (B) Standard deviation
(C) Median
28. Which MySQL function calculates the total of a numeric (D) Sum
column? Ans
(A) SUM()
(B) MIN() (B) Standard deviation
(C) AVG() Standard deviation quantifies how spread out the
(D) COUNT() numbers are from the mean, indicating overall
variability in the dataset. The mean is a central tendency
Ans measure, and the median splits the data in half. The sum
(A) SUM() has no direct indication of variability. Hence, standard
SUM() adds all the values of a chosen numeric column deviation reveals dispersion effectively.
to return their total. MIN() finds the smallest value,
32. Which of the following is not an SQL aggregate function?
AVG() computes the average, and COUNT() determines
the number of rows. These aggregate functions allow (A) MAX()
quick data analysis within database queries for numeric (B) MIN()
columns. (C) MOD()
(D) AVG()
29. Which of these is not a valid data communication Ans
medium?
(A) Twisted pair cable (C) MOD()
(B) Coaxial cable MAX(), MIN(), and AVG() are MySQL aggregate
(C) Optical fiber functions used in group operations. MOD() is a
(D) Typewriter ribbon mathematical function that returns the remainder of
division, but it’s not an aggregate function that performs
Ans computations over groups of rows. Hence, MOD()
(D) Typewriter ribbon stands apart in typical SQL usage classification.
Twisted pair cables, coaxial cables, and optical fibers
33. Why is a firewall crucial for network security?
are standard wired transmission media. Typewriter
ribbons have no role in data networking; they are used (A) It permanently disables malware
in mechanical typing. Data communication involves (B) It restricts or allows data packets based on rules
transporting digital or analog signals between devices (C) It encrypts all data across networks
using suitable wired or wireless media. (D) It physically shields servers
Ans
30. Which data structure follows a First-In, First-Out
(FIFO) principle? (B) It restricts or allows data packets based on rules
(A) Stack A firewall enforces a security policy by filtering inbound
(B) Queue and outbound traffic based on predefined rules. It does
not guarantee malware removal or global encryption. The File Transfer Protocol (FTP) allows file upload and
Instead, it inspects data packets against permitted download between a client and a remote server. HTTP
or forbidden criteria, protecting systems from handles web page requests, SMTP handles sending
unauthorized access or malicious data intrusions. email, and POP3 or IMAP handle receiving email. FTP
is specifically designed to move files across a network
34. Which feature distinguishes a modem from a router? with user authentication.
(A) A router modulates and demodulates signals, while
a modem forwards packets 37. Assertion (A) : In insertion sort, the outer loop tracks
(B) A modem connects digital signals to telephone how many elements have been sorted.
analog lines, while a router directs data Reason (R) : Each pass extends the sorted portion by
(C) A router cannot create IP addresses, while a modem inserting one element at its correct position.
can (A) Both (A) and (R) are true, and (R) is the correct
(D) They perform identical networking functions explanation
Ans (B) Both (A) and (R) are true, but (R) is not the correct
explanation
(B) A modem connects digital signals to telephone (C) (A) is true, (R) is false
analog lines, while a router directs data (D) (A) is false, (R) is true
A modem modulates digital signals into analog
waveforms and vice versa for transmission over Ans
telephone lines. A router, on the other hand, analyzes (A) Both (A) and (R) are true, and (R) is the correct
network addresses to route packets across networks. explanation
Though some devices combine both functions, they In insertion sort, we gradually expand the sorted part of
remain fundamentally distinct components in data the array by moving the current element into its rightful
communication. position among previously sorted elements. The outer
loop’s iteration count indicates how many elements have
35. Which statement correctly defines a Trojan horse in been placed, while each pass repositions exactly one
cybersecurity? element.
(A) Self-replicating malware that spreads across
networks 38. Which is not a function of the data link layer?
(B) Malicious software disguised as legitimate, granting (A) Framing
unauthorized access (B) Error detection
(C) Software that automatically displays unwanted ads (C) Physical addressing
(D) Security measure that monitors user keystrokes (D) Routing packets between networks
Ans Ans
(B) Malicious software disguised as legitimate, granting (D) Routing packets between networks
unauthorized access The data link layer is responsible for framing data, error
A Trojan horse conceals its true purpose behind what detection, and using physical (MAC) addresses for local
appears to be a benign application, tricking users into delivery. Routing across network boundaries is the
installation. Once active, it can create backdoors or steal responsibility of the network layer (Layer 3). Hence, data
data. Unlike worms, it does not self-replicate. Adware link does not route packets between different networks.
displays ads, and keystroke monitoring is spyware
39. Which relational algebra operation returns rows from a
rather than a Trojan’s defining feature.
relation that satisfy a given condition?
36. Which protocol is primarily used for transferring files (A) Projection
between a client and a server on a network? (B) Selection
(A) HTTP (C) Union
(B) FTP (D) Cartesian product
(C) SMTP Ans
(D) POP3
(B) Selection
Ans Selection (σ) in relational algebra filters rows that meet
(B) FTP a specified predicate. Projection (π) chooses specific
columns, union combines rows from two relations, approach lets teachers generate performance summaries
and Cartesian product (×) multiplies each row of one per class efficiently. ORDER BY only sorts data, while
relation by each row of another. Thus, selection isolates DROP TABLE removes structures and triggers automate
rows matching stated conditions. specific tasks.
40. Which hashing technique involves applying an 42. Which table likely holds the marks for Mathematics,
additional step if two keys map to the same index? Computer Science, and English?
(A) Linear probing (A) Students
(B) One-way hashing (B) Scores
(C) Binary chaining (C) Classes
(D) Key compression (D) Configurations
Ans Ans
(A) Linear probing (B) Scores
Linear probing is a collision resolution strategy in The Scores table tracks exam or test scores in different
hashing. When a collision happens at a particular subjects. The Students table stores personal information,
index, the algorithm checks subsequent positions while Classes might store class identifiers or related
linearly until it finds an empty slot. One-way hashing attributes. A separate configuration table would
refers to cryptographic hashing. Binary chaining and generally store system settings. Hence, the subject
key compression are not standard hashing collision marks logically reside under Scores.
approaches.
43. Which Python feature is used to handle unexpected
Direction :Carefully read the case study provided and then runtime errors during data import?
thoroughly answer the subsequent five questions. (A) Modules
A school’s computer lab implements a database to store (B) finally block
student details and test results. The database consists (C) Exception handling (try-except)
of multiple related tables, including Students, Classes, (D) pass statement
and Scores. Each table has a primary key column. The Ans
Scores table captures marks in subjects like Mathematics,
Computer Science, and English. MySQL’s GROUP BY and (C) Exception handling (try-except)
aggregate functions help generate overall performance try-except blocks catch runtime exceptions, preventing
summaries for each class. Teachers occasionally run program crashes and allowing developers to handle
queries to identify top performers or detect failing errors gracefully or retry operations. Python modules
students. They also use Python scripts to automate data organize code, the finally block always executes after
entry, employing exception handling to avoid disruptions try-except, and the pass statement is a no-operation
during large-scale data imports. The lab’s network setup placeholder. Comprehensive exception handling
relies on a star topology with a central switch. Multiple ensures stability during large-scale data imports.
computers share resources, and the system’s firewall helps 44. Which network topology is described in the lab setup?
secure data from external threats. (A) Ring
41. Which MySQL feature helps teachers compile (B) Bus
performance summaries by class? (C) Star
(A) INSERT triggers (D) Mesh
(B) GROUP BY clause Ans
(C) ORDER BY clause (C) Star
(D) DROP TABLE command The case study explicitly states the lab uses a star
Ans topology, where all computers connect to a central
(B) GROUP BY clause switch. In contrast, ring topology places devices in a
GROUP BY classifies rows with the same class identifier loop, bus uses a common backbone cable, and mesh
into aggregated results, enabling calculation of average involves multiple interconnected paths. Star remains a
scores, sums, or other metrics for each group. This popular choice for institutional networks.
45. Which security measure protects the lab’s system from 47. Which Python concept safeguards the script against file
external threats? reading errors?
(A) Router password (A) Global variables
(B) Gateway protocol (B) try-except blocks
(C) Firewall (C) print statements
(D) Star node (D) pass keyword
Ans Ans
(C) Firewall (B) try-except blocks
The text identifies a firewall as providing security against When reading CSV or other file data, wrapping file
unauthorized access or malicious traffic. Password- operations in try-except ensures the program can handle
protected routers help, but firewalls specifically filter missing files, read errors, or corrupted data gracefully
data packets, blocking suspicious requests. Gateways without crashing. Global variables and print statements
and star nodes are network components, but they do not do not protect against errors. The pass keyword simply
inherently offer robust filtering. Firewalls are designed does nothing if reached.
for threat management.
48. Which sorting technique is specifically mentioned for
Direction :Carefully read the case study provided and then arranging tasks by priority?
thoroughly answer the subsequent five questions. (A) Bubble sort
An IT firm maintains a shared database to track project (B) Insertion sort
tasks, deadlines, and employee assignments. The Tasks (C) Merge sort
table stores each task’s details, including its due date, (D) Quick sort
priority, and the assigned employee’s ID. Employees Ans
connect to the database over a secured LAN using a
switch. Management uses various SQL queries to identify (B) Insertion sort
overdue tasks, including SELECT, WHERE, and even The case states that a Python automation script uses
HAVING to filter grouped data. A Python automation insertion sort to order tasks by priority. Insertion sort
script processes status updates daily, handling possible file is effective for smaller or partially sorted data sets,
exceptions when importing CSV task data. The script uses inserting each new element into its correct position
insertion sort for a custom ordering of tasks by priority. and gradually expanding the sorted portion. Other
Additionally, the LAN includes a firewall to monitor algorithms are not referenced in the scenario.
incoming traffic. The system’s success relies on well- 49. Which network device in the LAN setup helps connect
designed data structures, secure networking, and robust all employee machines?
exception handling to avoid system crashes. (A) Switch
46. Which SQL command might management use to filter (B) Router
tasks due before today’s date? (C) Gateway
(A) SELECT * FROM Tasks ORDER BY due_date (D) Modem
(B) SELECT * FROM Tasks WHERE due_date < Ans
CURDATE() (A) Switch
(C) DROP TABLE Tasks The passage mentions a switch as the central device
(D) COUNT(*) FROM Tasks used to interconnect local machines. A router routes
Ans data between different networks, a gateway translates
(B) SELECT * FROM Tasks WHERE due_date < between protocols, and a modem modulates-
CURDATE() demodulates signals over phone lines. In typical LANs,
This query filters rows in the Tasks table to return only switches handle local traffic within a single network
those tasks with a due_date earlier than the current segment.
date, indicating they are overdue. ORDER BY sorts but 50. Which measure mentioned helps protect the LAN from
doesn’t filter, DROP TABLE deletes the entire table, malicious inbound connections?
and COUNT(*) provides numeric counts rather than (A) Disabling TCP/IP
filtered tasks. (B) Using a firewall
**************
Expand Your Reach: Your readers can share these PDFs on other platforms, helping your
influence grow exponentially.
Still not convinced? Ask us how, and we’ll walk you through exactly how it works.
Best of all: It’s completely free—no hidden charges.
PRACTICE PAPER 20
1. What is a foreign key in relational databases? the CARTESIAN PRODUCT pairs every row of one
(A) A column that references a primary key in another relation with every row of another. Hence, union is the
table correct operator for combining tuples with duplicate
(B) A field storing numeric values only elimination.
(C) A backup column for daily logs
4. Which is not a valid MySQL data type?
(D) A special key that allows NULL values
(A) INT
Ans (B) VARCHAR
(A) A column that references a primary key in another (C) DATE
table (D) WORD
A foreign key is a column (or set of columns) that Ans
establishes a link to a primary key in a different table,
enforcing referential integrity. This relationship ensures (D) WORD
valid cross-references between tables. It can contain MySQL supports numerous data types including INT
matching values or NULL if the relationship permits for integers, VARCHAR for variable-length text, DATE
optional references. for date values, etc. There is no standard data type called
WORD in MySQL. That’s not a recognized type. Custom
2. Which SQL clause restricts rows returned by a query data types or synonyms are possible, but WORD does
based on a specified condition? not exist by default.
(A) FROM
5. Which statement differentiates the bus and star
(B) WHERE
(C) ORDER BY topologies?
(D) HAVING (A) Bus uses a central hub; star uses a single backbone
cable
Ans (B) Star features a central hub or switch; bus uses a
(B) WHERE single trunk line
WHERE filters rows during SELECT, UPDATE, or (C) Bus requires multiple routers; star never uses them
DELETE queries. It applies conditions row by row to (D) Both topologies require ring connections
exclude non-matching results. FROM designates the Ans
table source, ORDER BY arranges the returned data,
and HAVING filters groups formed by GROUP BY. (B) Star features a central hub or switch; bus uses a
Thus, WHERE is fundamental for row-level filtering. single trunk line
In a bus topology, all devices share one main
3. Which operation in relational algebra combines tuples communication line (the bus). In a star topology,
from two relations and removes duplicates? every node connects to a central hub or switch. This
(A) UNION arrangement clarifies the fundamental difference: bus
(B) INTERSECTION relies on a single cable, while star relies on a central
(C) PROJECTION node for data distribution.
(D) CARTESIAN PRODUCT
6. Which approach is most suitable for preventing repeated
Ans code blocks when handling exceptions in Python?
(A) UNION (A) Duplicating try-except in every function
UNION merges tuples from both relations, automatically (B) Using nested try statements
removing duplicates. INTERSECTION returns tuples (C) Defining reusable error-handling functions or
common to both, PROJECTION chooses columns, and context managers
Ans Options:
(A) 1-ii, 2-iv, 3-i, 4-iii
(A) 1-ii, 2-i, 3-iii, 4-iv (B) 1-iv, 2-i, 3-ii, 4-iii
HAVING filters grouped rows, ORDER BY sorts the (C) 1-i, 2-ii, 3-iv, 4-iii
result, FROM specifies the table(s) being queried, and (D) 1-iii, 2-i, 3-iv, 4-ii
SELECT designates the columns or expressions returned.
These clauses typically follow the sequence SELECT → Ans
FROM → WHERE → GROUP BY → HAVING → (A) 1-ii, 2-iv, 3-i, 4-iii
ORDER BY in more complex SQL statements. IndexError arises from using an invalid index for
sequences, IOError (or OSError in newer versions)
12. Match the following forms of network (Column A) with involves file read/write failure, AttributeError occurs
their description (Column B): when referencing a missing attribute or property,
Column A Column B and ZeroDivisionError arises from dividing by
1. LAN i. Covers large zero. Matching them clarifies Python’s built-in error
geographic regions categories.
2. MAN ii. Connects devices 14. Which statements about the stack data structure are
within a city true?
3. WAN iii. Connects devices in a 1. LIFO principle
small personal area 2. pop() removes the bottom element
4. PAN iv. Covers a local building 3. push() inserts at top
or campus 4. They are used in function call management
(A) 1, 2, and 3
Options:
(B) 1, 3, and 4
(A) 1-iv, 2-ii, 3-i, 4-iii
(C) 2, 3, and 4
(B) 1-ii, 2-iv, 3-i, 4-iii
(D) 1 and 4 only
(C) 1-iii, 2-i, 3-ii, 4-iv
(D) 1-i, 2-ii, 3-iv, 4-iii Ans
Ans (B) 1, 3, and 4
Stacks operate under Last-In, First-Out. The push()
(A) 1-iv, 2-ii, 3-i, 4-iii
operation adds elements to the top, and pop() removes
A Local Area Network (LAN) typically serves a small
from the top, not the bottom. Stacks are extensively used
region like a building or campus. A Metropolitan Area
for function call management, tracking return addresses
Network (MAN) spans a city. A Wide Area Network
and local variables. Hence, statements 1, 3, and 4 are
(WAN) covers huge geographical expanses, sometimes
valid descriptors.
global. A Personal Area Network (PAN) extends around
an individual’s workspace or devices. 15. Which statements about selection sort are true?
1. Finds minimum element each pass
13. Match the following Python exceptions (Column A)
2. Always O(n^2) in best and worst cases
with their cause (Column B):
3. Requires additional significant memory
Column A Column B 4. Swaps at most once per pass
(A) 1, 2, and 4
(B) 1, 2, and 3 18. Which statements about Python exception handling are
(C) 1, 3, and 4 valid?
(D) 2, 3, and 4 1. raise triggers an exception
Ans 2. except catches exceptions
3. else executes if no exception occurs in try
(A) 1, 2, and 4 4. finally executes always
Selection sort locates the smallest element each iteration 5. pass automatically retries the exception block
and places it at the front, leading to O(n^2) time in both (A) 1, 2, 3, and 4
best and worst scenarios. It only needs constant extra (B) 1, 2, 4, and 5
memory (besides the input array). Typically, it swaps (C) 2, 3, 4, and 5
one pair of elements per pass after finding the minimum. (D) 1, 2, 3, 4, and 5
16. Which statements about queue data structures are Ans
accurate? (A) 1, 2, 3, and 4
1. Follows LIFO raise explicitly creates an exception, except handles it,
2. enqueue() adds at rear else runs only if no exception arises, and finally always
3. dequeue() removes from front executes whether or not an exception is raised. pass does
4. Used for breadth-first search not retry anything; it’s a no-operation statement. Hence,
(A) 1, 2, and 3 statement 5 is incorrect, and the others are correct.
(B) 2, 3, and 4
(C) 1, 3, and 4 19. Assertion (A) : Bubble sort may perform fewer passes if
(D) 1 and 4 only the data becomes sorted early.
Ans Reason (R) : Bubble sort can detect no swaps in a pass
and terminate.
(B) 2, 3, and 4 (A) Both (A) and (R) are true, and (R) is the correct
A queue follows FIFO (not LIFO). Elements are inserted explanation
(enqueue) at the rear and removed (dequeue) from the (B) Both (A) and (R) are true, but (R) is not the correct
front. Queues are vital in breadth-first search to process explanation
nodes level by level. So 2, 3, and 4 correctly define queue (C) (A) is true, (R) is false
operations and uses. (D) (A) is false, (R) is true
17. Which statements about MySQL aggregate functions Ans
are correct? (A) Both (A) and (R) are true, and (R) is the correct
1. COUNT() returns row counts explanation
2. AVG() calculates average values Optimized bubble sort checks if any swap happened
3. MIN() and MAX() find smallest and largest values during a pass. If no elements swap, the array is already
4. They ignore NULL fields by default sorted, and it stops early, reducing the passes required.
(A) 1 and 2 only Consequently, (A) and (R) are both correct, with (R)
(B) 1, 2, 3, and 4 properly explaining why bubble sort can terminate
(C) 2 and 3 only sooner.
(D) 1, 2, and 3 only
20. Assertion (A) : In MySQL, the DELETE command
Ans
clears table data but keeps its structure.
(B) 1, 2, 3, and 4 Reason (R) : DROP TABLE removes both data and table
COUNT(), AVG(), MIN(), and MAX() are standard definition.
MySQL aggregates. By default, these functions exclude (A) Both (A) and (R) are true, and (R) is the correct
NULL fields, unless specifically instructed. COUNT() explanation
determines how many rows match, AVG() calculates (B) Both (A) and (R) are true, but (R) is not the correct
mean, MIN() and MAX() yield boundary values. All explanation
four statements accurately reflect aggregate function (C) (A) is true, (R) is false
behavior. (D) (A) is false, (R) is true
Ans
(A) Both (A) and (R) are true, and (R) is the correct translate between protocols, and a modem modulates/
explanation demodulates signals over telephone or cable lines.
The DELETE command removes all or specific rows
24. In Python, which method reads the entire file content
while preserving the table schema. DROP TABLE wipes
out the data and the table structure itself. Thus, the into a string?
reason clearly supports the assertion: one removes data (A) read()
only, and the other removes data plus definition. (B) readline()
(C) readlines()
21. Which command in MySQL is used to change an (D) input()
existing table’s structure, for example, adding a new Ans
column?
(A) SELECT (A) read()
(B) UPDATE The read() method fetches all the file contents as a single
(C) ALTER TABLE string if there’s enough memory. readline() reads just
(D) TRUNCATE one line at a time, and readlines() returns a list of lines.
The built-in input() function reads user input from the
Ans console, not from a file.
(C) ALTER TABLE
25. Which of the following is not typically a reason for a
ALTER TABLE modifies the table schema, such as
adding or removing columns or changing data types. Python ZeroDivisionError?
SELECT retrieves data, UPDATE modifies existing (A) Attempting 5/0 in integer division
rows, and TRUNCATE deletes all rows but retains the (B) Summation of zero with zero
table structure. Therefore, altering structure specifically (C) Dividing a float by zero
requires the ALTER TABLE command. (D) Using the modulo operator with zero
Ans
22. What are candidate keys in a relational table?
(A) Primary keys used only for indexing (B) Summation of zero with zero
(B) Keys that can become a primary key if chosen Adding zero and zero is a valid operation yielding zero
(C) Foreign keys referencing external tables and does not trigger an exception. Division by zero
(D) Non-essential keys ignored by queries in Python, whether integer, float, or modulus, raises
ZeroDivisionError. Summation with zero remains
Ans legitimate and safe, generating no error.
(B) Keys that can become a primary key if chosen
26. Which statement contrasts DROP TABLE with
Candidate keys can uniquely identify each row in a table,
making any one eligible to serve as primary. A table may TRUNCATE TABLE?
have multiple candidate keys, but only one is designated (A) Both remove the table structure
as the primary key. Foreign keys reference other tables, (B) TRUNCATE removes structure; DROP removes
and indexing is a separate optimization concern. data only
(C) TRUNCATE quickly deletes all rows but retains
23. Which network device interconnects multiple LAN structure, while DROP removes the entire table
segments but cannot translate between different (D) DROP resets auto-increment counters;
protocols? TRUNCATE does not
(A) Router Ans
(B) Switch
(C) Gateway (C) TRUNCATE quickly deletes all rows but retains
(D) Modem structure, while DROP removes the entire table
TRUNCATE is a DDL command that empties a table
Ans while retaining its schema, often faster than DELETE.
(B) Switch DROP TABLE removes both table data and structure.
A switch forwards data frames within the same By design, TRUNCATE resets auto-increment counters
protocol and network type, typically Ethernet, across too, while DROP eliminates them entirely. Hence, that
multiple LAN segments. A router routes packets across is the core difference.
different networks (e.g., LAN to WAN). A gateway can
27. Which structure is most efficient for checking if an item (C) Mode
exists in a collection of unique values? (D) Range
(A) List Ans
(B) Stack
(C) Set (B) Median
(D) Queue The median is the middle value in a sorted dataset,
effectively dividing the distribution into two equal
Ans parts. Mean is an arithmetic average, mode is the most
(C) Set frequent value, and range is the difference between the
A Python set provides O(1) average-time membership highest and lowest values. Thus, median separates the
checks, making it highly efficient for verifying existence upper and lower halves.
in a collection. Lists or queues require O(n) membership
31. Which is the main advantage of using prepared
checks, and stacks operate similarly. A set uses a hash-
based implementation, speeding up lookups for unique statements in SQL?
elements. (A) They cannot be executed multiple times
(B) They reduce security
28. Which function in MySQL gives the current date as (C) They improve performance and prevent SQL
YYYY-MM-DD? injection
(A) DATE() (D) They disable transaction control
(B) CURDATE() Ans
(C) CURRENT_YEAR()
(D) NOW() (C) They improve performance and prevent SQL
injection
Ans Prepared statements parse and optimize a query plan
(B) CURDATE() once, then reuse it multiple times, improving efficiency.
CURDATE() returns the current date in YYYY-MM- They separate query structure from user inputs, reducing
DD format. DATE() is typically used to extract the date the likelihood of malicious input altering queries. This
part from a datetime expression, CURRENT_YEAR() is separation helps prevent SQL injection attacks, thus
invalid, and NOW() returns the current date and time enhancing both security and performance.
in a datetime format. CURDATE() specifically supplies
32. Which function is not an aggregate function in MySQL?
today’s date.
(A) SUM()
29. Which type of cable is known for high bandwidth and (B) REPLACE()
minimal signal loss? (C) COUNT()
(A) Twisted pair (D) AVG()
(B) Coaxial cable Ans
(C) Optical fiber
(D) Ethernet (Cat5) (B) REPLACE()
SUM(), COUNT(), and AVG() perform aggregation
Ans over a set of rows. REPLACE() is generally a string
(C) Optical fiber function that substitutes occurrences of a substring.
Optical fiber uses light signals through thin glass or It does not produce group-level summaries. Hence,
plastic strands, providing extremely high bandwidth REPLACE() is not an aggregate function, while the
and minimal signal degradation over long distances. others operate on numeric or row sets.
Twisted pair (including typical Ethernet cables) and
33. Which statement correctly describes how BFS (Breadth-
coaxial cable have lower capacity in comparison. Optical
fiber dominates high-speed backbone communication First Search) uses a queue?
links. (A) BFS uses multiple stacks for parallel paths
(B) BFS enqueues visited nodes and processes them in
30. Which measure of central tendency splits the data so LIFO order
half of the values lie above and half below? (C) BFS enqueues starting nodes and processes them in
(A) Mean FIFO order
(B) Median (D) BFS uses recursion exclusively
Function calls in most programming languages use a rows based on the date column, aggregate functions
call stack to store return addresses, local variables, and like SUM() can be applied to find total sales per day.
other context information. Each time a function invokes HAVING filters group results, ORDER BY sorts, and
another, a new stack frame is pushed. Upon return, the DROP TABLE deletes structures.
stack frame is popped, restoring the caller’s context. This
42. Which network topology is specified for the store’s
mechanism underlies recursion.
internal system?
40. Which relational algebra operation extracts certain (A) Ring
attributes (columns) from a relation? (B) Mesh
(A) Selection (C) Bus
(B) Projection (D) Star
(C) Intersection Ans
(D) Union
(D) Star
Ans The network is described as a star topology, indicating
(B) Projection all endpoints connect to a central switch or hub. This
Projection (π) returns a relation containing only specified setup simplifies management and error isolation. Ring
columns of the original relation, possibly removing topology forms continuous loops, mesh connects
duplicates. Selection (σ) filters rows, intersection retains devices in multiple paths, and bus uses a single backbone
rows common to two relations, and union merges rows cable, none matching the description here.
from both. Projection specifically narrows the set of
43. Which data structure is highlighted for order processing?
attributes shown.
(A) Stack
Direction :Carefully read the case study provided and then (B) Queue
thoroughly answer the subsequent five questions. (C) Linked list
A retail company uses a MySQL database to handle (D) Hash table
sales transactions. Each record stores product details, Ans
quantities, and total amounts. Managers run queries with
GROUP BY to see daily or monthly total sales. They also (B) Queue
rely on Python scripts that read transaction logs from files, The text explicitly mentions FIFO processing for orders,
using exception handling to gracefully manage missing or which is characteristic of a queue. This structure handles
corrupted entries. The store’s internal network is arranged incoming tasks in the order received. A stack uses LIFO,
in a star topology with a central switch. Periodically, IT a linked list could be either but doesn’t inherently define
staff implement queue structures for processing orders in FIFO or LIFO, and a hash table supports fast lookups,
FIFO order. An external firewall protects against threats, not ordering.
while anti-malware systems scan newly added data. 44. Which Python concept ensures corrupted file logs do
Detailed data analysis employs Python’s built-in statistics not crash the script?
functions for evaluating sales performance. The system’s (A) with open()
success hinges on robust database design, network (B) pass statement
security, and efficient data structures. (C) Exception handling
41. Which MySQL feature helps managers group and sum (D) Global variables
sales by day? Ans
(A) HAVING (C) Exception handling
(B) GROUP BY By using try-except blocks, developers can catch file-
(C) ORDER BY related errors like unreadable or missing logs and
(D) DROP TABLE handle them accordingly. The with open() statement
Ans helps manage file resources but doesn’t alone handle
(B) GROUP BY corruption. pass simply does nothing, and global
GROUP BY lets managers generate aggregated variables do not secure scripts from file-specific errors.
calculations, such as daily sums of sales. By grouping
45. Which security measure specifically protects the 47. Which Python feature helps avoid crashes if a CSV file
internal network from external intrusions? is missing?
(A) Anti-malware system (A) pass statement
(B) Switch-based star topology (B) for loop
(C) Firewall (C) Exception handling (try-except)
(D) Python scripts (D) slicing
Ans Ans
(C) Firewall (C) Exception handling (try-except)
The case study highlights an external firewall as a line try-except blocks allow the script to handle missing or
of defense against unauthorized access or malicious inaccessible files gracefully rather than crashing. pass is
requests. While anti-malware systems guard against a no-operation command, for loops iterate, and slicing
viruses, the firewall filters incoming or outgoing traffic at manipulates data structures. Therefore, robust error
the network boundary. Switches organize the LAN, and handling keeps the script running even if file-related
Python scripts automate data processing, not security. issues appear.
Direction :Carefully read the case study provided and then 48. Which network topology does the lab use, based on
thoroughly answer the subsequent five questions. legacy infrastructure?
A research laboratory maintains a central database (A) Star
to record experimental results and researcher details. (B) Ring
Tables include Experiments (storing data points and (C) Bus
completion dates) and Researchers (storing names and (D) Mesh
contact information). MySQL queries retrieve daily logs, Ans
often sorted by completion date using ORDER BY. Python
scripts regularly import CSV files containing new results, (C) Bus
employing try-except to prevent crashes if a file is missing. The study explicitly mentions a bus topology, an older
The lab’s computer network runs on a bus topology due setup where devices connect to a single central cable.
to legacy infrastructure. Data structures such as stacks Star topology uses a switch or hub, ring forms a loop,
help track function calls in complex simulation programs. and mesh offers multiple interconnected paths. Legacy
Additionally, the lab invests in security measures, labs sometimes retain bus networks to avoid upgrading
including a firewall and system updates, to deter malware all wiring.
infiltration. Scientists rely on these well-coordinated 49. Which data structure is mentioned for managing
elements—database integrity, structured networking, function calls in simulations?
and robust error handling—to advance research. (A) Queue
46. Which MySQL clause is used to sort experimental (B) Stack
results by completion date? (C) Hash map
(A) HAVING (D) Linked list
(B) GROUP BY Ans
(C) ORDER BY (B) Stack
(D) DROP TABLE The text states that stacks manage function calls in
Ans simulation programs, aligning with standard call stack
(C) ORDER BY behavior. Each function call pushes context onto the
ORDER BY arranges query results based on one or stack, which is popped upon return. Queues use FIFO
more columns, such as the completion date, either logic, hash maps handle key-value storage, and linked
ascending or descending. GROUP BY aggregates rows, lists store sequences of nodes.
HAVING filters groups, and DROP TABLE removes a 50. Which security measure is highlighted alongside system
table. Therefore, ORDER BY is specifically for sorting updates to guard against malware?
results by completion date. (A) A new bus cable
(B) Firewall
(C) ORDER BY clause
**************
Expand Your Reach: Your readers can share these PDFs on other platforms, helping your
influence grow exponentially.
Still not convinced? Ask us how, and we’ll walk you through exactly how it works.
Best of all: It’s completely free—no hidden charges.