47.9k views
3 votes
Given the following SQL Query, which columns would you recommend to be indexed? SELECT InvoiceNumber, InvoiceDate, Invoice_Total, Invoice_Paid, Invoice_Total - Invoice_Paid as Balance FROM Invoice WHERE Invoice_Date >= "2015-07-20" and Salesman_Id = "JR" ORDER BY DESC Invoice_Total Drag the correct answers to one of the three pockets.

1 Answer

3 votes

Answer:

Invoice_Date and Salesman Id

Step-by-step explanation:

As the WHERE clause looking at the Invoice_Date and Salesman Id columns so they should be indexed for the following reasons.

  • Uniquely identifiable records are guaranteed by the unique indexes in the database.
  • Data can be quickly retrieved.
  • The usage of indexes results in much better performance.
  • It can help with quick presorted list of records.
User Ugavetheroses
by
3.4k points