Query Processing Questions and Explanation
Query Processing Questions and Explanation
Query Optimization
Join Optimization
18. Which step checks if all attribute names are valid in a query?
a) Parsing
b) Optimization
c) Execution
d) Storage
Answer: a) Parsing
Explanation: Parsing ensures attribute names are valid and exist in the database schema.
19. What is the main role of the query optimizer?
a) Execute the query
b) Choose an efficient execution strategy
c) Store queries for future use
d) Convert SQL to machine code
Answer: b) Choose an efficient execution strategy
Explanation: The optimizer selects the best execution plan to reduce execution cost.
20. What is the benefit of indexing in query optimization?
a) Increases query response time
b) Reduces data redundancy
c) Speeds up data retrieval
d) Eliminates foreign keys
Answer: c) Speeds up data retrieval
Explanation: Indexing helps locate data faster, reducing query execution time.
25. What is the difference between logical and physical query plans?
a) Logical plan focuses on what data is needed, while physical plan focuses on how to
retrieve it
b) Logical plan involves indexing, while physical plan involves joins
c) Logical plan is for storage, while physical plan is for execution
d) Logical plan runs faster than physical plan
Answer: a) Logical plan focuses on what data is needed, while physical plan focuses on
how to retrieve it
Explanation: Logical query plans describe the data needed, while physical query plans
detail execution methods.
26. Why is minimizing disk I/O important in query execution?
a) It reduces the time required for query execution
b) It improves database security
c) It increases the complexity of the query
d) It reduces the need for indexing
Answer: a) It reduces the time required for query execution
Explanation: Disk I/O is often the slowest operation, so reducing it speeds up query
performance.
27. How does query decomposition help in processing complex queries?
a) It breaks them into smaller, manageable subqueries
b) It removes SQL constraints
c) It converts queries into relational algebra expressions
d) It merges multiple queries into one
Answer: a) It breaks them into smaller, manageable subqueries
Explanation: Query decomposition simplifies processing by dividing complex queries
into smaller parts.
Final Questions