Está en la página 1de 5

ACTIVIDAD 14.

Consultas usando subconsultas en la BD de Northwind


1. Generar un reporte que muestre el listado (por clave) de los productos que ha comprado el
cliente Maria Anders
Información a mostrar:
Clave del producto
select ProductID from [Order Details]
where OrderID in (select OrderID from Orders where CustomerID= (select CustomerID
from Customers
where ContactName= 'Maria Anders'))

2. Generar un reporte que muestre el listado (por nombre) de los productos que ha comprado
Maria Anders
Información a mostrar:
idProducto
Nombre del producto
Select ProductID, ProductName from Products where ProductID in (select ProductID
from [Order Details]
where OrderID in (select OrderID From Orders where CustomerID in (select CustomerID
from Customers where
ContactName = 'Maria Anders')))
3. Mostar información sobre órdenes que han pedido productos de la categoría Beverages

Información a mostrar:

idOrden
FechaOrden

Select OrderID, OrderDate from Orders where OrderID IN (Select OrderID from [Order
Details]
where ProductID in (select ProductID from Products where CategoryID in (Select
CategoryID from
Categories where CategoryName =' Beverages')))
4. Mostrar información sobre a qué clientes a atendido Davolio

Información a mostrar:

IdCliente
NombreCliente

select CustomerID, CompanyName from Customers where CustomerID in


(Select CustomerID from Orders where EmployeeID in (select EmployeeID
from Employees where LastName= 'Davolio'))

También podría gustarte