You are on page 1of 2

EJERCICIOS DE LA SEMANA 11

select * from Employees


select LastName,FirstName,TitleOfCourtesy
from Employees
where TitleOfCourtesy='Mrs.'

select * from Products


select ProductID, ProductName, UnitPrice
from Products
where UnitPrice >=10 and UnitPrice <= 50

select * from Products


select * from Categories

select ProductName, UnitPrice, CategoryName


from Products inner join Categories
on Products.CategoryID=Categories.CategoryID

----mostrar los ProductName, UnitPrice, CategoryName y que la categoria sea carnes


select ProductName, UnitPrice, CategoryName
from Products inner join Categories
on Products.CategoryID=Categories.CategoryID
where Categories.CategoryID=6

----mostrar los ProductName, UnitPrice, CategoryName y que la categoria sea lacteos


select ProductName, UnitPrice, CategoryName
from Products inner join Categories
on Products.CategoryID=Categories.CategoryID
where Categories.CategoryID=4

select CompanyName, Country, OrderID


from customers inner join Orders
on customers.CustomerID=Orders.CustomerID
where customers.CustomerID='ANTON'

--- Pedido con empleados (Nancy Davolio)


SELECT * FROM Employees
SELECT * FROM Orders

select FirstName, Country, Title, OrderID


from Employees inner join Orders
on Employees.EmployeeID=Orders.EmployeeID
where Employees.LastName='Davolio'

---Productos con Proveedores


SELECT * FROM Products
SELECT * FROM Suppliers

select ProductName, UnitPrice, CompanyName, ContactName


from Products inner join Suppliers
on Products.SupplierID=Suppliers.SupplierID
Where Suppliers.CompanyName='Exotic Liquids'

---Mostrar ProductID, ProductName, UniPrice y OrderDate de todos los productos cuyo


precio sea >30
SELECT * FROM Orders Details
SELECT * FROM Products

select Products.ProductName, Quantity, Products.UnitPrice


from [Order Details] inner join Products
on [Order Details].ProductID=Products.ProductID
Where Products.UnitPrice >=30

---Mostrar los pedidos que se han ido a MEXICO Y ALEMANIA


SELECT * FROM Orders
SELECT * FROM Customers

select Customers.CustomerID, OrderID, CompanyName, Country


from Customers inner join Orders
on customers.CustomerID='MEXICO' or customers.Country='GERMANY'

JESUS SANCHEZ ENCISO

You might also like