Está en la página 1de 11

Antiguedad | Situacion | Edad |

+-------+---------+-----------+------------+--------+-------------------+------+

------------+------------+------+

| 1 | Martin | calle 3 | 9242493839 | 5500 | Cadista |h |

10 | activo | 37 |

| 2 | Javier | calle 18 | 2147483647 | 6300 | operador |h |

4 | activo | 45 |

| 3 | Antonio | calle 26 | 214747373 | 6300 | chofer |h |

6 | activo | 30 |

| 4 | Carlos | calle 01 | 2224747373 | 12500 | subgerente |h |

7 | activo | 32 |

| 5 | Maria | calle 27 | 254747373 | 3535 | limpieza |m |

3 | activo | 25 |

| 6 | Lizeth | calle 32 | 264747373 | 1500 | recepcion |m |

1 | activo | 36 |

| 7 | Joel | calle 28 | 268747373 | 10500 | ventas |h |

4 | activo | 41 |

| 8 | Reyna | calle 75 | 268747376 | 15500 | gerente |m |

8 | activo | 52 |

| 9 | Pablo | calle 25 | 268747376 | 9200 | jefe de proyectos | h |

7 | activo | 43 |

| 10 | Carmen | calle 17 | 268847376 | 8350 | auditor |m |

5 | pensionada | 55 |

| 11 | Juan | calle 31 | 268347376 | 7800 | diseador |m |

4 | activo | 38 |

| 12 | joel | calle 13 | 268337376 | 6500 | jefe de obras |h |

6 | pensionado | 51 |

+-------+---------+-----------+------------+--------+-------------------+------+

------------+------------+------+
12 rows in set (0.00 sec)

mysql> select clave, sueldo,puesto from empleado where sueldo between 2000 and 7

000;

ERROR 1146 (42S02): Table 'constructora.empleado' doesn't exist

mysql> select clave, sueldo,puesto from empleados where sueldo between 2000 and

7000;

+-------+--------+---------------+

| clave | sueldo | puesto |

+-------+--------+---------------+

| 1 | 5500 | Cadista |

| 2 | 6300 | operador |

| 3 | 6300 | chofer |

| 5 | 3535 | limpieza |

| 12 | 6500 | jefe de obras |

+-------+--------+---------------+

5 rows in set (0.00 sec)

mysql> select clave,nombre,sueldo,puesto from empleados orde by sueldo asc;

ERROR 1064 (42000): 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 'by su

eldo asc' at line 1

mysql> select clave,nombre,sueldo,puesto from empleados order by sueldo asc;

+-------+---------+--------+-------------------+

| clave | nombre | sueldo | puesto |

+-------+---------+--------+-------------------+

| 6 | Lizeth | 1500 | recepcion |

| 5 | Maria | 3535 | limpieza |

| 1 | Martin | 5500 | Cadista |


| 2 | Javier | 6300 | operador |

| 3 | Antonio | 6300 | chofer |

| 12 | joel | 6500 | jefe de obras |

| 11 | Juan | 7800 | diseador |

| 10 | Carmen | 8350 | auditor |

| 9 | Pablo | 9200 | jefe de proyectos |

| 7 | Joel | 10500 | ventas |

| 4 | Carlos | 12500 | subgerente |

| 8 | Reyna | 15500 | gerente |

+-------+---------+--------+-------------------+

12 rows in set (0.00 sec)

mysql> select clave,nombre,sueldo,puesto from empleados where edad between 20 and 40;

+-------+---------+--------+------------+

| clave | nombre | sueldo | puesto |

+-------+---------+--------+------------+

| 1 | Martin | 5500 | Cadista |

| 3 | Antonio | 6300 | chofer |

| 4 | Carlos | 12500 | subgerente |

| 5 | Maria | 3535 | limpieza |

| 6 | Lizeth | 1500 | recepcion |

| 11 | Juan | 7800 | diseador |

+-------+---------+--------+------------+

6 rows in set (0.00 sec)

mysql> Select * FROM empleado WHERE antigedad=4;

ERROR 1146 (42S02): Table 'constructora.empleado' doesn't exist

mysql> Select * FROM empleados WHERE antigedad=4;

ERROR 1054 (42S22): Unknown column 'antigedad' in 'where clause'


mysql> Select * FROM empleados WHERE antiguedad=4;

+-------+--------+-----------+------------+--------+------------+------+--------

----+-----------+------+

| clave | Nombre | Direccion | Telefono | Sueldo | Puesto | Sexo | Antigue

dad | Situacion | Edad |

+-------+--------+-----------+------------+--------+------------+------+--------

----+-----------+------+

| 2 | Javier | calle 18 | 2147483647 | 6300 | operador | h |

4 | activo | 45 |

| 7 | Joel | calle 28 | 268747373 | 10500 | ventas |h |

4 | activo | 41 |

| 11 | Juan | calle 31 | 268347376 | 7800 | diseador | m |

4 | activo | 38 |

+-------+--------+-----------+------------+--------+------------+------+--------

----+-----------+------+

3 rows in set (0.00 sec)

mysql> Select * FROM empleados sexo ='M';

ERROR 1064 (42000): 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 '='M''

at line 1

mysql> Select*FROM empleados sexo ="M";

ERROR 1064 (42000): 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 '="M"'

at line 1

mysql> Select*FROM empleados sexo ="h";

ERROR 1064 (42000): 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 '="h"'

at line 1
mysql> Select * FROM empleados sexo ='h';

ERROR 1064 (42000): 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 '='h''

at line 1

mysql> Select*FROM empleados sexo ='h';

ERROR 1064 (42000): 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 '='h''

at line 1

mysql> Select*FROM empleados sexo ="h";

ERROR 1064 (42000): 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 '="h"'

at line 1

mysql> Select*FROM empleados sexo="h";

ERROR 1064 (42000): 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 '="h"'

at line 1

mysql> Select*FROM empleados where sexo="h";

+-------+---------+-----------+------------+--------+-------------------+------+

------------+------------+------+

| clave | Nombre | Direccion | Telefono | Sueldo | Puesto | Sexo |

Antiguedad | Situacion | Edad |

+-------+---------+-----------+------------+--------+-------------------+------+

------------+------------+------+

| 1 | Martin | calle 3 | 9242493839 | 5500 | Cadista |h |

10 | activo | 37 |

| 2 | Javier | calle 18 | 2147483647 | 6300 | operador |h |

4 | activo | 45 |

| 3 | Antonio | calle 26 | 214747373 | 6300 | chofer |h |

6 | activo | 30 |
| 4 | Carlos | calle 01 | 2224747373 | 12500 | subgerente |h |

7 | activo | 32 |

| 7 | Joel | calle 28 | 268747373 | 10500 | ventas |h |

4 | activo | 41 |

| 9 | Pablo | calle 25 | 268747376 | 9200 | jefe de proyectos | h |

7 | activo | 43 |

| 12 | joel | calle 13 | 268337376 | 6500 | jefe de obras |h |

6 | pensionado | 51 |

+-------+---------+-----------+------------+--------+-------------------+------+

------------+------------+------+

7 rows in set (0.00 sec)

mysql> Select * FROM empleado WHERE situacin="Activo";

ERROR 2006 (HY000): MySQL server has gone away

No connection. Trying to reconnect...

Connection id: 13

Current database: constructora

ERROR 1146 (42S02): Table 'constructora.empleado' doesn't exist

mysql> Select * FROM empleados WHERE situacin="Activo";

ERROR 1054 (42S22): Unknown column 'situacin' in 'where clause'

mysql> Select*FROM empleados WHERE situacion="Activo";

ERROR 1054 (42S22): Unknown column '"Activo"' in 'where clause'

mysql> Select*FROM empleados WHERE situacion="activo";

ERROR 1054 (42S22): Unknown column '"activo"' in 'where clause'

mysql> Select*FROM empleados WHERE situacion="activo";

ERROR 1054 (42S22): Unknown column '"activo"' in 'where clause'

mysql> Select*FROM empleados WHERE Situacion="activo";

ERROR 1054 (42S22): Unknown column '"activo"' in 'where clause'


mysql> Select*FROM empleados WHERE Situacion="activo";

ERROR 1054 (42S22): Unknown column '"activo"' in 'where clause'

mysql>

mysql> Select*FROM empleados WHERE Situacion="activo";

+-------+---------+-----------+------------+--------+-------------------+------+

------------+-----------+------+

| clave | Nombre | Direccion | Telefono | Sueldo | Puesto | Sexo |

Antiguedad | Situacion | Edad |

+-------+---------+-----------+------------+--------+-------------------+------+

------------+-----------+------+

| 1 | Martin | calle 3 | 9242493839 | 5500 | Cadista |h |

10 | activo | 37 |

| 2 | Javier | calle 18 | 2147483647 | 6300 | operador |h |

4 | activo | 45 |

| 3 | Antonio | calle 26 | 214747373 | 6300 | chofer |h |

6 | activo | 30 |

| 4 | Carlos | calle 01 | 2224747373 | 12500 | subgerente |h |

7 | activo | 32 |

| 5 | Maria | calle 27 | 254747373 | 3535 | limpieza |m |

3 | activo | 25 |

| 6 | Lizeth | calle 32 | 264747373 | 1500 | recepcion |m |

1 | activo | 36 |

| 7 | Joel | calle 28 | 268747373 | 10500 | ventas |h |

4 | activo | 41 |

| 8 | Reyna | calle 75 | 268747376 | 15500 | gerente |m |

8 | activo | 52 |

| 9 | Pablo | calle 25 | 268747376 | 9200 | jefe de proyectos | h |

7 | activo | 43 |

| 11 | Juan | calle 31 | 268347376 | 7800 | diseador |m |


4 | activo | 38 |

+-------+---------+-----------+------------+--------+-------------------+------+

------------+-----------+------+

10 rows in set (0.00 sec)

mysql> Select*FROM empleados WHERE nombre like '%j%';

+-------+--------+-----------+------------+--------+---------------+------+-----

-------+------------+------+

| clave | Nombre | Direccion | Telefono | Sueldo | Puesto | Sexo | Anti

guedad | Situacion | Edad |

+-------+--------+-----------+------------+--------+---------------+------+-----

-------+------------+------+

| 2 | Javier | calle 18 | 2147483647 | 6300 | operador |h |

4 | activo | 45 |

| 7 | Joel | calle 28 | 268747373 | 10500 | ventas |h |

4 | activo | 41 |

| 11 | Juan | calle 31 | 268347376 | 7800 | diseador |m |

4 | activo | 38 |

| 12 | joel | calle 13 | 268337376 | 6500 | jefe de obras | h |

6 | pensionado | 51 |

+-------+--------+-----------+------------+--------+---------------+------+-----

-------+------------+------+

4 rows in set (0.01 sec)

mysql> Select*FROM empleados WHERE nombre edad>40;

ERROR 1064 (42000): 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 'edad>

40' at line 1

mysql> Select*FROM empleados WHERE edad>40;


+-------+--------+-----------+------------+--------+-------------------+------+-

-----------+------------+------+

| clave | Nombre | Direccion | Telefono | Sueldo | Puesto | Sexo |

Antiguedad | Situacion | Edad |

+-------+--------+-----------+------------+--------+-------------------+------+-

-----------+------------+------+

| 2 | Javier | calle 18 | 2147483647 | 6300 | operador |h |

4 | activo | 45 |

| 7 | Joel | calle 28 | 268747373 | 10500 | ventas |h |

4 | activo | 41 |

| 8 | Reyna | calle 75 | 268747376 | 15500 | gerente |m |

8 | activo | 52 |

| 9 | Pablo | calle 25 | 268747376 | 9200 | jefe de proyectos | h |

7 | activo | 43 |

| 10 | Carmen | calle 17 | 268847376 | 8350 | auditor |m |

5 | pensionada | 55 |

| 12 | joel | calle 13 | 268337376 | 6500 | jefe de obras |h |

6 | pensionado | 51 |

+-------+--------+-----------+------------+--------+-------------------+------+-

-----------+------------+------+

6 rows in set (0.05 sec)

mysql> Select*FROM empleados WHERE antiguedad<=5;

+-------+--------+-----------+------------+--------+------------+------+--------

----+------------+------+

| clave | Nombre | Direccion | Telefono | Sueldo | Puesto | Sexo | Antigue

dad | Situacion | Edad |

+-------+--------+-----------+------------+--------+------------+------+--------

----+------------+------+
| 2 | Javier | calle 18 | 2147483647 | 6300 | operador | h |

4 | activo | 45 |

| 5 | Maria | calle 27 | 254747373 | 3535 | limpieza | m |

3 | activo | 25 |

| 6 | Lizeth | calle 32 | 264747373 | 1500 | recepcion | m |

1 | activo | 36 |

| 7 | Joel | calle 28 | 268747373 | 10500 | ventas |h |

4 | activo | 41 |

| 10 | Carmen | calle 17 | 268847376 | 8350 | auditor | m |

5 | pensionada | 55 |

| 11 | Juan | calle 31 | 268347376 | 7800 | diseador | m |

4 | activo | 38 |

+-------+--------+-----------+------------+--------+------------+------+--------

----+------------+------+

6 rows in set (0.00 sec)

mysql> Select*FROM empleados WHERE sueldo >=8000;

+-------+--------+-----------+------------+--------+-------------------+------+-

-----------+------------+------+

| clave | Nombre | Direccion | Telefono | Sueldo | Puesto | Sexo |

Antiguedad | Situacion | Edad |

+-------+--------+-----------+------------+--------+-------------------+------+-

-----------+------------+------+

| 4 | Carlos | calle 01 | 2224747373 | 12500 | subgerente |h |

7 | activo | 32 |

| 7 | Joel | calle 28 | 268747373 | 10500 | ventas |h |

4 | activo | 41 |

| 8 | Reyna | calle 75 | 268747376 | 15500 | gerente |m |

8 | activo | 52 |
| 9 | Pablo | calle 25 | 268747376 | 9200 | jefe de proyectos | h |

7 | activo | 43 |

| 10 | Carmen | calle 17 | 268847376 | 8350 | auditor |m |

5 | pensionada | 55 |

+-------+--------+-----------+------------+--------+-------------------+------+-

-----------+------------+------+

5 rows in set (0.00 sec)

mysql>