Computer Knowledge — Database/SQL
Aptitude · Reasoning · English · CS — Corporate & Campus Interview Prep
100 Questions 5 Topics Take Test
Advertisement
Showing 11–20 of 100 questions in Database/SQL
Q.11 Medium Database/SQL
In cybersecurity, what does encryption primarily protect against?
A Physical theft of devices
B SQL injection attacks
C Unauthorized access to data during transmission
D Database schema changes
Correct Answer:  C. Unauthorized access to data during transmission
Explanation:

Encryption converts data into unreadable format, protecting it from unauthorized access during transmission and storage.

Take Test
Q.12 Medium Database/SQL
Which sorting algorithm has the best average-case time complexity?
A Bubble Sort - O(n²)
B Merge Sort - O(n log n)
C Insertion Sort - O(n²)
D Selection Sort - O(n²)
Correct Answer:  B. Merge Sort - O(n log n)
Explanation:

Merge Sort and Quick Sort have O(n log n) average complexity. Merge Sort guarantees this; Quick Sort can degrade to O(n²) in worst case.

Take Test
Q.13 Medium Database/SQL
What is the primary function of a query optimizer in a DBMS?
A Compile SQL queries into machine code
B Determine the most efficient execution plan for queries
C Encrypt sensitive data in queries
D Validate SQL syntax errors
Correct Answer:  B. Determine the most efficient execution plan for queries
Explanation:

The query optimizer analyzes different execution strategies and selects the one with minimal resource consumption and execution time.

Take Test
Q.14 Medium Database/SQL
In machine learning basics, what is the purpose of training data in AI models?
A To test the final model accuracy
B To teach the model patterns and make predictions
C To validate model security
D To encrypt sensitive information
Correct Answer:  B. To teach the model patterns and make predictions
Explanation:

Training data is used to teach AI models to recognize patterns. Test data evaluates accuracy; validation data prevents overfitting.

Take Test
Q.15 Hard Database/SQL
What is a deadlock in database management?
A A situation where transactions block indefinitely waiting for each other
B Loss of database connection
C Unauthorized access to database
D Corruption of data files
Correct Answer:  A. A situation where transactions block indefinitely waiting for each other
Explanation:

A deadlock occurs when two or more transactions wait for resources held by each other, creating a circular wait condition that prevents progress.

Take Test
Advertisement
Q.16 Hard Database/SQL
Which of the following best describes eventual consistency in distributed databases?
A All nodes have identical data at all times
B Data will be consistent across all nodes eventually, not immediately
C Data consistency is never achieved
D Only primary nodes maintain consistency
Correct Answer:  B. Data will be consistent across all nodes eventually, not immediately
Explanation:

Eventual consistency is a model in NoSQL and distributed systems where updates propagate asynchronously, achieving consistency over time rather than immediately.

Take Test
Q.17 Hard Database/SQL
In network protocols, which layer does TCP/IP operate at?
A Physical Layer
B Data Link Layer
C Transport and Network Layers
D Application Layer only
Correct Answer:  C. Transport and Network Layers
Explanation:

TCP operates at Layer 4 (Transport) and IP at Layer 3 (Network) in the OSI model. Together they form the TCP/IP protocol suite.

Take Test
Q.18 Hard Database/SQL
What is the primary vulnerability addressed by SQL injection prevention techniques like parameterized queries?
A Buffer overflow attacks
B Injection of malicious SQL code into database queries
C Man-in-the-middle attacks
D DDoS attacks on database server
Correct Answer:  B. Injection of malicious SQL code into database queries
Explanation:

Parameterized queries prevent SQL injection by separating query structure from data, ensuring user input cannot be interpreted as executable code.

Take Test
Q.19 Hard Database/SQL
In the context of graph databases, what is the primary advantage over relational databases for relationship-heavy queries?
A Lower storage requirements
B Faster execution of complex relationship traversals
C Better support for unstructured data
D Superior ACID compliance
Correct Answer:  B. Faster execution of complex relationship traversals
Explanation:

Graph databases excel at querying relationships with O(1) traversal time, whereas relational databases require expensive JOIN operations for similar queries.

Take Test
Q.20 Easy Database/SQL
Which of the following is a non-relational database designed for handling unstructured data at scale?
A MongoDB
B PostgreSQL
C Oracle Database
D MySQL
Correct Answer:  A. MongoDB
Explanation:

MongoDB is a NoSQL document database that handles unstructured and semi-structured data efficiently, unlike relational databases like PostgreSQL, Oracle, and MySQL.

Take Test
IGET
iget AI
Online · Ask anything about exams
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