Home Subjects Computer Knowledge Database/SQL

Computer Knowledge
Database/SQL

Programming, networking, database and OS questions

32 Q 2 Topics Take Mock Test
Advertisement
Difficulty: All Easy Medium Hard 11–20 of 32
Topics in Computer Knowledge
All C Programming 200 Database/SQL 100
Q.11 Easy Database/SQL
What is the time complexity of the binary search algorithm on a sorted array?
A O(n)
B O(log n)
C O(n log n)
D O(n²)
Correct Answer:  B. O(log n)
EXPLANATION

Binary search divides the search space in half with each iteration, resulting in O(log n) time complexity on sorted data.

Test
Q.12 Easy Database/SQL
What is the primary function of a hash table data structure?
A To maintain sorted data
B To provide O(1) average-case lookup time using hash functions
C To implement tree traversal
D To perform recursive function calls
Correct Answer:  B. To provide O(1) average-case lookup time using hash functions
EXPLANATION

Hash tables use hash functions to map keys to indices, providing O(1) average-case lookup, insertion, and deletion operations.

Test
Q.13 Easy Database/SQL
In AWS, what does the term 'Auto Scaling' primarily ensure?
A Automatic backup of databases
B Automatic adjustment of compute capacity based on demand
C Automatic encryption of data
D Automatic software updates
Correct Answer:  B. Automatic adjustment of compute capacity based on demand
EXPLANATION

AWS Auto Scaling automatically adjusts the number of EC2 instances based on demand metrics like CPU utilization or network traffic.

Test
Q.14 Easy Database/SQL
What is the main disadvantage of using a linked list compared to arrays?
A Linked lists use more memory due to pointers
B Linked lists have O(1) insertion at beginning
C Linked lists cannot be sorted
D Linked lists have cache locality issues
Correct Answer:  A. Linked lists use more memory due to pointers
EXPLANATION

Linked lists require extra memory for storing pointers/references in each node, making them memory-inefficient compared to arrays.

Test
Q.15 Easy Database/SQL
In the OSI model, which layer is responsible for routing and logical addressing?
A Physical Layer
B Data Link Layer
C Network Layer
D Transport Layer
Correct Answer:  C. Network Layer
EXPLANATION

The Network Layer (Layer 3) handles routing, IP addressing, and logical path determination for data packets.

Test
Q.16 Easy Database/SQL
What is the primary purpose of indexing in databases?
A To reduce storage space
B To speed up data retrieval operations
C To enforce data integrity
D To manage concurrent access
Correct Answer:  B. To speed up data retrieval operations
EXPLANATION

Indexes create a faster lookup structure similar to a book's index, enabling rapid data retrieval without full table scans.

Test
Q.17 Easy Database/SQL
Which algorithm has O(n log n) time complexity and is preferred for large datasets in modern databases?
A Bubble Sort
B Merge Sort
C Selection Sort
D Insertion Sort
Correct Answer:  B. Merge Sort
EXPLANATION

Merge Sort maintains O(n log n) complexity in all cases and is stable, making it ideal for sorting large datasets.

Test
Q.18 Easy Database/SQL
In a relational database, what does normalization primarily aim to eliminate?
A NULL values
B Data redundancy and anomalies
C Foreign key constraints
D Index creation
Correct Answer:  B. Data redundancy and anomalies
EXPLANATION

Normalization removes data redundancy and prevents update, insertion, and deletion anomalies through organized table structures.

Test
Q.19 Easy Database/SQL
What is the primary advantage of using INNER JOIN over OUTER JOIN in SQL?
A It processes faster for small datasets
B It returns only matching records from both tables
C It uses less memory than OUTER JOIN
D It can handle NULL values better
Correct Answer:  B. It returns only matching records from both tables
EXPLANATION

INNER JOIN returns only rows that have matching values in both tables, making queries more efficient for specific requirements.

Test
Q.20 Easy Database/SQL
Which of the following is a ACID property that ensures all or nothing transaction execution?
A Atomicity
B Consistency
C Isolation
D Durability
Correct Answer:  A. Atomicity
EXPLANATION

Atomicity ensures that a transaction is treated as a single unit - either all operations complete or none do.

Test
IGET
IGET AI
Online · Exam prep assistant
Hi! 👋 I'm your iget AI assistant.

Ask me anything about exam prep, MCQ solutions, study tips, or strategies! 🎯
UPSC strategy SSC CGL syllabus Improve aptitude NEET Biology tips