Documentos de Académico
Documentos de Profesional
Documentos de Cultura
-select top 50 percent productname, unitprice from products order by unitprice desc
___________________________________________________________________________________
____________________________________________________________--
3.MOSTRAR AQUELLAS PERSONAS CUYA PRIMERA LETRA ESTA INCLUIDA EN SU APELLIDO (DE DOS
MANERAS DIFERENTES)
select firstname, lastname where lastname like '%'+left(firstname,1)+'%' from
employees
4.MOSTRAR AQUELLOS PRODUCTOS CUYO PRECIO SEA ENTERO (DE DOS MANERAS DIFERENTES)
select productname, untitprice from products where unitprice = floor(unitprice)
5.MOSTRAR LA PARTE ENTERA DEL PROMEDIO DEL PRECIO UNITARIO POR CATEGORIA DE
CATEGORIAS IMPARES
6. MOStRAR EL PROMEDIO DEL PRECIO UNITARIO POR CATEGORIA REDODDEADO A UNA CIFRA
DECIMAL DE CATEGORIAS IMPARES
select round (avg(unitprice),1), categoryID from products group by categoryID
having categoryID % 2=1
7. MOSTRAR LA PARTE ENTERA DEL PROMEDIO DEL PRECIO UNITARIO POR CATEGORIA DE
CATEGORIAS PARES
select floor(avg(unitprice)), categoryID from products group by categoryID having
categoryID % 2=0
sisben
cc ampliada 150
constancia
recibo
firma profesor
firma contrato
-----------------------------------------------------------------------------------
---------------------------------------------
FECHAS
DATEADD DATEDIFF DAY GETDATE MONT YEAR
AGREGAR UN DIA
select birthdate, dateadd(day,1,birthdate) Aumento_Fecha from employees
DIFERENCIA EN FECHAS
getdate
fecha actual
___________________________________________________________________________________
_____________________________________________________
CPNVERTIR A ENTERO
select cast(unitprice as integer) from products
select cast(int, unitprice) from products
-----------------------------------------------------------------------------------
--------------------------
SUBCONSULTAS
select productname, unitprice from products where unitprice>=(slect unitprice from
products where productid=25)
MOSTRAR LOS PRODUCTOS CUYO VALOR ESTA ENTRE EL VALOR DE UN PRODUCTO Y OTRO
*select unitprice from products where unitprice between (select unitprice from
products where productid=3) and (select unitprice from products where productid=8)
MOSTAR TODAS LAS PERSONAS QUE VIVAN EN LA MISMA CIUDAD QUE UNA PERSONA DADA
select employeeID, firstname, lastname, city from employees where city = (select
city employees where employeeID=2)
MOSTRAR TODOS LOS PRODUCTOS QURE COMIENEN CON LA ULTIMA LETRA QUE TERMINAN EL
APELLIDO DE UNA PERSONA DADA