Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In order to fetch the required data, please can you identify which of these queries are the most efficient considering the performance enhancements. Explain why.

Query 1

Query 2


Paste code macro
languagesql
Select
First_Name
,Last_Name
,Order_Date
,Order_ID

From dbo.Orders

Where Upper(Last_Name) = 'SMITH'
And Order_Date = '2018-12-30'



Paste code macro
languagesql
Select
a.First_Name
,a.Last_Name
,a.Order_Date
,a.Order_ID

From (
Select
	First_Name
	,Last_Name
	,Upper(Last_Name) As uc_Last_Name
	,Order_Date
	,Order_ID

	From dbo.Orders
	Where Order_Date = '2018-12-30'
)a
Where a.uc_Last_Name = 'SMITH'



Tip
iconfalse

Question 5a:

Please can you put these query operations into the correct execution order

...