mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | comandos | | mysql | | registros | | tarea | +--------------------+ 5 rows in set (0.30 sec) mysql> use tarea; Database changed mysql> show tables; +-----------------+ | Tables_in_tarea | +-----------------+ | clientes | | cuentas | | prestamos | +-----------------+ 3 rows in set (0.05 sec) mysql> select * from clientes; +-----------+------------------+-------------+ | idcliente | nombre | descripcion | +-----------+------------------+-------------+ | 1 | kobacolombia | NULL | | 2 | mac pollo | NULL | | 3 | colombina | NULL | | 4 | studiof | NULL | | 5 | mattelsa | NULL | | 6 | servientrega | NULL | | 7 | giros y finanzas | NULL | | 8 | leonisa | NULL | | 9 | stop jeans | NULL | | 10 | cauchosol | NULL | +-----------+------------------+-------------+ 10 rows in set (0.14 sec) mysql> select * from cuentas; +----------+---------+-----------+ | idcuenta | saldo | idcliente | +----------+---------+-----------+ | 1 | 345000 | NULL | | 2 | 890000 | NULL | | 3 | 100000 | NULL | | 4 | 235000 | NULL | | 5 | 50000 | NULL | | 6 | 23205 | NULL | | 7 | 46410 | NULL | | 8 | 80000 | NULL | | 9 | 1000000 | NULL | | 10 | 20000 | NULL | +----------+---------+-----------+ 10 rows in set (0.05 sec) mysql> selec * from prestamos; 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 'selec * from prestamos' at line 1 mysql> select * from prestamos; +------------+-------------+-------+--------------+-----------+ | idprestamo | descripcion | plazo | fecha_inicio | idcliente | +------------+-------------+-------+--------------+-----------+ | 1 | PIROSENSOR | 2 | 0000-00-00 | NULL | | 2 | MAGNETICO | 1 | 0000-00-00 | NULL | | 3 | HUMO | 3 | 0000-00-00 | NULL | | 4 | PANICOS | 2 | 0000-00-00 | NULL | | 5 | COMPUTADOR | 1 | 0000-00-00 | NULL | | 6 | HERRAMIENTA | 1 | 0000-00-00 | NULL | | 7 | HUMO | 2 | 0000-00-00 | NULL | | 8 | MAGNETICO | 3 | 0000-00-00 | NULL | | 9 | PANICOS | 4 | 0000-00-00 | NULL | | 10 | HUMO | 6 | 0000-00-00 | NULL | +------------+-------------+-------+--------------+-----------+ 10 rows in set (0.00 sec) mysql> select * from prestamos where descripcion = 'humo'; +------------+-------------+-------+--------------+-----------+ | idprestamo | descripcion | plazo | fecha_inicio | idcliente | +------------+-------------+-------+--------------+-----------+ | 3 | HUMO | 3 | 0000-00-00 | NULL | | 7 | HUMO | 2 | 0000-00-00 | NULL | | 10 | HUMO | 6 | 0000-00-00 | NULL | +------------+-------------+-------+--------------+-----------+ 3 rows in set (0.03 sec) mysql> select * from clientes; +-----------+------------------+-------------+ | idcliente | nombre | descripcion | +-----------+------------------+-------------+ | 1 | kobacolombia | NULL | | 2 | mac pollo | NULL | | 3 | colombina | NULL | | 4 | studiof | NULL | | 5 | mattelsa | NULL | | 6 | servientrega | NULL | | 7 | giros y finanzas | NULL | | 8 | leonisa | NULL | | 9 | stop jeans | NULL | | 10 | cauchosol | NULL | +-----------+------------------+-------------+ 10 rows in set (0.00 sec) mysql> select * from clientes where nombre like 's%'; +-----------+--------------+-------------+ | idcliente | nombre | descripcion | +-----------+--------------+-------------+ | 4 | studiof | NULL | | 6 | servientrega | NULL | | 9 | stop jeans | NULL | +-----------+--------------+-------------+ 3 rows in set (0.06 sec) mysql> select * from clientes where nombre like '%s'; +-----------+------------------+-------------+ | idcliente | nombre | descripcion | +-----------+------------------+-------------+ | 7 | giros y finanzas | NULL | | 9 | stop jeans | NULL | +-----------+------------------+-------------+ 2 rows in set (0.05 sec) mysql> select * from clientes where nombre like '%a'; +-----------+--------------+-------------+ | idcliente | nombre | descripcion | +-----------+--------------+-------------+ | 1 | kobacolombia | NULL | | 3 | colombina | NULL | | 5 | mattelsa | NULL | | 6 | servientrega | NULL | | 8 | leonisa | NULL | +-----------+--------------+-------------+ 5 rows in set (0.00 sec) mysql> select * from clientes where nombre like '%a%'; +-----------+------------------+-------------+ | idcliente | nombre | descripcion | +-----------+------------------+-------------+ | 1 | kobacolombia | NULL | | 2 | mac pollo | NULL | | 3 | colombina | NULL | | 5 | mattelsa | NULL | | 6 | servientrega | NULL | | 7 | giros y finanzas | NULL | | 8 | leonisa | NULL | | 9 | stop jeans | NULL | | 10 | cauchosol | NULL | +-----------+------------------+-------------+ 9 rows in set (0.00 sec) mysql> select * from clientes where cuenta like '%000%'; ERROR 1054 (42S22): Unknown column 'cuenta' in 'where clause' mysql> select * from clientes where cuenta like '%ma%'; ERROR 1054 (42S22): Unknown column 'cuenta' in 'where clause' mysql> select * from clientes where clientes like '%ma%'; ERROR 1054 (42S22): Unknown column 'clientes' in 'where clause' mysql> select * from clientes where nombre like '%ma%'; +-----------+-----------+-------------+ | idcliente | nombre | descripcion | +-----------+-----------+-------------+ | 2 | mac pollo | NULL | | 5 | mattelsa | NULL | +-----------+-----------+-------------+ 2 rows in set (0.00 sec) mysql> select * from cuenta where saldo like '%000%'; ERROR 1146 (42S02): Table 'tarea.cuenta' doesn't exist mysql> select * from clientes where nombre like '%ma%' and saldo>23205; ERROR 1054 (42S22): Unknown column 'saldo' in 'where clause' mysql> select * from prestamos where descripcion like 'h%' and plazo>1; +------------+-------------+-------+--------------+-----------+ | idprestamo | descripcion | plazo | fecha_inicio | idcliente | +------------+-------------+-------+--------------+-----------+ | 3 | HUMO | 3 | 0000-00-00 | NULL | | 7 | HUMO | 2 | 0000-00-00 | NULL | | 10 | HUMO | 6 | 0000-00-00 | NULL | +------------+-------------+-------+--------------+-----------+ 3 rows in set (0.05 sec) mysql> select * from prestamos; +------------+-------------+-------+--------------+-----------+ | idprestamo | descripcion | plazo | fecha_inicio | idcliente | +------------+-------------+-------+--------------+-----------+ | 1 | PIROSENSOR | 2 | 0000-00-00 | NULL | | 2 | MAGNETICO | 1 | 0000-00-00 | NULL | | 3 | HUMO | 3 | 0000-00-00 | NULL | | 4 | PANICOS | 2 | 0000-00-00 | NULL | | 5 | COMPUTADOR | 1 | 0000-00-00 | NULL | | 6 | HERRAMIENTA | 1 | 0000-00-00 | NULL | | 7 | HUMO | 2 | 0000-00-00 | NULL | | 8 | MAGNETICO | 3 | 0000-00-00 | NULL | | 9 | PANICOS | 4 | 0000-00-00 | NULL | | 10 | HUMO | 6 | 0000-00-00 | NULL | +------------+-------------+-------+--------------+-----------+ 10 rows in set (0.00 sec) mysql> describe prestamos; +--------------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +--------------+-------------+------+-----+---------+-------+ | idprestamo | int(11) | NO | PRI | NULL | | | descripcion | varchar(45) | YES | | NULL | | | plazo | int(11) | YES | | NULL | | | fecha_inicio | date | YES | | NULL | | | idcliente | int(11) | YES | MUL | NULL | | +--------------+-------------+------+-----+---------+-------+ 5 rows in set (0.19 sec) mysql> describe cuentas; +-----------+---------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-----------+---------+------+-----+---------+-------+ | idcuenta | int(11) | NO | PRI | NULL | | | saldo | float | YES | | NULL | | | idcliente | int(11) | YES | MUL | NULL | | +-----------+---------+------+-----+---------+-------+ 3 rows in set (0.03 sec) mysql> select * from cunetas; ERROR 1146 (42S02): Table 'tarea.cunetas' doesn't exist mysql> select * from cuentas; +----------+---------+-----------+ | idcuenta | saldo | idcliente | +----------+---------+-----------+ | 1 | 345000 | NULL | | 2 | 890000 | NULL | | 3 | 100000 | NULL | | 4 | 235000 | NULL | | 5 | 50000 | NULL | | 6 | 23205 | NULL | | 7 | 46410 | NULL | | 8 | 80000 | NULL | | 9 | 1000000 | NULL | | 10 | 20000 | NULL | +----------+---------+-----------+ 10 rows in set (0.00 sec) mysql> select sum (saldo) 'la sumatoria de saldo es' from cuentas; ERROR 1630 (42000): FUNCTION tarea.sum does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual mysql> select sum (saldo) from cuentas; ERROR 1630 (42000): FUNCTION tarea.sum does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual mysql> select SUM (saldo) from cuentas; ERROR 1630 (42000): FUNCTION tarea.SUM does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual mysql> select sum(saldo) from cuentas; +------------+ | sum(saldo) | +------------+ | 2789615 | +------------+ 1 row in set (0.11 sec) mysql> use tarea; Database changed mysql> select max(saldo) from cuentas; +------------+ | max(saldo) | +------------+ | 1000000 | +------------+ 1 row in set (0.08 sec) mysql> select cout(*) from cuentas; 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 '*) from cuentas' at line 1 mysql> select cout(saldo) from cuentas; ERROR 1305 (42000): FUNCTION tarea.cout does not exist mysql> select min(saldo) from cuentas; +------------+ | min(saldo) | +------------+ | 20000 | +------------+ 1 row in set (0.00 sec) mysql> select cout(saldo) from cuentas; ERROR 1305 (42000): FUNCTION tarea.cout does not exist mysql> select count(saldo) from cuentas; +--------------+ | count(saldo) | +--------------+ | 10 | +--------------+ 1 row in set (0.08 sec) mysql> select * from clientes order by nombres desc; ERROR 1054 (42S22): Unknown column 'nombres' in 'order clause' mysql> select * from clientes; +-----------+------------------+-------------+ | idcliente | nombre | descripcion | +-----------+------------------+-------------+ | 1 | kobacolombia | NULL | | 2 | mac pollo | NULL | | 3 | colombina | NULL | | 4 | studiof | NULL | | 5 | mattelsa | NULL | | 6 | servientrega | NULL | | 7 | giros y finanzas | NULL | | 8 | leonisa | NULL | | 9 | stop jeans | NULL | | 10 | cauchosol | NULL | +-----------+------------------+-------------+ 10 rows in set (0.01 sec) mysql> select * from clientes order by nombre desc; +-----------+------------------+-------------+ | idcliente | nombre | descripcion | +-----------+------------------+-------------+ | 4 | studiof | NULL | | 9 | stop jeans | NULL | | 6 | servientrega | NULL | | 5 | mattelsa | NULL | | 2 | mac pollo | NULL | | 8 | leonisa | NULL | | 1 | kobacolombia | NULL | | 7 | giros y finanzas | NULL | | 3 | colombina | NULL | | 10 | cauchosol | NULL | +-----------+------------------+-------------+ 10 rows in set (0.06 sec) mysql> select * from clientes order by nombre; +-----------+------------------+-------------+ | idcliente | nombre | descripcion | +-----------+------------------+-------------+ | 10 | cauchosol | NULL | | 3 | colombina | NULL | | 7 | giros y finanzas | NULL | | 1 | kobacolombia | NULL | | 8 | leonisa | NULL | | 2 | mac pollo | NULL | | 5 | mattelsa | NULL | | 6 | servientrega | NULL | | 9 | stop jeans | NULL | | 4 | studiof | NULL | +-----------+------------------+-------------+ 10 rows in set (0.00 sec) mysql> select * from prestamos order by descripcion; +------------+-------------+-------+--------------+-----------+ | idprestamo | descripcion | plazo | fecha_inicio | idcliente | +------------+-------------+-------+--------------+-----------+ | 5 | COMPUTADOR | 1 | 0000-00-00 | NULL | | 6 | HERRAMIENTA | 1 | 0000-00-00 | NULL | | 7 | HUMO | 2 | 0000-00-00 | NULL | | 10 | HUMO | 6 | 0000-00-00 | NULL | | 3 | HUMO | 3 | 0000-00-00 | NULL | | 2 | MAGNETICO | 1 | 0000-00-00 | NULL | | 8 | MAGNETICO | 3 | 0000-00-00 | NULL | | 4 | PANICOS | 2 | 0000-00-00 | NULL | | 9 | PANICOS | 4 | 0000-00-00 | NULL | | 1 | PIROSENSOR | 2 | 0000-00-00 | NULL | +------------+-------------+-------+--------------+-----------+ 10 rows in set (0.03 sec) mysql> select * from prestamos order by descripcion desc; +------------+-------------+-------+--------------+-----------+ | idprestamo | descripcion | plazo | fecha_inicio | idcliente | +------------+-------------+-------+--------------+-----------+ | 1 | PIROSENSOR | 2 | 0000-00-00 | NULL | | 9 | PANICOS | 4 | 0000-00-00 | NULL | | 4 | PANICOS | 2 | 0000-00-00 | NULL | | 2 | MAGNETICO | 1 | 0000-00-00 | NULL | | 8 | MAGNETICO | 3 | 0000-00-00 | NULL | | 7 | HUMO | 2 | 0000-00-00 | NULL | | 10 | HUMO | 6 | 0000-00-00 | NULL | | 3 | HUMO | 3 | 0000-00-00 | NULL | | 6 | HERRAMIENTA | 1 | 0000-00-00 | NULL | | 5 | COMPUTADOR | 1 | 0000-00-00 | NULL | +------------+-------------+-------+--------------+-----------+ 10 rows in set (0.00 sec) mysql> delete from prestamos where like '%humo%'; 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 'like '%humo%'' at line 1 mysql> delete from prestamos where like '%fecha_inicio%'; 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 'like '%fecha_inicio%'' at line 1 mysql> delete from prestamos where like '%HUMO%'; 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 'like '%HUMO%'' at line 1 mysql> delete from prestamos where like = '%HUMO%'; 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 'like = '%HUMO%'' at line 1 mysql> delete from prestamos where like '%7%'; 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 'like '%7%'' at line 1 mysql> delete from prestamos where like '%PANICO%'; 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 'like '%PANICO%'' at line 1 mysql> select * from cuentas; +----------+---------+-----------+ | idcuenta | saldo | idcliente | +----------+---------+-----------+ | 1 | 345000 | NULL | | 2 | 890000 | NULL | | 3 | 100000 | NULL | | 4 | 235000 | NULL | | 5 | 50000 | NULL | | 6 | 23205 | NULL | | 7 | 46410 | NULL | | 8 | 80000 | NULL | | 9 | 1000000 | NULL | | 10 | 20000 | NULL | +----------+---------+-----------+ 10 rows in set (0.00 sec) mysql> update cuestas set saldo=1000000 where idcuenta = '6'; ERROR 1146 (42S02): Table 'tarea.cuestas' doesn't exist mysql> update cuentas set saldo=1000000 where idcuenta = '6'; Query OK, 1 row affected (0.34 sec) Rows matched: 1 Changed: 1 Warnings: 0 mysql> select * from cuentas; +----------+---------+-----------+ | idcuenta | saldo | idcliente | +----------+---------+-----------+ | 1 | 345000 | NULL | | 2 | 890000 | NULL | | 3 | 100000 | NULL | | 4 | 235000 | NULL | | 5 | 50000 | NULL | | 6 | 1000000 | NULL | | 7 | 46410 | NULL | | 8 | 80000 | NULL | | 9 | 1000000 | NULL | | 10 | 20000 | NULL | +----------+---------+-----------+ 10 rows in set (0.00 sec) mysql> exit;