Taller Opt 1er Cuat 2022 Turno 1
Deben ejecutarse las consultas sobre la Base de Datos AdventureWorks utilizando Azure Data Studio o SQL Server Management Studio. Deben compararse las diferentes consultas dentro de cada ejercicio y analizar los planes de ejecución explicando las diferencias y las elecciones del optimizador.
La aprobación requiere de 4 ejercicios correctos.
1)
select * from
Purchasing.ShipMethod
order by Name
select * from
Purchasing.ShipMethod
where Name is not null;
2)
select CardType from Sales.CreditCard group by CardType
select CardNumber from Sales.CreditCard group by CardNumber
3)
select * from
sales.SalesOrderDetail
where UnitPrice > all (select UnitPrice from
Sales.SalesOrderDetail where OrderQty >12)
select * from
sales.SalesOrderDetail
where UnitPrice > (select Max(UnitPrice) from
Sales.SalesOrderDetail where OrderQty >12)
4)
select AddressID, City, StateProvinceID, ModifiedDate
from Person.Address
where StateProvinceID = 32
select AddressID, City, StateProvinceID, ModifiedDate
from Person.Address
where StateProvinceID = 20
5)
select count(UnitPrice) from sales.SalesOrderDetail;
select sum(UnitPrice) from sales.SalesOrderDetail;
6)
select * from Person.Person where LastName Like 'Duffy%'
select * from Person.Person where LastName Like '%Duffy'