You are on page 1of 10

AND

SELECT * FROM `compras` WHERE IDCOMPRA ='3' AND IDPROVEEDOR = '4'

SELECT * FROM `entregas` WHERE `IDENTREGA` = 10 AND `IDEQUIPO` = 26060

SELECT * FROM `multas` WHERE `TIPOMULTA` LIKE 'B' AND `IDALQUILER` = 3

SELECT * FROM `compras` WHERE `IDPROVEEDOR` = 4 AND `VALOR` = 400400

SELECT * FROM `municipios` WHERE `CODIGODANE` = 5001 AND `DEPARTAMENTO` = 'ANTIOQUIA'

OR
SELECT * FROM `mantenimientos` WHERE IDEQUIPO ='29728' OR IDMANTENIMIENTO ='12'

SELECT * FROM `asesores` WHERE TELEFONO='3703671' OR IDASESOR='3375'

SELECT * FROM `devoluciones` WHERE IDCLIENTE='9234' OR IDDEVOLUCION='35'

SELECT * FROM `tiposdeequipos` WHERE TIPOEQUIPO='C' OR DESCRIPCION='METALICO'

SELECT * FROM `salidas` WHERE IDSALIDA='1' OR IDEQUIPO='26060'


IN
SELECT * FROM `devoluciones` WHERE `IDEQUIPO` IN (25865) AND `IDALQUILER` IN (2)

SELECT * FROM `equipos` WHERE `TIPOEQUIPO` IN ('B')

SELECT * FROM `entregas` WHERE `IDEQUIPO` IN (25865) AND `IDALQUILER` IN (2)

SELECT * FROM `municipios` WHERE `MUNICIPIO` IN ('Medellin')

SELECT * FROM `mantenimientos` WHERE `OBSERVACIONES` IN ('SE REALIZA MANTENIMIENTO POR


FALLAS GENERALES')

BETWEEN
SELECT * FROM `equipos` WHERE `VALORDIA` BETWEEN 4000 AND 5000

SELECT * FROM `multas` WHERE `IDCLIENTE` BETWEEN 9215 AND 9230


SELECT * FROM `compras` WHERE `IDCOMPRA` BETWEEN 3 AND 12

SELECT * FROM `entregas` WHERE `IDENTREGA` BETWEEN 10 AND 12

SELECT * FROM `tiposdeequipos` WHERE `TIPOEQUIPO` BETWEEN 'A' AND 'B'

LIKE
SELECT * FROM `salidas` WHERE `IDSALIDA` LIKE '1'

SELECT * FROM `detallesdealquiler` WHERE `IDALQUILER` LIKE '2'

SELECT * FROM `compras` WHERE `OBSERVACION` LIKE 'NINGUNA'

SELECT * FROM `compras` WHERE `CANTIDAD` LIKE '3'

SELECT * FROM `asesores` WHERE `IDASESOR` LIKE '3375'

SUM
SELECT SUM(VALOR) FROM `compras`

SELECT SUM(`CANTIDAD`) FROM `compras`


SELECT SUM(`VALORHORA`) FROM `equipos`

SELECT SUM(`VALORDIA`) FROM `equipos`

SELECT SUM(`VALORSEM`) FROM `equipos`

AVG
SELECT AVG(VALOR) FROM `compras`

SELECT AVG(`CANTIDAD`) FROM `compras`

SELECT AVG(`VALORHORA`) FROM `equipos`

SELECT AVG(`VALORDIA`) FROM `equipos`

SELECT AVG(`VALORSEM`) FROM `equipos`

COUNT
SELECT COUNT(VALOR) FROM `compras`

SELECT COUNT(`CANTIDAD`) FROM `compras`

SELECT COUNT(`VALORHORA`) FROM `equipos`


SELECT COUNT(`VALORDIA`) FROM `equipos`

SELECT COUNT(`VALORSEM`) FROM `equipos`

ORDER BY
SELECT `TELEFONO` FROM `clientes` ORDER BY `TELEFONO` ASC

SELECT `TELEFONO` FROM `clientes` ORDER BY `TELEFONO` DESC

SELECT `IDALQUILER` FROM `entregas` ORDER BY `IDALQUILER` ASC

SELECT `IDALQUILER` FROM `entregas` ORDER BY `IDALQUILER` DESC


SELECT `CODIGODANE` FROM `PROVEEDORES` ORDER BY `CODIGODANE` DESC

GROUP BY
select OBSERVACION, (CANTIDAD) from compras group by OBSERVACION

select IDCOMPRA, (IDPROVEEDOR) from compras group by IDCOMPRA

select FECHACOMPRA, (VALOR) from compras group by FECHACOMPRA


select FECHA, (VALOR) from contratosdealquiler group by FECHA

select IDALQUILER, (IDCLIENTE) from contratosdealquiler group by IDALQUILER

DATE
SELECT * FROM `entregas` ORDER BY FECHAENTREGA ASC
SELECT * FROM `entregas` ORDER BY FECHAENTREGA DESC

SELECT * FROM `contratosdealquiler` ORDER BY FECHA DESC

SELECT * FROM `contratosdealquiler` ORDER BY FECHA ASC


MAX
SELECT MAX(VALOR) FROM `compras`

SELECT MAX(`CANTIDAD`) FROM `compras`

SELECT MAX(`VALORHORA`) FROM `equipos`

SELECT MAX(`VALORDIA`) FROM `equipos`

SELECT MAX(`VALORSEM`) FROM `equipos`

MIN
SELECT MIN(VALOR) FROM `compras`

SELECT MIN(`CANTIDAD`) FROM `compras`

SELECT MIN(`VALORHORA`) FROM `equipos`


SELECT MIN(`VALORDIA`) FROM `equipos`

SELECT MIN(`VALORSEM`) FROM `equipos`

Related Interests