Q#1: Query optimization in DBMS aims to:
(A) Find the most efficient way to execute a query
(B) Normalize tables
(C) Encrypt queries
(D) Backup database
Answer: (A) Find the most efficient way to execute a query
Q#2: The query optimizer works on:
(A) Logical and physical query plans
(B) Only SQL syntax
(C) Backup files
(D) Encrypted data
Answer: (A) Logical and physical query plans
Q#3: Heuristic query optimization uses:
(A) Rule-based transformations
(B) Cost estimation
(C) Random execution
(D) Backup techniques
Answer: (A) Rule-based transformations
Q#4: Cost-based query optimization uses:
(A) Estimated CPU, I/O, and memory costs
(B) Syntax checking only
(C) Backup scheduling
(D) Encryption overhead
Answer: (A) Estimated CPU, I/O, and memory costs
Q#5: A logical query plan represents:
(A) Sequence of relational algebra operations
(B) Physical storage structure
(C) Backup plan
(D) Index structure
Answer: (A) Sequence of relational algebra operations
Q#6: A physical query plan specifies:
(A) Access methods and join algorithms
(B) Only table names
(C) Backup methods
(D) Encryption keys
Answer: (A) Access methods and join algorithms
Q#7: Query rewriting helps in:
(A) Transforming queries into more efficient forms
(B) Encrypting queries
(C) Normalizing tables
(D) Backup scheduling
Answer: (A) Transforming queries into more efficient forms
Q#8: Selection operation can be optimized by:
(A) Using indexes
(B) Sorting data only
(C) Hashing only
(D) Backup methods
Answer: (A) Using indexes
Q#9: Projection operation can be optimized by:
(A) Eliminating duplicates early
(B) Using indexes
(C) Hashing
(D) Encryption
Answer: (A) Eliminating duplicates early
Q#10: Join operation can be optimized using:
(A) Nested-loop join, sort-merge join, or hash join
(B) Only nested-loop join
(C) Only sort-merge join
(D) Only hash join
Answer: (A) Nested-loop join, sort-merge join, or hash join
Q#11: Nested-loop join is efficient when:
(A) One table is small
(B) Both tables are huge
(C) Tables are sorted
(D) Only one table exists
Answer: (A) One table is small
Q#12: Sort-merge join requires:
(A) Tables to be sorted on join attribute
(B) No sorting
(C) Only indexes
(D) Hash function
Answer: (A) Tables to be sorted on join attribute
Q#13: Hash join is efficient when:
(A) Tables fit into memory or hash buckets
(B) Tables are very small
(C) Tables are already sorted
(D) Only one table exists
Answer: (A) Tables fit into memory or hash buckets
Q#14: Cardinality estimation helps the optimizer to:
(A) Predict number of rows in intermediate results
(B) Encrypt queries
(C) Normalize tables
(D) Backup database
Answer: (A) Predict number of rows in intermediate results
Q#15: Statistics collected on tables include:
(A) Number of rows, distinct values, and data distribution
(B) Only number of rows
(C) Only column names
(D) Only primary keys
Answer: (A) Number of rows, distinct values, and data distribution
Q#16: Cost estimation in query optimization considers:
(A) CPU, I/O, and memory usage
(B) Syntax only
(C) Backup time
(D) Encryption overhead
Answer: (A) CPU, I/O, and memory usage
Q#17: Pipelining in query execution helps to:
(A) Stream intermediate results to next operation
(B) Store all results in disk first
(C) Encrypt queries
(D) Backup intermediate data
Answer: (A) Stream intermediate results to next operation
Q#18: Materialized views help query optimization by:
(A) Providing precomputed results
(B) Encrypting queries
(C) Normalizing tables
(D) Backup only
Answer: (A) Providing precomputed results
Q#19: Join order affects query performance because:
(A) It changes size of intermediate results
(B) It changes syntax
(C) It changes backups
(D) It changes encryption
Answer: (A) It changes size of intermediate results
Q#20: Transformation of subqueries into joins improves:
(A) Execution efficiency
(B) Syntax only
(C) Backup efficiency
(D) Encryption
Answer: (A) Execution efficiency
Q#21: Index usage can improve:
(A) Selection and join operations
(B) Only projection
(C) Only backup
(D) Only encryption
Answer: (A) Selection and join operations
Q#22: Rule-based optimization is also called:
(A) Heuristic optimization
(B) Cost-based optimization
(C) Random optimization
(D) Backup optimization
Answer: (A) Heuristic optimization
Q#23: Cost-based optimization chooses plan with:
(A) Lowest estimated cost
(B) Highest cost
(C) Random plan
(D) Backup-friendly plan
Answer: (A) Lowest estimated cost
Q#24: Logical equivalence of queries helps the optimizer to:
(A) Transform queries into equivalent but efficient forms
(B) Encrypt queries
(C) Backup queries
(D) Normalize tables
Answer: (A) Transform queries into equivalent but efficient forms
Q#25: Access paths include:
(A) Full table scan, index scan, index-only scan
(B) Backup paths
(C) Encryption paths
(D) Normalization paths
Answer: (A) Full table scan, index scan, index-only scan
Q#26: Query optimization reduces:
(A) CPU and I/O cost
(B) Storage only
(C) Encryption overhead
(D) Backup time only
Answer: (A) CPU and I/O cost
Q#27: Predicate pushdown is a technique to:
(A) Apply selection operations early
(B) Apply projection early
(C) Apply join late
(D) Encrypt data
Answer: (A) Apply selection operations early
Q#28: Main difference between logical and physical query plan:
(A) Logical specifies operations, physical specifies access methods
(B) Logical is encrypted
(C) Physical is normalized
(D) Both backup plans
Answer: (A) Logical specifies operations, physical specifies access methods
Q#29: Query optimization is crucial for:
(A) Large databases and complex queries
(B) Small queries only
(C) Backup operations
(D) Encryption
Answer: (A) Large databases and complex queries
Q#30: Main goal of query optimization is:
(A) Execute queries efficiently with minimal resources
(B) Encrypt database
(C) Normalize tables
(D) Backup tables
Answer: (A) Execute queries efficiently with minimal resources