Database Fundamentals — Question 7
You have the following SQL query
SELECT * FROM dbo.ProAthlete WHERE Salary > 500000
The query takes too much time to return data.
You need to improve the performance of the query.
Which item should you add to the Salary column?
Answer options
- A. Non-null constraint
- B. Default constraint
- C. Index
- D. Foreign key
Correct answer: C
Explanation
Adding an Index to the Salary column will significantly speed up query performance by allowing the database to quickly locate the relevant rows. The other options, such as Non-null and Default constraints, do not improve query execution speed, and a Foreign key is irrelevant in this context as it relates to relationships between tables rather than query performance.