Computer Knowledge — Database/SQL
Programming, networking, database and OS questions
100 Questions 5 Topics Take Test
Advertisement
Showing 1–10 of 100 questions in Database/SQL
Q.1 Hard Database/SQL
In a sharded database architecture deployed on cloud infrastructure, which of the following represents the most critical challenge that must be addressed?
A Shard key selection and distribution skew
B Implementing full-text search across shards
C Eliminating all network latency between shards
D Converting all queries to read-only operations
Correct Answer:  A. Shard key selection and distribution skew
EXPLANATION

Shard key selection determines data distribution and performance. Poor shard key choices lead to hotspots, uneven load distribution, and performance degradation across the sharded cluster.

Take Test
Q.2 Easy Database/SQL
Which of the following represents a vulnerability in SQL query construction that can be exploited through malicious user input, and can be prevented using parameterized queries?
A Buffer overflow attacks
B Cross-site scripting (XSS)
C SQL injection attacks
D Distributed denial of service (DDoS)
Correct Answer:  C. SQL injection attacks
EXPLANATION

SQL injection occurs when untrusted input is concatenated into SQL queries. Parameterized queries/prepared statements separate code from data, preventing attackers from modifying query logic.

Take Test
Q.3 Medium Database/SQL
In the context of distributed databases, which consistency model is used by most cloud-native databases like DynamoDB and offers eventual consistency?
A Strong Consistency
B Causal Consistency
C Eventual Consistency
D Linearizability
Correct Answer:  C. Eventual Consistency
EXPLANATION

Cloud-native NoSQL databases prioritize availability and partition tolerance (CAP theorem), implementing eventual consistency to handle distributed system challenges while maintaining horizontal scalability.

Take Test
Q.4 Medium Database/SQL
Which of the following SQL query optimization techniques is most effective when dealing with large fact tables in a data warehouse environment?
A Using UNION instead of UNION ALL
B Materialized views and denormalization
C Increasing the number of JOINs in queries
D Using correlated subqueries for filtering
Correct Answer:  B. Materialized views and denormalization
EXPLANATION

Data warehouses use materialized views to pre-aggregate data and strategic denormalization for faster analytical queries. These techniques significantly improve performance on large fact tables.

Take Test
Q.5 Medium Database/SQL
In database indexing, which type of index structure provides the best average-case performance for range queries in modern database systems?
A Hash Index
B B+ Tree Index
C Bitmap Index
D Full-text Index
Correct Answer:  B. B+ Tree Index
EXPLANATION

B+ Tree indexes maintain sorted order and support efficient range queries, point queries, and prefix searches. Hash indexes are faster for exact matches but cannot handle range queries efficiently.

Take Test
Advertisement
Q.6 Easy Database/SQL
Which of the following is a characteristic of NoSQL databases that makes them suitable for handling big data in cloud environments?
A Strict ACID compliance across all nodes
B Horizontal scalability and schema-less design
C Requirement for predefined schemas before insertion
D Complex JOIN operations for data retrieval
Correct Answer:  B. Horizontal scalability and schema-less design
EXPLANATION

NoSQL databases like MongoDB and Cassandra are designed for horizontal scaling and flexible schemas, making them ideal for cloud-based big data applications with varying data structures.

Take Test
Q.7 Easy Database/SQL
In a relational database, which normal form eliminates partial dependencies and is considered essential for most practical database designs?
A Second Normal Form (2NF)
B Third Normal Form (3NF)
C Boyce-Codd Normal Form (BCNF)
D Fourth Normal Form (4NF)
Correct Answer:  B. Third Normal Form (3NF)
EXPLANATION

3NF eliminates partial and transitive dependencies, making it the standard for practical database design. BCNF is stricter but 3NF is the most commonly implemented normalization form.

Take Test
Q.8 Hard Database/SQL
In AI/ML, what is the role of activation functions in neural networks?
A Encrypt network weights
B Introduce non-linearity enabling networks to learn complex patterns
C Increase training speed
D Reduce dataset size
Correct Answer:  B. Introduce non-linearity enabling networks to learn complex patterns
EXPLANATION

Activation functions (ReLU, sigmoid, tanh) add non-linearity, allowing neural networks to approximate non-linear relationships.

Take Test
Q.9 Hard Database/SQL
What is the primary challenge of implementing ACID properties in distributed databases?
A Requires minimal network latency
B Network partitions, latency, and node failures make maintaining consistency difficult while ensuring availability
C Distributed systems automatically ensure ACID
D Only centralized databases can support ACID
Correct Answer:  B. Network partitions, latency, and node failures make maintaining consistency difficult while ensuring availability
EXPLANATION

The CAP theorem shows it's impossible to guarantee all three: Consistency, Availability, and Partition tolerance simultaneously.

Take Test
Q.10 Hard Database/SQL
In distributed systems, what is a consensus algorithm primarily used for?
A Encrypting data
B Ensuring all nodes agree on a single value despite failures
C Compressing database files
D Load balancing across servers
Correct Answer:  B. Ensuring all nodes agree on a single value despite failures
EXPLANATION

Consensus algorithms (like Raft, Paxos) enable distributed systems to reliably agree on state even with node failures.

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