Documentos de Académico
Documentos de Profesional
Documentos de Cultura
INFORMACIÓN
Módulo
Desarrollo de Bases de datos
Taller Subconsultas 2
Presentado a:
Sandra Rueda
Instructor
Presentado por:
Yessica Yubely Rodríguez Villarraga
Orden:
40130
Cuerpo de desarrollo
use Northwind
select distinct od.ProductID
from [Order Details] od
where od.ProductID in (select od.ProductID from [Order Details] ods
where od.UnitPrice <> ods.UnitPrice) group by od.ProductID having
COUNT(od.ProductID) > 20
order by od.ProductID
use Northwind
select distinct od.ProductID, ProductName
from [Order Details] od inner join Products p on od.ProductID = p.ProductID
where od.ProductID in (select od.ProductID from [Order Details] ods
where od.UnitPrice <> ods.UnitPrice) group by od.ProductID,ProductName having
COUNT(od.ProductID) > 20
order by od.ProductID
USE Terminal
SELECT F.fl_codiflot, F.fl_nombflot
FROM ( SELECT fl_codiflot, fl_nombflot
FROM Flotas ) AS F
USE Terminal
SELECT DISTINCT FL.fl_nombflot
FROM Flotas AS FL
WHERE FL.fl_codiflot IN
(SELECT BI.bu_codiflot
FROM Buses AS BI
WHERE FL.fl_codiflot <> BI.bu_codiflot)