Está en la página 1de 1

CONSULTAS SQL SERVER

--1. Obtener los productos descontinuados que cueste ms de 40

select *from Products

where Discontinued=1 and UnitPrice>40

go

--2. Obtener los productos que nos traiga el proveedor 12

--que tengan un precio menor a 100 y Discontinuidad 0

select * from Products

where Discontinued=0 and UnitPrice<100 and SupplierID=12

go

--3. Obtener Los productos que tengan precio mayor a 20 y menor a 90

-- de la categoria 5 y 1

select * from Products

where (UnitPrice BETWEEN 20 AND 90) AND (CategoryID=5 OR CategoryID=1)

go

--4. Obtener las ordenes emitidas el mes de agosto de 1997

select * from Orders

where YEAR(OrderDate)=1997 and MONTH(OrderDate)=8

go

--5. Obtener las ordenes emitidas en Venezuela, Germany y Brazil

select *from Orders

where ShipCountry IN('Venezuela','Germany','Brazil')

go

También podría gustarte