Exam: DP-900: Microsoft Azure Data Fundamentals 0 Likes
Which T-SQL statement should be used to instruct a database management (DP-900)
Which T-SQL statement should be used to instruct a database management system to use an index instead of performing a full table scan?
A. SELECT
B. WHERE
C. JOIN
Solution
Correct answer: B. WHERE.
In T-SQL, the WHERE clause is primarily used to filter rows based on a condition, and it helps the database management system decide whether to use an index or perform a full table scan.
Why not A or C?
A. SELECT: The SELECT statement specifies what columns to retrieve but doesn't inherently influence whether an index is used.
C. JOIN: While JOIN operations can utilize indexes (e.g., on foreign key columns), it's the ON clause in the JOIN that might direct index use. This isn't directly related to instructing the DBMS to use an index.
To encourage index use in queries, ensure indexes exist on columns frequently used in WHERE, ON, or ORDER BY clauses.
Category: Core Data Concepts