Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 6

Ejecute las siguientes sintaxis y describa cual fue el resultado.

Use educa;
Select *
From curso
Where cred=3 ANd cdept = PHIL;

Select *
From curso
Where (ctarifa > = 100) AND ( ctarifa <= 500);
No pueden ir los operadores con espacio. xD

Use empresa;
Select nombre, cuota, ventas
Fom repventas
Where ventas < cuota and ventas < 300000;
(manera correcta)
Select nombre, cuota, ventas From repventas Where ventas<cuota and
ventas<300000

Select nombre, cuota, ventas


Fom repventas
Where (ventas < cuota) OR (ventas < 300000);
Select nombre, cuota, ventas From repventas Where (ventas < cuota) OR
(ventas < 300000)

Use educa;
Select esueldo from personal
UNION
Select fsueldo from claustro;

Use empresa;
Select idfab, idproducto from productos where precio > 2000
UNION
Select distinct fab, producto from pedidos where importe > 3000;

Select idfab, idproducto from productos where precio > 2000


UNION
Select distinct fab, producto from pedidos where importe > 3000
LIMIT 0, 25

MySQL ha dicho:
#1146 - Table 'educa.productos' doesn't exist

Select sueldo from personal


UNION ALL
Select fsueldo from claustro;

Error
consulta SQL:
Select sueldo from personal
UNION ALL
Select fsueldo from claustro
LIMIT 0, 25

MySQL ha dicho:
#1146 - Table 'empresa.personal' doesn't exist

Use educa;
Select cdept, cnombre from curso
Order by cdept, cnombre;

Select cnombre, ctarifa, ctarifa/cred AS TARIFA_POR_CREDITO


(ctarifa + 25)/cred AS TARIFA_MEDIA_POR_HORA
From curso where cdept = CIS;
Select * from curso
Where not cdept= CIS OR (ctarifa=0 AND cred=3);
MySQL ha dicho:
#1064 - You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use

near '(ctarifa + 25)/cred AS TARIFA_MEDIA_POR_HORA


From curso where cdept = "CIS"' at line 2

Select ctarifa, SUM(cred) AS CREDITOS_TOTALES From curso


Group By ctarifa
Order By ctarifa DESC;

Select cdept, AVG(ctarifa)


From curso
Group by cdept
HAVING AVG(ctarifa)> 100
AND Count (*) < 6;
MySQL ha dicho:
#1064 - You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use
near '*) < 6
LIMIT 0, 25' at line 5

You might also like