exam questions

Exam DP-900 All Questions

View all questions & answers for the DP-900 exam

Exam DP-900 topic 1 question 100 discussion

Actual exam question from Microsoft's DP-900
Question #: 100
Topic #: 1
[All DP-900 Questions]

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
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
NIKnithiy
Highly Voted 2 years, 1 month ago
This is quite tricky WHERE is a clause but SELECT is the statement so answer A is correct
upvoted 41 times
jordymsft
1 year, 10 months ago
That is correct. https://learn.microsoft.com/en-us/sql/t-sql/statements/statements?view=sql-server-ver16 https://data-flair.training/blogs/clause-in-sql/#:~:text=Clauses%20are%20in%2Dbuilt%20functions,data%20required%20by%20the%20user.
upvoted 5 times
...
...
stella_mah
Highly Voted 1 year, 7 months ago
Selected Answer: B
Not a trick question, just how much you understand database. Select * From Countries where CountryName = "USA" This is a full table scan because CountryName is not a key, the engine need to compare every row. Select * From Countries where CountryID = 33 This is not a full table scan, it become a index scan because CountryID is a key so the engine know it can skip to that ID Select * From Countries This is a full table scan but with no criteria, so it extract everything out
upvoted 20 times
...
razit
Most Recent 3 weeks, 3 days ago
Selected Answer: A
https://learn.microsoft.com/en-us/sql/t-sql/statements/statements?view=sql-server-ver16
upvoted 1 times
...
6c05957
4 months, 1 week ago
Selected Answer: B
From CGPT : The correct answer is B. WHERE. In T-SQL, the WHERE clause is used to filter records. When an index is available on the columns specified in the WHERE clause, the database management system can use the index to quickly locate the rows that match the condition, avoiding a full table scan. Do you have any other questions about T-SQL or databases?
upvoted 1 times
...
twhiz
8 months, 2 weeks ago
the correct answer is select. because it is a statement. where is a clause and not a statement
upvoted 1 times
...
AGTraining
8 months, 2 weeks ago
option A
upvoted 1 times
...
gabo
8 months, 4 weeks ago
Selected Answer: A
In T-SQL, you can use a query hint to instruct the database management system (DBMS) to use a specific index instead of performing a full table scan. The hint you would use is called WITH(INDEX(index_name)). Here's how you would use it: SELECT column1, column2, ... FROM table_name WITH(INDEX(index_name)) WHERE condition;
upvoted 3 times
...
Yomzie
9 months ago
Answer is option B:: WHERE clause tells a Select to 'streamline' the query execution, on the search criteria (the PREDICATE) specified in the "where" clause. To use an index in a query, if the index is defined on the column specified in the WHERE clause, the query makes use of the specified index:: CREATE TABLE person( id INT NOT NULL, first_name VARCHAR(15) NOT NULL, last_name VARCHAR(15) NOT NULL, age INT NOT NULL, PRIMARY KEY(id) ); /* Index on First Name */ CREATE INDEX person_fname ON person (first_name); /* This next query shows whether the query uses the intended index */ explain SELECT * FROM person WHERE first_name = "Donald" \G
upvoted 1 times
...
kingAzure
9 months, 2 weeks ago
Selected Answer: A
I agree with NIKnithiy on this one. SELECT is a statement, WHERE is a clause. The link in the answer is also nice as it lists the statements in question. https://learn.microsoft.com/en-us/sql/t-sql/queries/hints-transact-sql-table?view=sql-server-ver16
upvoted 1 times
...
ikramus
9 months, 2 weeks ago
from chatgpt : To instruct a database management system to use an index instead of performing a full table scan, you typically use a hint in the SELECT statement. Therefore, the correct choice from the provided options is: A. SELECT You would use the WITH(INDEX(index_name)) hint within the SELECT statement to specify the index to be used.
upvoted 1 times
...
ff09375
10 months, 1 week ago
FWIW, GPT says "B"
upvoted 1 times
...
Houassa
10 months, 3 weeks ago
Selected Answer: A
The key word here is STATEMENT. WHERE is a CLAUSE.
upvoted 1 times
...
ravinperera
11 months, 3 weeks ago
A. SELECT In the SELECT statement, you can specify which index to use for the query. This is typically done using query hints, like WITH (INDEX(index_name)), to suggest the use of a particular index. This approach is used when you have a specific understanding of the database's structure and the indexes available, and you want to guide the SQL Server query optimizer to use a specific index. The WHERE and JOIN clauses are used for filtering and combining data from different tables, respectively, and do not directly instruct the use of an index.
upvoted 1 times
...
Law3
1 year ago
SELECT uses the index, correct answer SELECT is a statement WHERE not a statement, it's a clause to filter by column value SELECT * FROM table1 USE INDEX (col1_index,col2_index) WHERE col1=1 AND col2=2 AND col3=3;
upvoted 1 times
...
jaszi
1 year, 1 month ago
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 ChatGPT B. WHERE The T-SQL statement used to instruct a database management system to use an index instead of performing a full table scan is the WHERE clause in a query. By specifying appropriate conditions in the WHERE clause, you can guide the query optimizer to use available indexes to efficiently retrieve the desired data.
upvoted 2 times
...
Kats
1 year, 1 month ago
Selected Answer: A
Dropped the exact question in chatgpt, this was the answer... In T-SQL, you can use the SELECT statement with a query hint to instruct the database management system (DBMS) to use a specific index instead of performing a full table scan. The query hint that accomplishes this is called INDEX or INDEX=<index_name> hint.
upvoted 1 times
...
AZFabio
1 year, 2 months ago
Selected Answer: A
"Where" is not a statement, but a clause. Although the filter criteira is defined on "where", it is the "select" statement directs index usage.
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago