Você está na página 1de 105

Enter password: ***

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 6

Server version: 5.0.51b-community-nt-log MySQL Community Edition (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show databases;

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

| Database |

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

| information_schema |

| administracion |

| escuela |

| informacion |

| mysql |

| phpmyadmin |

| test |

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

7 rows in set (0.00 sec)

mysql> create database administracion;

ERROR 1007 (HY000): Can't create database 'administracion'; database exists

mysql> describe administracion;

ERROR 1046 (3D000): No database selected

mysql> use administracion;

Database changed

mysql> create table libros;

ERROR 1113 (42000): A table must have at least 1 column

mysql> create table libros(

-> titulo varchar(20),

-> autor varchar(30),

-> editorial varchar(15),

-> precio float,


-> cantidad integer

-> );

Query OK, 0 rows affected (0.03 sec)

mysql> describe libros;

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

| Field | Type | Null | Key | Default | Extra |

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

| titulo | varchar(20) | YES | | NULL | |

| autor | varchar(30) | YES | | NULL | |

| editorial | varchar(15) | YES | | NULL | |

| precio | float | YES | | NULL | |

| cantidad | int(11) | YES | | NULL | |

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

5 rows in set (0.00 sec)

mysql> insert into libros (titulo,autor,editorial,precio,cantidad) values ("El a

leph","Borges","Emece",45.50,100);

Query OK, 1 row affected (0.00 sec)

mysql> insert into libros (titulo, autor,editorial,precio,cantidad) values ("Ali

cia en el pais de las maravillas","Lewis Carrol","Planeta",25,200);

Query OK, 1 row affected, 1 warning (0.00 sec)

mysql> insert into libros (titulo,autor,editorial,precio,cantidad) values ("Mate

maticas estas ahi", "Paenza", "Planeta",12.8,200);

Query OK, 1 row affected, 1 warning (0.00 sec)

mysql> select*from libros;

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

| titulo | autor | editorial | precio | cantidad |

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

| El aleph | Borges | Emece | 45.5 | 100 |

| Alicia en el pais de | Lewis Carrol | Planeta | 25 | 200 |


| Matematicas estas ah | Paenza | Planeta | 12.8 | 200 |

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

3 rows in set (0.00 sec)

mysql> select titulo,autor,editorial from libros;

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

| titulo | autor | editorial |

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

| El aleph | Borges | Emece |

| Alicia en el pais de | Lewis Carrol | Planeta |

| Matematicas estas ah | Paenza | Planeta |

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

3 rows in set (0.00 sec)

mysql> select titulo,precio from libros;

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

| titulo | precio |

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

| El aleph | 45.5 |

| Alicia en el pais de | 25 |

| Matematicas estas ah | 12.8 |

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

3 rows in set (0.00 sec)

mysql> select editorial,cantidad from libros;

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

| editorial | cantidad |

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

| Emece | 100 |

| Planeta | 200 |

| Planeta | 200 |

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

3 rows in set (0.00 sec)


mysql> drop table if exists libros;

Query OK, 0 rows affected (0.02 sec)

mysql> create table libros(

-> titulo varchar(20),

-> autor varchar(30),

-> editorial varchar(15),

-> precio float,

-> cantidad integer

-> );

Query OK, 0 rows affected (0.03 sec)

mysql> insert into libros (titulo,autor,editorial,precio,cantidad) values ("El a

leph","Borges","Emece",45.50,100);

Query OK, 1 row affected (0.00 sec)

mysql> insert into libros (titulo,autor,editorial,precio,cantidad) values ("Alic

ie en el pais de las maravillas","Lewis Carroll","Planeta",25,200);

Query OK, 1 row affected, 1 warning (0.00 sec)

mysql> insert into libros (titulo,autor,editorial,precio,cantidad) values ("Mate

maticas estas ahi","Paenza","Planeta",15.8,200);

Query OK, 1 row affected, 1 warning (0.00 sec)

mysql> select*from libros;

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

| titulo | autor | editorial | precio | cantidad |

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

| El aleph | Borges | Emece | 45.5 | 100 |

| Alicie en el pais de | Lewis Carroll | Planeta | 25 | 200 |

| Matematicas estas ah | Paenza | Planeta | 15.8 | 200 |

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

3 rows in set (0.00 sec)


mysql> select titulo,autor,editorial from libros;

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

| titulo | autor | editorial |

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

| El aleph | Borges | Emece |

| Alicie en el pais de | Lewis Carroll | Planeta |

| Matematicas estas ah | Paenza | Planeta |

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

3 rows in set (0.00 sec)

mysql> select titulo,precio from libros;

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

| titulo | precio |

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

| El aleph | 45.5 |

| Alicie en el pais de | 25 |

| Matematicas estas ah | 15.8 |

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

3 rows in set (0.00 sec)

mysql> select editorial,cantidad from libros;

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

| editorial | cantidad |

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

| Emece | 100 |

| Planeta | 200 |

| Planeta | 200 |

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

3 rows in set (0.00 sec)

mysql> drop table if exists pelicula;

Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> create table peliculas(


-> titulo varchar(20),

-> actor varchar(20),

-> duracion integer,

-> cantidad integer

-> );

Query OK, 0 rows affected (0.03 sec)

mysql> describe peliculas;

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

| Field | Type | Null | Key | Default | Extra |

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

| titulo | varchar(20) | YES | | NULL | |

| actor | varchar(20) | YES | | NULL | |

| duracion | int(11) | YES | | NULL | |

| cantidad | int(11) | YES | | NULL | |

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

4 rows in set (0.00 sec)

mysql> insert into peliculas (titulo,actor,duracion,cantidad) values ("Mision im

posible","Tom Cruise",120,3);

Query OK, 1 row affected (0.00 sec)

mysql> insert into peliculas (titulo,actor,duracion,cantidad) values ("Mision im

posible 2", "Tom Cruise",180,2);

Query OK, 1 row affected (0.00 sec)

mysql> insert into pelicula (titulo,actor,duracion,cantidad) values ("Mujer Boni

ta","Julia R.",90,3);

ERROR 1146 (42S02): Table 'administracion.pelicula' doesn't exist

mysql> insert into peliculas(titulo,actor,duracion,cantida) values ("Mujer Bonit

a","Julia R.",90,3);

ERROR 1054 (42S22): Unknown column 'cantida' in 'field list'

mysql> insert into peliculas(titulo,actor,duracion,cantidad) values ("Mujer Boni

ta
">

"> ,"julia R."90.3);

"> ;

">

"> insert into peliculas(titulo,actor,duracion,cantidad) values ("Mujer Boni

ta);

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 'julia

R."90.3);

insert into peliculas(titulo,actor,duracion,cantidad) values ' at line 1

mysql> insert into peliculas(titulo,actor,duracion,cantidad) values ("Mujer Boni

ta","Julia R.",90,3);

Query OK, 1 row affected (0.01 sec)

mysql> insert into peliculas (titulo,actor,duracion,cantidad) values ("Elsa y Fr

ed","China Zorrilla",90,2);

Query OK, 1 row affected (0.00 sec)

mysql> select titulo,actor from peliculas;

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

| titulo | actor |

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

| Mision imposible | Tom Cruise |

| Mision imposible 2 | Tom Cruise |

| Mujer Bonita | Julia R. |

| Elsa y Fred | China Zorrilla |

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

4 rows in set (0.00 sec)

mysql> select titulo,duracion from peliculas;

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

| titulo | duracion |
+--------------------+----------+

| Mision imposible | 120 |

| Mision imposible 2 | 180 |

| Mujer Bonita | 90 |

| Elsa y Fred | 90 |

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

4 rows in set (0.00 sec)

mysql> select titulo,cantidad from peliculas;

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

| titulo | cantidad |

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

| Mision imposible | 3 |

| Mision imposible 2 | 2 |

| Mujer Bonita | 3 |

| Elsa y Fred | 2 |

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

4 rows in set (0.00 sec)

mysql>

Enter password: ***

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 3

Server version: 5.0.51b-community-nt-log MySQL Community Edition (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show databases;


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

| Database |

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

| information_schema |

| administracion |

| mysql |

| phpmyadmin |

| test |

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

5 rows in set (0.00 sec)

mysql> use administracion;

Database changed

mysql> drop table if exists empleados;

Query OK, 0 rows affected, 1 warning (0.01 sec)

mysql> create table empleados(

-> nombre varchar(20),

-> documento varchar(8),

-> sexo varchar(1),

-> domicilio varchar(30),

-> sueldobasico float

-> );

Query OK, 0 rows affected (0.07 sec)

mysql> describe empleados;

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

| Field | Type | Null | Key | Default | Extra |

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

| nombre | varchar(20) | YES | | NULL | |

| documento | varchar(8) | YES | | NULL | |

| sexo | varchar(1) | YES | | NULL | |

| domicilio | varchar(30) | YES | | NULL | |

| sueldobasico | float | YES | | NULL | |


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

5 rows in set (0.09 sec)

mysql> insert into empleados (nombre,documento,sexo,domicilio,sueldobasico) valu

es ("Juan Perez","22345678","m","Sarmineot 123",300);

Query OK, 1 row affected (0.00 sec)

mysql> insert into empleados (nombre,documento,sexo,domicilio,sueldobasico) valu

es ("Ana Acosta","22345678","f","Colon"

-> ;

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 '' at

line 1

mysql> insert into empleados (nombre,documento,sexo,domicilio,sueldobasico) valu

es ("Ana Acosta","22345678","f","Colon 134",500);

Query OK, 1 row affected (0.00 sec)

mysql> insert into empleados (nombre,documento,sexo,domicilio,sueldobasico) valu

es ("Marcos Torres","2734567","m","Urquiza 479",800);

Query OK, 1 row affected (0.01 sec)

mysql> describe empleados;

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

| Field | Type | Null | Key | Default | Extra |

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

| nombre | varchar(20) | YES | | NULL | |

| documento | varchar(8) | YES | | NULL | |

| sexo | varchar(1) | YES | | NULL | |

| domicilio | varchar(30) | YES | | NULL | |

| sueldobasico | float | YES | | NULL | |

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

5 rows in set (0.03 sec)

mysql> select from empleados nombre,documento,suedobasico;


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

empleados nombre,documento,suedobasico' at line 1

mysql> select nombre,documento,sueldobasico from empleados;

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

| nombre | documento | sueldobasico |

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

| Juan Perez | 22345678 | 300 |

| Ana Acosta | 22345678 | 500 |

| Marcos Torres | 2734567 | 800 |

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

3 rows in set (0.03 sec)

mysql> select nombre,documento from empleados;

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

| nombre | documento |

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

| Juan Perez | 22345678 |

| Ana Acosta | 22345678 |

| Marcos Torres | 2734567 |

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

3 rows in set (0.01 sec)

mysql> select*from empleados;

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

| nombre | documento | sexo | domicilio | sueldobasico |

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

| Juan Perez | 22345678 | m | Sarmineot 123 | 300 |

| Ana Acosta | 22345678 | f | Colon 134 | 500 |

| Marcos Torres | 2734567 | m | Urquiza 479 | 800 |

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

3 rows in set (0.00 sec)

mysql> drop table articulos;


ERROR 1051 (42S02): Unknown table 'articulos'

mysql> create table articulos(

-> codigo integer,

-> nombre varchar(20),

-> descripcion varchar(30),

-> precio float

-> );

Query OK, 0 rows affected (0.05 sec)

mysql> describe articulos;

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

| Field | Type | Null | Key | Default | Extra |

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

| codigo | int(11) | YES | | NULL | |

| nombre | varchar(20) | YES | | NULL | |

| descripcion | varchar(30) | YES | | NULL | |

| precio | float | YES | | NULL | |

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

4 rows in set (0.07 sec)

mysql> insert into articulos (codigo,nombre,descricion,precio) values (1,"impres

ora","Epson Stylus c45",400.80);

ERROR 1054 (42S22): Unknown column 'descricion' in 'field list'

mysql> insert into articulos (codigo,nombre,descripcion,precio) values (1,"impre

sora","Epson Stylus c45",400.80);

Query OK, 1 row affected (0.00 sec)

mysql> insert into articulos (codigo,nombre,descripcion,precio) values (2,"impre

sora","Epson Stylus c85",500);

Query OK, 1 row affected (0.00 sec)

mysql> insert into articulos (codigo,nombre,descripcion,precio) values (3,"monit

or","Samsung 14", 800);

Query OK, 1 row affected (0.01 sec)


mysql> select*from articulos;

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

| codigo | nombre | descripcion | precio |

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

| 1 | impresora | Epson Stylus c45 | 400.8 |

| 2 | impresora | Epson Stylus c85 | 500 |

| 3 | monitor | Samsung 14 | 800 |

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

3 rows in set (0.00 sec)

mysql> select nombre,descripcion,precio from articulos;

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

| nombre | descripcion | precio |

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

| impresora | Epson Stylus c45 | 400.8 |

| impresora | Epson Stylus c85 | 500 |

| monitor | Samsung 14 | 800 |

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

3 rows in set (0.01 sec)

mysql>

mysql> insert into agenda (nombre,domicilio,telefono) values ("Juan Torres","Ave

llaneda 135","4458787");

Query OK, 1 row affected (0.00 sec)

mysql> insert into agenda (nombre,domicilio,telefono) values ("Mariana Lopez","U

rquiza 333","4458787");

Query OK, 1 row affected (0.04 sec)

mysql> select agenda;

ERROR 1054 (42S22): Unknown column 'agenda' in 'field list'

mysql> select*from agenda;

+---------------+----------------+----------+
| nombre | domicilio | telefono |

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

| Alberto Mores | Colon 123 | 4234567 |

| Juan Torres | Avellaneda 135 | 4458787 |

| Juan Torres | Avellaneda 135 | 4458787 |

| Mariana Lopez | Urquiza 333 | 4458787 |

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

4 rows in set (0.00 sec)

mysql> select nombre from agenda where nombre="Juan Torres";

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

| nombre |

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

| Juan Torres |

| Juan Torres |

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

2 rows in set (0.00 sec)

mysql> select domicilio from agenda where domicilio="Colon 123";

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

| domicilio |

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

| Colon 123 |

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

1 row in set (0.00 sec)

mysql> select nombre from agenda where telefono="4545454";

Empty set (0.01 sec)

mysql> select telefono from agenda where telefono="4545454";

Empty set (0.00 sec)

mysql> select telefono from agenda where telefono="4545454";

Empty set (0.00 sec)


mysql> select telefono from agenda where telefono="4545454";

Empty set (0.01 sec)

mysql> select telefono from agenda where telefono="4458787";

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

| telefono |

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

| 4458787 |

| 4458787 |

| 4458787 |

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

3 rows in set (0.00 sec)

mysql> drop table agenda;

Query OK, 0 rows affected (0.13 sec)

mysql> drop table libros;

ERROR 1051 (42S02): Unknown table 'libros'

mysql> create table libros(

-> titulo varchar(20),

-> autor varchar(30),

-> editotrial varchar(15)

-> );

Query OK, 0 rows affected (0.08 sec)

mysql> describe libros;

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

| Field | Type | Null | Key | Default | Extra |

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

| titulo | varchar(20) | YES | | NULL | |

| autor | varchar(30) | YES | | NULL | |

| editotrial | varchar(15) | YES | | NULL | |

+------------+-------------+------+-----+---------+-------+
3 rows in set (0.08 sec)

mysql> insert into libros (titulo,autor,editorial) values ("El aleph","Borges","

planeta");

ERROR 1054 (42S22): Unknown column 'editorial' in 'field list'

mysql> insert into libros (titulo,autor,editotrial) values ("El aleph","Borges",

"planeta");

Query OK, 1 row affected (0.00 sec)

mysql> insert into libros (titulo,autor,editotrial) values ("Martin Fierro","Jos

e Hernandez","Emece");

Query OK, 1 row affected (0.00 sec)

mysql> insert into libros (titulo,autor,editotrial) values ("Aprende PHP","Mario

Molina","Emece");

Query OK, 1 row affected (0.01 sec)

mysql> insert into libros (titulo,autor,editotrial) values ("Cervantes","Borges"

,"Paidos");

Query OK, 1 row affected (0.01 sec)

mysql> select*from libros;

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

| titulo | autor | editotrial |

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

| El aleph | Borges | planeta |

| Martin Fierro | Jose Hernandez | Emece |

| Aprende PHP | Mario Molina | Emece |

| Cervantes | Borges | Paidos |

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

4 rows in set (0.00 sec)

mysql> select autor from libros where autore="Borges";

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


mysql> select Borges from libros where autor="Borges";

ERROR 1054 (42S22): Unknown column 'Borges' in 'field list'

mysql> select autor from libros where autor="Borges";

+--------+

| autor |

+--------+

| Borges |

| Borges |

+--------+

2 rows in set (0.00 sec)

mysql> select editorial from libros where aditorial="Emece";

ERROR 1054 (42S22): Unknown column 'editorial' in 'field list'

mysql> select editotrial from libros where aditotrial="Emece";

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

mysql> select editotrial from libros where editotrial="Emece";

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

| editotrial |

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

| Emece |

| Emece |

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

2 rows in set (0.00 sec)

mysql> select titulo from libros where titulo="Martin Fierro";

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

| titulo |

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

| Martin Fierro |

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

1 row in set (0.00 sec)

mysql> drop table libros;

Query OK, 0 rows affected (0.10 sec)


mysql> create table articulos(

-> codigo integer,

-> nombre varchar(20),

-> descripcion varchar(30),

-> precio float

-> );

ERROR 1050 (42S01): Table 'articulos' already exists

mysql> drop table articulos;

Query OK, 0 rows affected (0.04 sec)

mysql> create table articulos(

-> codigo integer,

-> nombre varchar(20),

-> descripcion varchar(30),

-> precio float

-> );

Query OK, 0 rows affected (0.05 sec)

mysql> describe articulos;

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

| Field | Type | Null | Key | Default | Extra |

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

| codigo | int(11) | YES | | NULL | |

| nombre | varchar(20) | YES | | NULL | |

| descripcion | varchar(30) | YES | | NULL | |

| precio | float | YES | | NULL | |

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

4 rows in set (0.07 sec)

mysql> insert into articulos (codigo,nombre,descripcion,precio) values (1,impres

ora","Epson Stylus c45",400.80);

">

"> ;
"> ;

">

"> )

"> );

"> ");

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 '","Ep

son Stylus c45",400.80);

);

")' at line 1

mysql> insert into articulos (codigo,nombre,descripcion,precio) values (1,impres

ora","Epson Stylus c45",400.80);

"> ");

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 '","Ep

son Stylus c45",400.80);

")' at line 1

mysql> insert into articulos (codigo,nombre,descripcion,precio) values (1,"impre

sora","Epson Stylus c45",400.80);

Query OK, 1 row affected (0.01 sec)

mysql> insert into articulos (codigo,nombre,descripcion,precio) values (2,"impre

sora","Epson Stylus c85",500);

Query OK, 1 row affected (0.01 sec)

mysql> insert into articulos (codigo,nombre,descripcion,precio) values (3,"monit

or","Samsung 14",800);

Query OK, 1 row affected (0.00 sec)


mysql> insert into articulos (codigo,nombre,descripcion,precio) values (4,"tecla

do","ingles Biswal",100);

Query OK, 1 row affected (0.00 sec)

mysql> insert into articulos (codigo,nombre,descripcion,precio) values (5,"tecla

do","español Biswal",90);

Query OK, 1 row affected, 1 warning (0.01 sec)

mysql> select nombre from articulos where nombre="impresora";

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

| nombre |

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

| impresora |

| impresora |

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

2 rows in set (0.00 sec)

mysql> select codigo,descripcion,precio from articulos

-> show select codigo,descripcion,precio from articulos

-> ;

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 'show

select codigo,descripcion,precio from articulos' at line 2

mysql> show select codigo,descripcion,precio from articulos;

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

t codigo,descripcion,precio from articulos' at line 1

mysql> show codigo,descripcion,precio from articulos;

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 'codig

o,descripcion,precio from articulos' at line 1

mysql> select codigo,descripcion,precio from articulos where teclados="teclados"

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


mysql> select codigo,descripcion,precio from articulos where teclados;

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

mysql> select codigo,descripcion,precio from articulos where codigo="teclados";

Empty set, 5 warnings (0.01 sec)

mysql> select codigo,descripcion,precio from articulos where codigo="teclados";

Empty set, 5 warnings (0.00 sec)

mysql> describe articulos;

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

| Field | Type | Null | Key | Default | Extra |

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

| codigo | int(11) | YES | | NULL | |

| nombre | varchar(20) | YES | | NULL | |

| descripcion | varchar(30) | YES | | NULL | |

| precio | float | YES | | NULL | |

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

4 rows in set (0.06 sec)

mysql> select*from articulos;

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

| codigo | nombre | descripcion | precio |

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

| 1 | impresora | Epson Stylus c45 | 400.8 |

| 2 | impresora | Epson Stylus c85 | 500 |

| 3 | monitor | Samsung 14 | 800 |

| 4 | teclado | ingles Biswal | 100 |

| 5 | teclado | espa | 90 |

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

5 rows in set (0.00 sec)

mysql> select*from articulos teclados;

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

| codigo | nombre | descripcion | precio |


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

| 1 | impresora | Epson Stylus c45 | 400.8 |

| 2 | impresora | Epson Stylus c85 | 500 |

| 3 | monitor | Samsung 14 | 800 |

| 4 | teclado | ingles Biswal | 100 |

| 5 | teclado | espa | 90 |

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

5 rows in set (0.01 sec)

mysql> select*teclados from articulos;

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 'tecla

dos from articulos' at line 1

mysql> select*from teclados articulos;

ERROR 1146 (42S02): Table 'administracion.teclados' doesn't exist

mysql>

Enter password: ***

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 5

Server version: 5.0.51b-community-nt-log MySQL Community Edition (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show databases;

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

| Database |

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

| information_schema |

| administracion |

| mysql |

| phpmyadmin |

| test |

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

5 rows in set (0.01 sec)


mysql> show tables;

ERROR 1046 (3D000): No database selected

mysql> use administracion;

Database changed

mysql> show tables;

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

| Tables_in_administracion |

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

| articulos |

| empleados |

| usuarios |

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

3 rows in set (0.01 sec)

mysql> drop table libros;

ERROR 1051 (42S02): Unknown table 'libros'

mysql> create table libros(

-> titulo varchar(20),

-> autor varchar(30),

-> editorial varchar(15),

-> precio float

-> );

Query OK, 0 rows affected (0.05 sec)

mysql> insert into libros (titulo,autor,editorial,precio) values ("El aleph","Bo

rges","Planeta",12.50);

Query OK, 1 row affected (0.04 sec)

mysql> insert into libros (titulo,autor,editorial,precio) values ("Martin Fierro

","Borges","Jose Hernandez","Emece",16.00);

ERROR 1136 (21S01): Column count doesn't match value count at row 1

mysql> insert into libros (titulo,autor,editorial,precio) values ("Martin Fierro

","Borges","Jose Hernandez","Emece",16.00);
ERROR 1136 (21S01): Column count doesn't match value count at row 1

mysql> insert into libros (titulo,autor,editorial,precio) values ("Martin Fierro

","Jose Hernandez","Emece",16.00);

Query OK, 1 row affected (0.00 sec)

mysql> insert into libros (titulo,autor,editorial,precio) values ("Aprenda PHP",

"Mario Molina","Emece",35.40);

Query OK, 1 row affected (0.00 sec)

mysql> insert into libros (titulo,autor,editorial,precio) values ("Cervantes","B

orges","Paidos",50.90);

Query OK, 1 row affected (0.00 sec)

mysql> select titulo,autor,editorial from libros;

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

| titulo | autor | editorial |

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

| El aleph | Borges | Planeta |

| Martin Fierro | Jose Hernandez | Emece |

| Aprenda PHP | Mario Molina | Emece |

| Cervantes | Borges | Paidos |

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

4 rows in set (0.00 sec)

mysql> select titulo,autor,editorial,precio from libros;

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

| titulo | autor | editorial | precio |

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

| El aleph | Borges | Planeta | 12.5 |

| Martin Fierro | Jose Hernandez | Emece | 16 |

| Aprenda PHP | Mario Molina | Emece | 35.4 |

| Cervantes | Borges | Paidos | 50.9 |

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

4 rows in set (0.00 sec)


mysql> select titulo,autor,editorial,precio from libros where autor<>"Borges";

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

| titulo | autor | editorial | precio |

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

| Martin Fierro | Jose Hernandez | Emece | 16 |

| Aprenda PHP | Mario Molina | Emece | 35.4 |

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

2 rows in set (0.00 sec)

mysql> select titulo,autor,editorial,precio from libros where precio>20;

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

| titulo | autor | editorial | precio |

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

| Aprenda PHP | Mario Molina | Emece | 35.4 |

| Cervantes | Borges | Paidos | 50.9 |

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

2 rows in set (0.00 sec)

mysql> select titulo,autor,editorial,precio from libros where precio<=20;

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

| titulo | autor | editorial | precio |

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

| El aleph | Borges | Planeta | 12.5 |

| Martin Fierro | Jose Hernandez | Emece | 16 |

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

2 rows in set (0.00 sec)

mysql>

Enter password: ***

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 1

Server version: 5.0.51b-community-nt-log MySQL Community Edition (GPL)


Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show databases;

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

| Database |

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

| information_schema |

| administracion |

| mysql |

| phpmyadmin |

| test |

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

5 rows in set (0.04 sec)

mysql> use adminstracion;

ERROR 1049 (42000): Unknown database 'adminstracion'

mysql> use administracion;

Database changed

mysql> show tables;

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

| Tables_in_administracion |

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

| articulos |

| empleados |

| libros |

| usuarios |

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

4 rows in set (0.00 sec)

mysql> drop articulos;

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 'artic

ulos' at line 1

mysql> drop table articulos,


-> ;

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 '' at

line 1

mysql> drop table articulos;

Query OK, 0 rows affected (0.10 sec)

mysql> create table articulos(

-> codigo integer,

-> nombre varchar(20),

-> descripcion varchar(30),

-> precio float,

-> cantidad integer

-> );

Query OK, 0 rows affected (0.09 sec)

mysql> describe articulos;

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

| Field | Type | Null | Key | Default | Extra |

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

| codigo | int(11) | YES | | NULL | |

| nombre | varchar(20) | YES | | NULL | |

| descripcion | varchar(30) | YES | | NULL | |

| precio | float | YES | | NULL | |

| cantidad | int(11) | YES | | NULL | |

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

5 rows in set (0.08 sec)

mysql> insert into articulos (codigo,nombre,descripcion,precio,canttidad) values

(1,"impresora","epson stylus c45",400.80,20);

ERROR 1054 (42S22): Unknown column 'canttidad' in 'field list'

mysql> insert into articulos (codigo,nombre,descripcion,precio,cantidad) values(

1,"impresora","epson stylus c45",400.80,20);

Query OK, 1 row affected (0.00 sec)


mysql> insert into articulos (codigo,nombre,descripcion,precio,canttidad) values

(2,"impresora","epson stylus c85",500,30);

ERROR 1054 (42S22): Unknown column 'canttidad' in 'field list'

mysql> insert into articulos (codigo,nombre,descripcion,precio,cantidad) values(

2,"impresora","epson stylus c85",500,30);

Query OK, 1 row affected (0.01 sec)

mysql> insert into articulos (codigo,nombre,descripcion,precio,cantidad) values(

3,"monitor","samsung 14",800,10);

Query OK, 1 row affected (0.00 sec)

mysql> insert into articulos (codigo,nombre,descripcion,precio,cantidad) values(

4,"teclado","ingles biswal",100,50);

Query OK, 1 row affected (0.00 sec)

mysql> insert into articulos (codigo,nombre,descripcion,precio,cantidad) values(

5,"teclado","español biswal",90,50);

Query OK, 1 row affected, 1 warning (0.01 sec)

mysql> select table;

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 'table

' at line 1

mysql> select;

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 '' at

line 1

mysql> select

-> ;

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 '' at

line 1

mysql> select*from articulos;


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

| codigo | nombre | descripcion | precio | cantidad |

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

| 1 | impresora | epson stylus c45 | 400.8 | 20 |

| 2 | impresora | epson stylus c85 | 500 | 30 |

| 3 | monitor | samsung 14 | 800 | 10 |

| 4 | teclado | ingles biswal | 100 | 50 |

| 5 | teclado | espa | 90 | 50 |

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

5 rows in set (0.00 sec)

mysql> select impresora from articulos;

ERROR 1054 (42S22): Unknown column 'impresora' in 'field list'

mysql> describe impresora;

ERROR 1146 (42S02): Table 'administracion.impresora' doesn't exist

mysql> select impresora from articulos;

ERROR 1054 (42S22): Unknown column 'impresora' in 'field list'

mysql> select*impresora from articulos;

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 'impre

sora from articulos' at line 1

mysql> select codigo,nombre,descripcion,precio,cantidad from articulos where imp

resora;

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

mysql> show tables;

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

| Tables_in_administracion |

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

| articulos |

| empleados |

| libros |

| usuarios |

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

4 rows in set (0.01 sec)


mysql> use articulos;

ERROR 1049 (42000): Unknown database 'articulos'

mysql> select articulos;

ERROR 1054 (42S22): Unknown column 'articulos' in 'field list'

mysql> select*from articulos;

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

| codigo | nombre | descripcion | precio | cantidad |

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

| 1 | impresora | epson stylus c45 | 400.8 | 20 |

| 2 | impresora | epson stylus c85 | 500 | 30 |

| 3 | monitor | samsung 14 | 800 | 10 |

| 4 | teclado | ingles biswal | 100 | 50 |

| 5 | teclado | espa | 90 | 50 |

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

5 rows in set (0.00 sec)

mysql> select from articulos impresora;

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

articulos impresora' at line 1

mysql> select*from articulos impresora;

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

| codigo | nombre | descripcion | precio | cantidad |

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

| 1 | impresora | epson stylus c45 | 400.8 | 20 |

| 2 | impresora | epson stylus c85 | 500 | 30 |

| 3 | monitor | samsung 14 | 800 | 10 |

| 4 | teclado | ingles biswal | 100 | 50 |

| 5 | teclado | espa | 90 | 50 |

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

5 rows in set (0.00 sec)

mysql> select codigo,nombre,descripcion,precio,cantidad from articulos where nom


bre="impresora";

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

| codigo | nombre | descripcion | precio | cantidad |

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

| 1 | impresora | epson stylus c45 | 400.8 | 20 |

| 2 | impresora | epson stylus c85 | 500 | 30 |

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

2 rows in set (0.00 sec)

mysql> select*from articulos where precio>=500;

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

| codigo | nombre | descripcion | precio | cantidad |

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

| 2 | impresora | epson stylus c85 | 500 | 30 |

| 3 | monitor | samsung 14 | 800 | 10 |

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

2 rows in set (0.00 sec)

mysql> select*from articulos where cantidad<30;

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

| codigo | nombre | descripcion | precio | cantidad |

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

| 1 | impresora | epson stylus c45 | 400.8 | 20 |

| 3 | monitor | samsung 14 | 800 | 10 |

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

2 rows in set (0.00 sec)

mysql> select nombre,descripcion,precio,cantidad from articulos where cantidad<2

0;

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

| nombre | descripcion | precio | cantidad |

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

| monitor | samsung 14 | 800 | 10 |

+---------+-------------+--------+----------+
1 row in set (0.00 sec)

mysql> select nombre,descripcion,from articulos where precio<>100;

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

articulos where precio<>100' at line 1

mysql> select nombre,descripcion from articulos where precio<>100;

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

| nombre | descripcion |

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

| impresora | epson stylus c45 |

| impresora | epson stylus c85 |

| monitor | samsung 14 |

| teclado | espa |

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

4 rows in set (0.01 sec)

mysql>

¡¡¡¡¡¡¡¡ME QUEDE EN LA PAG. 12 DEL PDF!!!!!!!!!

Enter password: ***

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 1

Server version: 5.0.51b-community-nt-log MySQL Community Edition (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show datbases;

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 'datba

ses' at line 1
mysql> show databases;

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

| Database |

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

| information_schema |

| administracion |

| mysql |

| phpmyadmin |

| test |

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

5 rows in set (0.03 sec)

mysql> use administracion;

Database changed

mysql> show tables;

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

| Tables_in_administracion |

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

| articulos |

| empleados |

| libros |

| usuarios |

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

4 rows in set (0.02 sec)

mysql> describe articulos;

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

| Field | Type | Null | Key | Default | Extra |

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

| codigo | int(11) | YES | | NULL | |

| nombre | varchar(20) | YES | | NULL | |

| descripcion | varchar(30) | YES | | NULL | |

| precio | float | YES | | NULL | |

| cantidad | int(11) | YES | | NULL | |


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

5 rows in set (0.14 sec)

mysql> drop table peliculas;

ERROR 1051 (42S02): Unknown table 'peliculas'

mysql> create table peliculas(

-> titulo varchar(20),

-> actor varchar(20),

-> duracion integer,

-> cantidad integer

-> );

Query OK, 0 rows affected (0.04 sec)

mysql> insert into peliculas (titulo, actor, duracion, cantidad)

-> values ('Mision imposible','Tom Cruise',120,3);

Query OK, 1 row affected (0.05 sec)

mysql> insert into peliculas (titulo, actor, duracion, cantidad)

-> values ('Mision imposible 2','Tom Cruise',180,2);

Query OK, 1 row affected (0.00 sec)

mysql> insert into peliculas (titulo, actor, duracion, cantidad)

-> values ('Mujer bonita','Julia R.',90,3);

Query OK, 1 row affected (0.00 sec)

mysql> insert into peliculas (titulo, actor, duracion, cantidad)

-> values ('Elsa y Fred','China Zorrilla',90,2);

Query OK, 1 row affected (0.01 sec)

mysql> select *from peliculas where duracion<=90;

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

| titulo | actor | duracion | cantidad |

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

| Mujer bonita | Julia R. | 90 | 3 |


| Elsa y Fred | China Zorrilla | 90 | 2 |

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

2 rows in set (0.01 sec)

mysql> select * from peliculas where actor<>'Tom Cruise';

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

| titulo | actor | duracion | cantidad |

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

| Mujer bonita | Julia R. | 90 | 3 |

| Elsa y Fred | China Zorrilla | 90 | 2 |

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

2 rows in set (0.01 sec)

mysql> select * from peliculas where cantidad >2;

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

| titulo | actor | duracion | cantidad |

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

| Mision imposible | Tom Cruise | 120 | 3 |

| Mujer bonita | Julia R. | 90 | 3 |

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

2 rows in set (0.01 sec)

mysql> drop table agenda;

ERROR 1051 (42S02): Unknown table 'agenda'

mysql> create table agenda(

-> apellido varchar(30),

-> nombre varchar(20),

-> domicilio varchar(30),

-> telefono varchar(11)

-> );

Query OK, 0 rows affected (0.07 sec)

mysql> describe agenda;

+-----------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |

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

| apellido | varchar(30) | YES | | NULL | |

| nombre | varchar(20) | YES | | NULL | |

| domicilio | varchar(30) | YES | | NULL | |

| telefono | varchar(11) | YES | | NULL | |

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

4 rows in set (0.07 sec)

mysql> insert into articulos (codigo,nombre,descripcion,precio) values (1,"impre

"> sora","Epson Stylus c45",400.80);

Query OK, 1 row affected (0.00 sec)

mysql> ;

ERROR:

No query specified

mysql> insert into agenda (apellido,nombre,domicilio,telefono) values ("Mores","

Alberto","Colon 123",4234567);

Query OK, 1 row affected (0.00 sec)

mysql> insert into agenda (apellido,nombre,domicilio,telefono) values ("Torres",

"Juan","Avellaneda 135",4458787;

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 '' at

line 1

mysql> insert into agenda (apellido,nombre,domicilio,telefono) values ("Torres",

"Juan","Avellaneda 135",4458787);

Query OK, 1 row affected (0.00 sec)

mysql> insert into agenda (apellido,nombre,domicilio,telefono) values ("Lopez","

Mariana","Urquiza 333",4545454);

Query OK, 1 row affected (0.01 sec)


mysql> insert into agenda (apellido,nombre,domicilio,telefono) values ("Lopez","

Fernando","Urquiza 333",454545);

Query OK, 1 row affected (0.01 sec)

mysql> insert into agenda (apellido,nombre,domicilio,telefono) values ("Suarez",

"Marian","Sarmiento 643",4445544);

Query OK, 1 row affected (0.01 sec)

mysql> insert into agenda (apellido,nombre,domicilio,telefono) values ("Lopez","

Ana","Sucre 309",4252587);

Query OK, 1 row affected (0.04 sec)

mysql> select

-> ;

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 '' at

line 1

mysql> select*from agenda;

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

| apellido | nombre | domicilio | telefono |

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

| Mores | Alberto | Colon 123 | 4234567 |

| Torres | Juan | Avellaneda 135 | 4458787 |

| Lopez | Mariana | Urquiza 333 | 4545454 |

| Lopez | Fernando | Urquiza 333 | 454545 |

| Suarez | Marian | Sarmiento 643 | 4445544 |

| Lopez | Ana | Sucre 309 | 4252587 |

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

6 rows in set (0.00 sec)

mysql> select*from agenda where apellido="Lopez";

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

| apellido | nombre | domicilio | telefono |


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

| Lopez | Mariana | Urquiza 333 | 4545454 |

| Lopez | Fernando | Urquiza 333 | 454545 |

| Lopez | Ana | Sucre 309 | 4252587 |

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

3 rows in set (0.00 sec)

mysql> select*from agenda where nombre<>"Mariana";

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

| apellido | nombre | domicilio | telefono |

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

| Mores | Alberto | Colon 123 | 4234567 |

| Torres | Juan | Avellaneda 135 | 4458787 |

| Lopez | Fernando | Urquiza 333 | 454545 |

| Suarez | Marian | Sarmiento 643 | 4445544 |

| Lopez | Ana | Sucre 309 | 4252587 |

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

5 rows in set (0.00 sec)

mysql> select*from agenda where nombre domicilio="Colon 123";

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 'domic

ilio="Colon 123"' at line 1

mysql> select*from agenda where domicilio="Colon 123";

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

| apellido | nombre | domicilio | telefono |

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

| Mores | Alberto | Colon 123 | 4234567 |

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

1 row in set (0.00 sec)

mysql> select*from agenda where telefono="4545454";

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

| apellido | nombre | domicilio | telefono |


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

| Lopez | Mariana | Urquiza 333 | 4545454 |

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

1 row in set (0.00 sec)

mysql>

mysql> select*from agenda where apellido="Lopez";

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

| apellido | nombre | domicilio | telefono |

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

| Lopez | Mariana | Urquiza 333 | 4545454 |

| Lopez | Fernando | Urquiza 333 | 454545 |

| Lopez | Ana | Sucre 309 | 4252587 |

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

3 rows in set (0.00 sec)

mysql> select*from agenda where nombre<>"Mariana";

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

| apellido | nombre | domicilio | telefono |

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

| Mores | Alberto | Colon 123 | 4234567 |

| Torres | Juan | Avellaneda 135 | 4458787 |

| Lopez | Fernando | Urquiza 333 | 454545 |

| Suarez | Marian | Sarmiento 643 | 4445544 |

| Lopez | Ana | Sucre 309 | 4252587 |

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

5 rows in set (0.00 sec)

mysql> select*from agenda where nombre domicilio="Colon 123";

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 'domic

ilio="Colon 123"' at line 1


mysql> select*from agenda where domicilio="Colon 123";

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

| apellido | nombre | domicilio | telefono |

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

| Mores | Alberto | Colon 123 | 4234567 |

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

1 row in set (0.00 sec)

mysql> select*from agenda where telefono="4545454";

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

| apellido | nombre | domicilio | telefono |

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

| Lopez | Mariana | Urquiza 333 | 4545454 |

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

1 row in set (0.00 sec)

mysql> drop table if exists usuarios;

Query OK, 0 rows affected (0.08 sec)

mysql> create table usuarios (

-> nombre varchar(30),

-> clave varchar(10)

-> );

Query OK, 0 rows affected (0.17 sec)

mysql> insert into usuarios (nombre, clave) values ('Leonardo','payaso');

Query OK, 1 row affected (0.03 sec)

mysql> insert into usuarios (nombre, clave) values ('MarioPerez','Marito');

Query OK, 1 row affected (0.01 sec)

mysql> insert into usuarios (nombre, clave) values ('Marcelo','River');

Query OK, 1 row affected (0.00 sec)


mysql> insert into usuarios (nombre, clave) values ('Gustavo','River');

Query OK, 1 row affected (0.00 sec)

mysql> delete from usuarios where nombre='Leonardo';

Query OK, 1 row affected (0.01 sec)

mysql> select nombre,clave from usuarios;

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

| nombre | clave |

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

| MarioPerez | Marito |

| Marcelo | River |

| Gustavo | River |

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

3 rows in set (0.00 sec)

mysql> delete from usuarios where clave='River';

Query OK, 2 rows affected (0.00 sec)

mysql> select nombre,clave from usuarios;

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

| nombre | clave |

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

| MarioPerez | Marito |

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

1 row in set (0.00 sec)

mysql> delete from usuarios;

Query OK, 1 row affected (0.00 sec)

mysql> select nombre,clave from usuarios;

Empty set (0.00 sec)

mysql> drop table agenda;


Query OK, 0 rows affected (0.12 sec)

mysql> craate table agenda(

-> ;

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 'craat

e table agenda(' at line 1

mysql> create table agenda(

-> apellido varchar(30),

-> nombre varchar(30),

-> domicilio varchar(30),

-> telefono varchar(11)

-> );

Query OK, 0 rows affected (0.04 sec)

mysql> describe agenda;

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

| Field | Type | Null | Key | Default | Extra |

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

| apellido | varchar(30) | YES | | NULL | |

| nombre | varchar(30) | YES | | NULL | |

| domicilio | varchar(30) | YES | | NULL | |

| telefono | varchar(11) | YES | | NULL | |

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

4 rows in set (0.08 sec)

mysql> insert into agenda(apellido,nombre,domicilio,telefono) values ("Mores","A

lberto","Colon 123",4234567);

Query OK, 1 row affected (0.01 sec)

mysql> insert into agenda(apellido,nombre,domicilio,telefono) values ("Torres","

Juan","Avellaneda 135",4458787);

Query OK, 1 row affected (0.00 sec)


mysql> insert into agenda(apellido,nombre,domicilio,telefono) values ("Lopez","M

ariana","Urquiza 333",4545454);

Query OK, 1 row affected (0.00 sec)

mysql> insert into agenda(apellido,nombre,domicilio,telefono) values ("Lopez","J

ose","Urquiza 333",4545454);

Query OK, 1 row affected (0.00 sec)

mysql> insert into agenda(apellido,nombre,domicilio,telefono) values ("Peralta",

"Susana","Gral. Paz 1234",4123456);

Query OK, 1 row affected (0.00 sec)

mysql> delete where nombre="juan";

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 'where

nombre="juan"' at line 1

mysql> delete where nombre="juan"

-> ;

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 'where

nombre="juan"' at line 1

mysql> delete where "juan";

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 'where

"juan"' at line 1

mysql> delete from agenda where nombre="juan";

Query OK, 1 row affected (0.00 sec)

mysql> delete from agenda where telefono="4545454";

Query OK, 2 rows affected (0.08 sec)

mysql> drop table libros;

Query OK, 0 rows affected (0.09 sec)


mysql> create table libros(

-> -> titulo varchar(20),

-> -> autor varchar(30),

-> -> editotrial varchar(15)

-> -> );

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 '-> ti

tulo varchar(20),

-> autor varchar(30),

-> editotrial varchar(15)

' at line 2

mysql>

mysql> create table libros(

-> titulo varchar(20),

-> autor varchar(30),

-> editorial varchar(15),

-> precio float

-> );

Query OK, 0 rows affected (0.07 sec)

mysql> describe libros;

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

| Field | Type | Null | Key | Default | Extra |

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

| titulo | varchar(20) | YES | | NULL | |

| autor | varchar(30) | YES | | NULL | |

| editorial | varchar(15) | YES | | NULL | |

| precio | float | YES | | NULL | |

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

4 rows in set (0.09 sec)

mysql> insert into agenda(titulo,autor,editorial,precio) values ("El aleph","Bor

ges","Planeta,15.00");

ERROR 1136 (21S01): Column count doesn't match value count at row 1
mysql> insert into agenda(titulo,autor,editorial,precio) values ("El aleph","Bor

ges","Planeta",15.00);

ERROR 1054 (42S22): Unknown column 'titulo' in 'field list'

mysql> insert into agenda(titulo,autor,editorial,precio) values ("El aleph","Bor

ges","Planeta",15.00);

ERROR 1054 (42S22): Unknown column 'titulo' in 'field list'

mysql> insert into agenda (titulo,autor,editorial,precio) values ("El aleph","Bo

rges","Planeta",15.00);

ERROR 1054 (42S22): Unknown column 'titulo' in 'field list'

mysql> insert into libros (titulo,autor,editorial,precio) values ("El aleph","Bo

rges","Planeta",15.00);

Query OK, 1 row affected (0.01 sec)

mysql> insert into agenda (titulo,autor,editorial,precio) values ("Martin Fierro

", "Jose Hernandez","Emece,25.50");

ERROR 1136 (21S01): Column count doesn't match value count at row 1

mysql> insert into agenda (titulo,autor,editorial,precio) values ("Martin Fierro

", "Jose Hernandez","Emece 25.50");

ERROR 1136 (21S01): Column count doesn't match value count at row 1

mysql> insert into agenda (titulo,autor,editorial,precio) values ("Martin Fierro

", "Jose Hernandez", "Emece 25.50");

ERROR 1136 (21S01): Column count doesn't match value count at row 1

mysql> insert into libros (titulo,autor,editorial,precio) values ("Martin Fierro

", "Jose Hernandez", "Emece 25.50");

ERROR 1136 (21S01): Column count doesn't match value count at row 1

mysql> insert into libros(titulo,autor,editorial,precio) values ("Martin Fierro"

, "Jose Hernandez", "Emece 25.50");

ERROR 1136 (21S01): Column count doesn't match value count at row 1

mysql> insert into libros(titulo,autor,editorial,precio) values ("Martin Fierro"

, "Jose Hernandez", "Emece, 25.50");

ERROR 1136 (21S01): Column count doesn't match value count at row 1

mysql> insert into libros(titulo,autor,editorial,precio) values ("Martin Fierro"

, "Jose Hernandez", "Emece" 25.50);

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 '25.50

)' at line 1

mysql> insert into libros(titulo,autor,editorial,precio) values ("Martin Fierro"

, "Jose Hernandez", "Emece",25.50);

Query OK, 1 row affected (0.05 sec)

mysql> insert into libros(titulo,autor,editorial,precio) values ("Aprenda PHP","

Mario Molina","Emece,26.809");

ERROR 1136 (21S01): Column count doesn't match value count at row 1

mysql> insert into libros(titulo,autor,editorial,precio) values ("Aprenda PHP","

Mario Molina","Emece",26.809);

Query OK, 1 row affected (0.01 sec)

mysql> insert into libros(titulo,autor,editorial,precio) values ("Cervantes y el

quijote","Borges","Paidos",45.50);

Query OK, 1 row affected, 1 warning (0.00 sec)

mysql> insert into libros(titulo,autor,editorial,precio) values ("Matematica est

as ahi", "Paenza", "Paidos",50.00);

Query OK, 1 row affected (0.01 sec)

mysql> select*from libros;

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

| titulo | autor | editorial | precio |

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

| El aleph | Borges | Planeta | 15 |

| Martin Fierro | Jose Hernandez | Emece | 25.5 |

| Aprenda PHP | Mario Molina | Emece | 26.809 |

| Cervantes y el quijo | Borges | Paidos | 45.5 |

| Matematica estas ahi | Paenza | Paidos | 50 |

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

5 rows in set (0.00 sec)

mysql> delect from libros where autor="Paenza";


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 'delec

t from libros where autor="Paenza"' at line 1

mysql> delect from libros where "Paenza";

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 'delec

t from libros where "Paenza"' at line 1

mysql> delect from libros "Paenza";

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 'delec

t from libros "Paenza"' at line 1

mysql> delete from libros "Paenza";

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 '"Paen

za"' at line 1

mysql> delete from libros where autor="Paenza";

Query OK, 1 row affected (0.00 sec)

mysql> delete from libros where autor="Paenza";

Query OK, 0 rows affected (0.00 sec)

mysql> delete from libros where precio"<20";

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 '"<20"

' at line 1

mysql> delete from libros where precio="<20";

Query OK, 0 rows affected, 4 warnings (0.01 sec)

mysql> delete from libros where precio=">=40";

Query OK, 0 rows affected, 4 warnings (0.00 sec)

mysql> drop table libros;

Query OK, 0 rows affected (0.11 sec)


mysql>

' at line 2

mysql>

mysql> create table libros(

-> titulo varchar(20),

-> autor varchar(30),

-> editorial varchar(15),

-> precio float

-> );

Query OK, 0 rows affected (0.07 sec)

mysql> describe libros;

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

| Field | Type | Null | Key | Default | Extra |

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

| titulo | varchar(20) | YES | | NULL | |

| autor | varchar(30) | YES | | NULL | |

| editorial | varchar(15) | YES | | NULL | |

| precio | float | YES | | NULL | |

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

4 rows in set (0.09 sec)

mysql> insert into agenda(titulo,autor,editorial,precio) values ("El aleph","Bor

ges","Planeta,15.00");

ERROR 1136 (21S01): Column count doesn't match value count at row 1

mysql> insert into agenda(titulo,autor,editorial,precio) values ("El aleph","Bor

ges","Planeta",15.00);

ERROR 1054 (42S22): Unknown column 'titulo' in 'field list'

mysql> insert into agenda(titulo,autor,editorial,precio) values ("El aleph","Bor

ges","Planeta",15.00);

ERROR 1054 (42S22): Unknown column 'titulo' in 'field list'

mysql> insert into agenda (titulo,autor,editorial,precio) values ("El aleph","Bo

rges","Planeta",15.00);

ERROR 1054 (42S22): Unknown column 'titulo' in 'field list'


mysql> insert into libros (titulo,autor,editorial,precio) values ("El aleph","Bo

rges","Planeta",15.00);

Query OK, 1 row affected (0.01 sec)

mysql> insert into agenda (titulo,autor,editorial,precio) values ("Martin Fierro

", "Jose Hernandez","Emece,25.50");

ERROR 1136 (21S01): Column count doesn't match value count at row 1

mysql> insert into agenda (titulo,autor,editorial,precio) values ("Martin Fierro

", "Jose Hernandez","Emece 25.50");

ERROR 1136 (21S01): Column count doesn't match value count at row 1

mysql> insert into agenda (titulo,autor,editorial,precio) values ("Martin Fierro

", "Jose Hernandez", "Emece 25.50");

ERROR 1136 (21S01): Column count doesn't match value count at row 1

mysql> insert into libros (titulo,autor,editorial,precio) values ("Martin Fierro

", "Jose Hernandez", "Emece 25.50");

ERROR 1136 (21S01): Column count doesn't match value count at row 1

mysql> insert into libros(titulo,autor,editorial,precio) values ("Martin Fierro"

, "Jose Hernandez", "Emece 25.50");

ERROR 1136 (21S01): Column count doesn't match value count at row 1

mysql> insert into libros(titulo,autor,editorial,precio) values ("Martin Fierro"

, "Jose Hernandez", "Emece, 25.50");

ERROR 1136 (21S01): Column count doesn't match value count at row 1

mysql> insert into libros(titulo,autor,editorial,precio) values ("Martin Fierro"

, "Jose Hernandez", "Emece" 25.50);

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 '25.50

)' at line 1

mysql> insert into libros(titulo,autor,editorial,precio) values ("Martin Fierro"

, "Jose Hernandez", "Emece",25.50);

Query OK, 1 row affected (0.05 sec)

mysql> insert into libros(titulo,autor,editorial,precio) values ("Aprenda PHP","

Mario Molina","Emece,26.809");

ERROR 1136 (21S01): Column count doesn't match value count at row 1
mysql> insert into libros(titulo,autor,editorial,precio) values ("Aprenda PHP","

Mario Molina","Emece",26.809);

Query OK, 1 row affected (0.01 sec)

mysql> insert into libros(titulo,autor,editorial,precio) values ("Cervantes y el

quijote","Borges","Paidos",45.50);

Query OK, 1 row affected, 1 warning (0.00 sec)

mysql> insert into libros(titulo,autor,editorial,precio) values ("Matematica est

as ahi", "Paenza", "Paidos",50.00);

Query OK, 1 row affected (0.01 sec)

mysql> select*from libros;

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

| titulo | autor | editorial | precio |

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

| El aleph | Borges | Planeta | 15 |

| Martin Fierro | Jose Hernandez | Emece | 25.5 |

| Aprenda PHP | Mario Molina | Emece | 26.809 |

| Cervantes y el quijo | Borges | Paidos | 45.5 |

| Matematica estas ahi | Paenza | Paidos | 50 |

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

5 rows in set (0.00 sec)

mysql> delect from libros where autor="Paenza";

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 'delec

t from libros where autor="Paenza"' at line 1

mysql> delect from libros where "Paenza";

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 'delec

t from libros where "Paenza"' at line 1

mysql> delect from libros "Paenza";

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 'delec

t from libros "Paenza"' at line 1

mysql> delete from libros "Paenza";

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 '"Paen

za"' at line 1

mysql> delete from libros where autor="Paenza";

Query OK, 1 row affected (0.00 sec)

mysql> delete from libros where autor="Paenza";

Query OK, 0 rows affected (0.00 sec)

mysql> delete from libros where precio"<20";

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 '"<20"

' at line 1

mysql> delete from libros where precio="<20";

Query OK, 0 rows affected, 4 warnings (0.01 sec)

mysql> delete from libros where precio=">=40";

Query OK, 0 rows affected, 4 warnings (0.00 sec)

mysql> drop table libros;

Query OK, 0 rows affected (0.11 sec)

mysql> drop table articulos;

Query OK, 0 rows affected (0.06 sec)

mysql> create table articulos(

-> codigo integer,

-> nombre varchar(20),

-> descripcion varchar(30),

-> precio float,

-> cantidad integer


-> );

Query OK, 0 rows affected (0.05 sec)

mysql> describe articulos;

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

| Field | Type | Null | Key | Default | Extra |

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

| codigo | int(11) | YES | | NULL | |

| nombre | varchar(20) | YES | | NULL | |

| descripcion | varchar(30) | YES | | NULL | |

| precio | float | YES | | NULL | |

| cantidad | int(11) | YES | | NULL | |

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

5 rows in set (0.09 sec)

mysql> insert into articulos (codigo, nombre, descripcion, precio,cantidad)

-> values (1,'impresora','Epson Stylus C45',400.80,20);

Query OK, 1 row affected (0.00 sec)

mysql> insert into articulos (codigo, nombre, descripcion, precio,cantidad)

-> values (2,'impresora','Epson Stylus C85',500,30);

Query OK, 1 row affected (0.00 sec)

mysql> insert into articulos (codigo, nombre, descripcion, precio,cantidad)

-> values (3,'monitor','Samsung 14',800,10);

Query OK, 1 row affected (0.00 sec)

mysql> insert into articulos (codigo, nombre, descripcion, precio,cantidad)

-> values (4,'teclado','ingles Biswal',100,50);

Query OK, 1 row affected (0.00 sec)

mysql> insert into articulos (codigo, nombre, descripcion, precio,cantidad)

-> values (5,'teclado','español Biswal',90,50);

Query OK, 1 row affected, 1 warning (0.01 sec)


mysql> select*articulos;

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 'artic

ulos' at line 1

mysql> select*articulos;

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 'artic

ulos' at line 1

mysql> select*from articulos;

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

| codigo | nombre | descripcion | precio | cantidad |

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

| 1 | impresora | Epson Stylus C45 | 400.8 | 20 |

| 2 | impresora | Epson Stylus C85 | 500 | 30 |

| 3 | monitor | Samsung 14 | 800 | 10 |

| 4 | teclado | ingles Biswal | 100 | 50 |

| 5 | teclado | espa | 90 | 50 |

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

5 rows in set (0.01 sec)

mysql> delete from articulos where precio="=>500;

"> ;

"> );

"> "=;

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 '' at

line 1

mysql> delete from articulos where precio="=>500";

Query OK, 0 rows affected, 5 warnings (0.01 sec)

mysql> delete from articulos where nombre="impresora";

Query OK, 2 rows affected (0.01 sec)


mysql> delete from articulos where codigo="<>4";

Query OK, 0 rows affected, 3 warnings (0.00 sec)

mysql> drop table usuarios;

Query OK, 0 rows affected (0.06 sec)

mysql> create table usuarios(

-> nombre varchar(30),

-> clave varchar(10)

-> );

Query OK, 0 rows affected (0.10 sec)

mysql> insert into usuarios (nombre, clave) values ('Leonardo','payaso');

Query OK, 1 row affected (0.04 sec)

mysql> insert into usuarios (nombre, clave) values ('MarioPerez','Marito');

Query OK, 1 row affected (0.00 sec)

mysql> insert into usuarios (nombre, clave) values ('Marcelo','River');

Query OK, 1 row affected (0.00 sec)

mysql> insert into usuarios

-> (nombre, clave) values ('Gustavo','River');

Query OK, 1 row affected (0.00 sec)

mysql> select * from usuarios;

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

| nombre | clave |

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

| Leonardo | payaso |

| MarioPerez | Marito |

| Marcelo | River |

| Gustavo | River |

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

mysql> update usuarios set clave='RealMadrid';

Query OK, 4 rows affected (0.01 sec)

Rows matched: 4 Changed: 4 Warnings: 0

mysql> select * from usuarios;

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

| nombre | clave |

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

| Leonardo | RealMadrid |

| MarioPerez | RealMadrid |

| Marcelo | RealMadrid |

| Gustavo | RealMadrid |

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

4 rows in set (0.01 sec)

mysql> update usuarios set clave='Boca'

-> where nombre='MarioPerez';

Query OK, 1 row affected (0.00 sec)

Rows matched: 1 Changed: 1 Warnings: 0

mysql> select nombre,clave from usuarios;

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

| nombre | clave |

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

| Leonardo | RealMadrid |

| MarioPerez | Boca |

| Marcelo | RealMadrid |

| Gustavo | RealMadrid |

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

4 rows in set (0.01 sec)

mysql> 'Gustavo' por 'GustavoGarcia':


-> update usuarios set nombre='GustavoGarcia'

-> where nombre='Gustavo';

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 ''Gust

avo' por 'GustavoGarcia':

update usuarios set nombre='GustavoGarcia'

where ' at line 1

mysql> update usuarios set nombre='GustavoGarcia'

-> where nombre='Gustavo';

Query OK, 1 row affected (0.01 sec)

Rows matched: 1 Changed: 1 Warnings: 0

mysql> update usuarios set nombre='MarceloDuarte', clave='Marce'

-> where nombre='Marcelo';

Query OK, 1 row affected (0.01 sec)

Rows matched: 1 Changed: 1 Warnings: 0

mysql> select*from usuarios;

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

| nombre | clave |

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

| Leonardo | RealMadrid |

| MarioPerez | Boca |

| MarceloDuarte | Marce |

| GustavoGarcia | RealMadrid |

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

4 rows in set (0.00 sec)

mysql>

mysql> show databases;


+--------------------+
| Database |
+--------------------+
| information_schema |
| administracion |
| mysql |
| phpmyadmin |
| test |
+--------------------+
5 rows in set (0.01 sec)

mysql> use administracion;


Database changed
mysql> drop table agenda;
ERROR 1051 (42S02): Unknown table 'agenda'
mysql> create table agenda(
-> apellido varchar(30),
-> nombre varchar(20),
-> domicilio varchar(30),
-> telefono varchar(11)
-> );
Query OK, 0 rows affected (0.04 sec)

mysql> describe agenda;


+-----------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------+-------------+------+-----+---------+-------+
| apellido | varchar(30) | YES | | NULL | |
| nombre | varchar(20) | YES | | NULL | |
| domicilio | varchar(30) | YES | | NULL | |
| telefono | varchar(11) | YES | | NULL | |
+-----------+-------------+------+-----+---------+-------+
4 rows in set (0.08 sec)

mysql> insert into agenda(apellido,nombre,domicilio,telefono) values ("Mores","A


lberto","Colon 123",4234567)
-> ;
Query OK, 1 row affected (0.01 sec)

mysql> insert into agenda(apellido,nombre,domicilio,telefono) values ("Torres","


Juan","Avellaneda 135",4458787);
Query OK, 1 row affected (0.00 sec)

mysql> insert into agenda(apellido,nombre,domicilio,telefono) values ("Lopez","M


ariana","Urquiza 333",4545454);
Query OK, 1 row affected (0.00 sec)

mysql> insert into agenda(apellido,nombre,domicilio,telefono) values ("Lopez","J


ose","Urquiza 333",4545454);
Query OK, 1 row affected (0.00 sec)

mysql> insert into agenda(apellido,nombre,domicilio,telefono) values ("Peralta",


"Susana","Gral. Paz 1234",4123456);
Query OK, 1 row affected (0.00 sec)

mysql> select*from agenda;


+----------+---------+----------------+----------+
| apellido | nombre | domicilio | telefono |
+----------+---------+----------------+----------+
| Mores | Alberto | Colon 123 | 4234567 |
| Torres | Juan | Avellaneda 135 | 4458787 |
| Lopez | Mariana | Urquiza 333 | 4545454 |
| Lopez | Jose | Urquiza 333 | 4545454 |
| Peralta | Susana | Gral. Paz 1234 | 4123456 |
+----------+---------+----------------+----------+
5 rows in set (0.00 sec)
mysql> update agenda set nombre='Juan Jose'
-> where nombre='Juan';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0

mysql> update agenda set telefono='4445566'


-> where telefono='4545454';
Query OK, 2 rows affected (0.00 sec)
Rows matched: 2 Changed: 2 Warnings: 0

mysql> update agenda set nombre='Juan Jose'


-> where nombre='Juan';
Query OK, 0 rows affected (0.00 sec)
Rows matched: 0 Changed: 0 Warnings: 0

mysql> drop table libros;


ERROR 1051 (42S02): Unknown table 'libros'
mysql> create table libros(
-> titulo varchar(20),
-> autor varchar(30),
-> editorial varchar(15)
-> precio float
-> );
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 'preci
o float
)' at line 5
mysql> create table libros(
-> titulo varchar(20),
-> autor varchar(30),
-> editorial varchar(15),
-> precio float
-> );
Query OK, 0 rows affected (0.05 sec)

mysql> describe libros;


+-----------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------+-------------+------+-----+---------+-------+
| titulo | varchar(20) | YES | | NULL | |
| autor | varchar(30) | YES | | NULL | |
| editorial | varchar(15) | YES | | NULL | |
| precio | float | YES | | NULL | |
+-----------+-------------+------+-----+---------+-------+
4 rows in set (0.09 sec)

mysql> ^V
-> drop table if exists usuarios;
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 '▬
drop table if exists usuarios' at line 1
mysql> drop table if exists usuarios;
Query OK, 0 rows affected (0.06 sec)

mysql> create table usuarios (


-> nombre varchar(20),
-> clave varchar(10),
-> primary key (nombre)
-> );
Query OK, 0 rows affected (0.03 sec)
mysql> describe usuarios;
+--------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------+-------------+------+-----+---------+-------+
| nombre | varchar(20) | NO | PRI | | |
| clave | varchar(10) | YES | | NULL | |
+--------+-------------+------+-----+---------+-------+
2 rows in set (0.10 sec)

mysql> insert into usuarios (nombre, clave) values ('Leonardo','payaso');


Query OK, 1 row affected (0.01 sec)

mysql> insert into usuarios (nombre, clave) values ('MarioPerez','Marito');


Query OK, 1 row affected (0.00 sec)

mysql> insert into usuarios (nombre, clave) values ('Marcelo','River');


Query OK, 1 row affected (0.01 sec)

mysql> insert into usuarios (nombre, clave) values ('Gustavo','River');


Query OK, 1 row affected (0.00 sec)

mysql> insert into usuarios (nombre, clave) values ('Gustavo','Boca');


ERROR 1062 (23000): Duplicate entry 'Gustavo' for key 1
mysql> drop table libros;
Query OK, 0 rows affected (0.06 sec)

mysql> select*usuarios;
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 'usuar
ios' at line 1
mysql> select*from usuarios;
+------------+--------+
| nombre | clave |
+------------+--------+
| Leonardo | payaso |
| MarioPerez | Marito |
| Marcelo | River |
| Gustavo | River |
+------------+--------+
4 rows in set (0.00 sec)

mysql> create table libros(


-> codigo integer,
-> titulo varchar(20),
-> autor varchar(30),
-> editorial varchar(15),
-> primary key(codigo)
-> );
Query OK, 0 rows affected (0.05 sec)

mysql> describe libros;


+-----------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------+-------------+------+-----+---------+-------+
| codigo | int(11) | NO | PRI | 0 | |
| titulo | varchar(20) | YES | | NULL | |
| autor | varchar(30) | YES | | NULL | |
| editorial | varchar(15) | YES | | NULL | |
+-----------+-------------+------+-----+---------+-------+
4 rows in set (0.09 sec)
mysql> insert into usuarios (codigo,titulo,autor,varchar) values ("1","El aleph"
,"Borges","Planeta");
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 'varch
ar) values ("1","El aleph","Borges","Planeta")' at line 1
mysql> insert into libros (codigo,titulo,autor,varchar) values ("1","El aleph","
Borges","Planeta");
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 'varch
ar) values ("1","El aleph","Borges","Planeta")' at line 1
mysql> insert into libros (codigo,titulo,autor,editorial) values ("1","El aleph"
,"Borges","Planeta");
Query OK, 1 row affected (0.00 sec)

mysql> insert into libros (codigo,titulo,autor,editorial) values ("2","Martin Fi


erro","Jose Hernandez","Emece");
Query OK, 1 row affected (0.00 sec)

mysql> insert into libros (codigo,titulo,autor,editorial) values ("3","Aprenda P


HP","Mario Molina","Emece");
Query OK, 1 row affected (0.01 sec)

mysql> insert into libros (codigo,titulo,autor,editorial) values ("4","Cervantes


y el quijote","Borges","Paidos");
Query OK, 1 row affected, 1 warning (0.01 sec)

mysql> insert into libros (codigo,titulo,autor,editorial) values ("5","Matematic


a estas ahi", "Paenza", "Paidos");
Query OK, 1 row affected (0.00 sec)

mysql> select*from libros;


+--------+----------------------+----------------+-----------+
| codigo | titulo | autor | editorial |
+--------+----------------------+----------------+-----------+
| 1 | El aleph | Borges | Planeta |
| 2 | Martin Fierro | Jose Hernandez | Emece |
| 3 | Aprenda PHP | Mario Molina | Emece |
| 4 | Cervantes y el quijo | Borges | Paidos |
| 5 | Matematica estas ahi | Paenza | Paidos |
+--------+----------------------+----------------+-----------+
5 rows in set (0.00 sec)

mysql> drop table clientes;


ERROR 1051 (42S02): Unknown table 'clientes'
mysql> create table clientes(
-> documento varchar(8),
-> apellido varchar(20),
-> nombre varchar(20),
-> domicilio varchar(30),
-> telefono varchar (11),
-> primary key(documento)
-> );
Query OK, 0 rows affected (0.08 sec)

mysql> describa clientes;


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 'descr
iba clientes' at line 1
mysql> descrine clientes;
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 'descr
ine clientes' at line 1
mysql> describe clientes;
+-----------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------+-------------+------+-----+---------+-------+
| documento | varchar(8) | NO | PRI | | |
| apellido | varchar(20) | YES | | NULL | |
| nombre | varchar(20) | YES | | NULL | |
| domicilio | varchar(30) | YES | | NULL | |
| telefono | varchar(11) | YES | | NULL | |
+-----------+-------------+------+-----+---------+-------+
5 rows in set (0.09 sec)

mysql> insert into clientes (documento,apellido,nombre,domicilio, telefono)


-> values('22345678','Perez','Marcos','Colon 123','4545454');
Query OK, 1 row affected (0.01 sec)

mysql> insert into clientes (documento,apellido,nombre,domicilio, telefono)


-> values('23222222','Garcia','Ana','Avellaneda 1345','4252652');
Query OK, 1 row affected (0.01 sec)

mysql> insert into clientes (documento,apellido,nombre,domicilio, telefono)


-> values('20454545','Lopez','Susana','Urquiza 344','4522525');
Query OK, 1 row affected (0.01 sec)

mysql> insert into clientes (documento,apellido,nombre,domicilio, telefono)


-> values('35454545','Lopez','Susana','Urquiza 344','4522525');
Query OK, 1 row affected (0.00 sec)

mysql> select*from clientes where cliente="


"> ;
"> );
"> ");
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 ')' at
line 1
mysql>
mysql> create table alumnos(
-> legajo varchar(4) not null,
-> documento varchar(8) not null,
-> apellido varchar(30),
-> nombre varchar(30),
-> domicilio varchar(30),
-> primary key (legajo)
-> );
Query OK, 0 rows affected (0.05 sec)

mysql>

mysql> select*usuarios;
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 'usuar
ios' at line 1
mysql> select*from usuarios;
+------------+--------+
| nombre | clave |
+------------+--------+
| Leonardo | payaso |
| MarioPerez | Marito |
| Marcelo | River |
| Gustavo | River |
+------------+--------+
4 rows in set (0.00 sec)

mysql> create table libros(


-> codigo integer,
-> titulo varchar(20),
-> autor varchar(30),
-> editorial varchar(15),
-> primary key(codigo)
-> );
Query OK, 0 rows affected (0.05 sec)

mysql> describe libros;


+-----------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------+-------------+------+-----+---------+-------+
| codigo | int(11) | NO | PRI | 0 | |
| titulo | varchar(20) | YES | | NULL | |
| autor | varchar(30) | YES | | NULL | |
| editorial | varchar(15) | YES | | NULL | |
+-----------+-------------+------+-----+---------+-------+
4 rows in set (0.09 sec)

mysql> insert into usuarios (codigo,titulo,autor,varchar) values ("1","El aleph"


,"Borges","Planeta");
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 'varch
ar) values ("1","El aleph","Borges","Planeta")' at line 1
mysql> insert into libros (codigo,titulo,autor,varchar) values ("1","El aleph","
Borges","Planeta");
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 'varch
ar) values ("1","El aleph","Borges","Planeta")' at line 1
mysql> insert into libros (codigo,titulo,autor,editorial) values ("1","El aleph"
,"Borges","Planeta");
Query OK, 1 row affected (0.00 sec)

mysql> insert into libros (codigo,titulo,autor,editorial) values ("2","Martin Fi


erro","Jose Hernandez","Emece");
Query OK, 1 row affected (0.00 sec)

mysql> insert into libros (codigo,titulo,autor,editorial) values ("3","Aprenda P


HP","Mario Molina","Emece");
Query OK, 1 row affected (0.01 sec)

mysql> insert into libros (codigo,titulo,autor,editorial) values ("4","Cervantes


y el quijote","Borges","Paidos");
Query OK, 1 row affected, 1 warning (0.01 sec)

mysql> insert into libros (codigo,titulo,autor,editorial) values ("5","Matematic


a estas ahi", "Paenza", "Paidos");
Query OK, 1 row affected (0.00 sec)

mysql> select*from libros;


+--------+----------------------+----------------+-----------+
| codigo | titulo | autor | editorial |
+--------+----------------------+----------------+-----------+
| 1 | El aleph | Borges | Planeta |
| 2 | Martin Fierro | Jose Hernandez | Emece |
| 3 | Aprenda PHP | Mario Molina | Emece |
| 4 | Cervantes y el quijo | Borges | Paidos |
| 5 | Matematica estas ahi | Paenza | Paidos |
+--------+----------------------+----------------+-----------+
5 rows in set (0.00 sec)

mysql> drop table clientes;


ERROR 1051 (42S02): Unknown table 'clientes'
mysql> create table clientes(
-> documento varchar(8),
-> apellido varchar(20),
-> nombre varchar(20),
-> domicilio varchar(30),
-> telefono varchar (11),
-> primary key(documento)
-> );
Query OK, 0 rows affected (0.08 sec)

mysql> describa clientes;


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 'descr
iba clientes' at line 1
mysql> descrine clientes;
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 'descr
ine clientes' at line 1
mysql> describe clientes;
+-----------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------+-------------+------+-----+---------+-------+
| documento | varchar(8) | NO | PRI | | |
| apellido | varchar(20) | YES | | NULL | |
| nombre | varchar(20) | YES | | NULL | |
| domicilio | varchar(30) | YES | | NULL | |
| telefono | varchar(11) | YES | | NULL | |
+-----------+-------------+------+-----+---------+-------+
5 rows in set (0.09 sec)

mysql> insert into clientes (documento,apellido,nombre,domicilio, telefono)


-> values('22345678','Perez','Marcos','Colon 123','4545454');
Query OK, 1 row affected (0.01 sec)

mysql> insert into clientes (documento,apellido,nombre,domicilio, telefono)


-> values('23222222','Garcia','Ana','Avellaneda 1345','4252652');
Query OK, 1 row affected (0.01 sec)

mysql> insert into clientes (documento,apellido,nombre,domicilio, telefono)


-> values('20454545','Lopez','Susana','Urquiza 344','4522525');
Query OK, 1 row affected (0.01 sec)

mysql> insert into clientes (documento,apellido,nombre,domicilio, telefono)


-> values('35454545','Lopez','Susana','Urquiza 344','4522525');
Query OK, 1 row affected (0.00 sec)

mysql> select*from clientes where cliente="


"> ;
"> );
"> ");
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 ')' at
line 1
mysql>
mysql> create table alumnos(
-> legajo varchar(4) not null,
-> documento varchar(8) not null,
-> apellido varchar(30),
-> nombre varchar(30),
-> domicilio varchar(30),
-> primary key (legajo)
-> );
Query OK, 0 rows affected (0.05 sec)

mysql> insert into alumnos (legajo,documento,apellido,nombre,domicilio)


-> values('A233','22345345','Perez','Mariana','Colon 234');
Query OK, 1 row affected (0.05 sec)

mysql> insert into alumnos (legajo,documento,apellido,nombre,domicilio)


-> values('A567','23545345','Morales','Marcos','Avellaneda 348');
Query OK, 1 row affected (0.00 sec)

mysql> insert into alumnos (legajo,documento,apellido,nombre,domicilio)


-> values('B654','24356345','Gonzalez','Analia','Caseros 444');
Query OK, 1 row affected (0.01 sec)

mysql> insert into alumnos (legajo,documento,apellido,nombre,domicilio)


-> values('A642','20254125','Torres','Ramiro','Dinamarca 209');
Query OK, 1 row affected (0.00 sec)

mysql> insert into alumnos (legajo,documento,apellido,nombre,domicilio)


-> values('B509','20445778','Miranda','Carmen','Uspallata 999');
Query OK, 1 row affected (0.01 sec)

mysql> insert into alumnos (legajo,documento,apellido,nombre,domicilio)


-> values('C777','28111444','Figueroa','Natalia','Sarmiento 856');
Query OK, 1 row affected (0.00 sec)

mysql> select*from alumnos;


+--------+-----------+----------+---------+----------------+
| legajo | documento | apellido | nombre | domicilio |
+--------+-----------+----------+---------+----------------+
| A233 | 22345345 | Perez | Mariana | Colon 234 |
| A567 | 23545345 | Morales | Marcos | Avellaneda 348 |
| B654 | 24356345 | Gonzalez | Analia | Caseros 444 |
| A642 | 20254125 | Torres | Ramiro | Dinamarca 209 |
| B509 | 20445778 | Miranda | Carmen | Uspallata 999 |
| C777 | 28111444 | Figueroa | Natalia | Sarmiento 856 |
+--------+-----------+----------+---------+----------------+
6 rows in set (0.00 sec)

mysql> select*from usuarios nombre,apellido legajo="<>";


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 '="<>"
' at line 1
mysql> select*from usuarios nombre,apellido legajo="<>legajo";
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 '="<>l
egajo"' at line 1
mysql> select*from alumnos nombre,apellido legajo="<>";
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 '="<>"
' at line 1
mysql> select*from usuarios nombre,apellido;
ERROR 1146 (42S02): Table 'administracion.apellido' doesn't exist
mysql> select*from Mariana,Marco from alumnos;
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
alumnos' at line 1
mysql> select*from alumnos Mariana,Marco;
ERROR 1146 (42S02): Table 'administracion.marco' doesn't exist
mysql> select*from alumnos Mariana,Marco;
ERROR 1146 (42S02): Table 'administracion.marco' doesn't exist
mysql> select*from alumnos;
+--------+-----------+----------+---------+----------------+
| legajo | documento | apellido | nombre | domicilio |
+--------+-----------+----------+---------+----------------+
| A233 | 22345345 | Perez | Mariana | Colon 234 |
| A567 | 23545345 | Morales | Marcos | Avellaneda 348 |
| B654 | 24356345 | Gonzalez | Analia | Caseros 444 |
| A642 | 20254125 | Torres | Ramiro | Dinamarca 209 |
| B509 | 20445778 | Miranda | Carmen | Uspallata 999 |
| C777 | 28111444 | Figueroa | Natalia | Sarmiento 856 |
+--------+-----------+----------+---------+----------------+
6 rows in set (0.00 sec)

mysql> drop table if exists libros;


Query OK, 0 rows affected (0.06 sec)

mysql> create table libros(


-> codigo integer auto_increment,
-> titulo varchar(20),
-> autor varchar(30),
-> editorial varchar(15),
-> primary key (codigo)
-> );
Query OK, 0 rows affected (0.05 sec)

mysql> describe libros;


+-----------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-----------+-------------+------+-----+---------+----------------+
| codigo | int(11) | NO | PRI | NULL | auto_increment |
| titulo | varchar(20) | YES | | NULL | |
| autor | varchar(30) | YES | | NULL | |
| editorial | varchar(15) | YES | | NULL | |
+-----------+-------------+------+-----+---------+----------------+
4 rows in set (0.09 sec)

mysql> insert into libros (titulo,autor,editorial)


-> values('El aleph','Borges','Planeta');
Query OK, 1 row affected (0.00 sec)

mysql> select * from libros;


+--------+----------+--------+-----------+
| codigo | titulo | autor | editorial |
+--------+----------+--------+-----------+
| 1 | El aleph | Borges | Planeta |
+--------+----------+--------+-----------+
1 row in set (0.05 sec)

mysql> insert into libros (titulo,autor,editorial)


-> values('Martin Fierro','Jose Hernandez','Emece');
Query OK, 1 row affected (0.00 sec)
mysql> insert into libros (titulo,autor,editorial)
-> values('Aprenda PHP','Mario Molina','Emece');
Query OK, 1 row affected (0.00 sec)

mysql> insert into libros (titulo,autor,editorial)


-> values('Cervantes y el quijote','Borges','Paidos');
Query OK, 1 row affected, 1 warning (0.00 sec)

mysql> insert into libros (titulo,autor,editorial)


-> values('Matematica estas ahi', 'Paenza', 'Paidos');
Query OK, 1 row affected (0.02 sec)

mysql> select codigo,titulo,autor,editorial from libros;


+--------+----------------------+----------------+-----------+
| codigo | titulo | autor | editorial |
+--------+----------------------+----------------+-----------+
| 1 | El aleph | Borges | Planeta |
| 2 | Martin Fierro | Jose Hernandez | Emece |
| 3 | Aprenda PHP | Mario Molina | Emece |
| 4 | Cervantes y el quijo | Borges | Paidos |
| 5 | Matematica estas ahi | Paenza | Paidos |
+--------+----------------------+----------------+-----------+
5 rows in set (0.00 sec)

mysql> insert into libros (codigo,titulo,autor,editorial)


-> values(6,'Martin Fierro','Jose Hernandez','Paidos');
Query OK, 1 row affected (0.00 sec)

mysql> insert into libros (codigo,titulo,autor,editorial)


-> values(2,'Martin Fierro','Jose Hernandez','Planeta');
ERROR 1062 (23000): Duplicate entry '2' for key 1
mysql> insert into libros (codigo,titulo,autor,editorial)
-> values(15,'Harry Potter y la piedra filosofal','J.K. Rowling','Emece');
Query OK, 1 row affected, 1 warning (0.00 sec)

mysql> insert into libros (titulo,autor,editorial)


-> values('Harry Potter y la camara secreta','J.K. Rowling','Emece');
Query OK, 1 row affected, 1 warning (0.00 sec)

mysql> insert into libros (codigo,titulo,autor,editorial)


-> values(0,'Alicia en el pais de las maravillas','Lewis Carroll','Planeta')
;
Query OK, 1 row affected, 1 warning (0.00 sec)

mysql> insert into libros (codigo,titulo,autor,editorial)

select * from libros;

mysql> select codigo,titulo,autor,editorial from libros;


+--------+----------------------+----------------+-----------+
| codigo | titulo | autor | editorial |
+--------+----------------------+----------------+-----------+
| 1 | El aleph | Borges | Planeta |
| 2 | Martin Fierro | Jose Hernandez | Emece |
| 3 | Aprenda PHP | Mario Molina | Emece |
| 4 | Cervantes y el quijo | Borges | Paidos |
| 5 | Matematica estas ahi | Paenza | Paidos |
+--------+----------------------+----------------+-----------+
5 rows in set (0.00 sec)
mysql> insert into libros (codigo,titulo,autor,editorial)
-> values(6,'Martin Fierro','Jose Hernandez','Paidos');
Query OK, 1 row affected (0.00 sec)

mysql> insert into libros (codigo,titulo,autor,editorial)


-> values(2,'Martin Fierro','Jose Hernandez','Planeta');
ERROR 1062 (23000): Duplicate entry '2' for key 1
mysql> insert into libros (codigo,titulo,autor,editorial)
-> values(15,'Harry Potter y la piedra filosofal','J.K. Rowling','Emece');
Query OK, 1 row affected, 1 warning (0.00 sec)

mysql> insert into libros (titulo,autor,editorial)


-> values('Harry Potter y la camara secreta','J.K. Rowling','Emece');
Query OK, 1 row affected, 1 warning (0.00 sec)

mysql> insert into libros (codigo,titulo,autor,editorial)


-> values(0,'Alicia en el pais de las maravillas','Lewis Carroll','Planeta')
;
Query OK, 1 row affected, 1 warning (0.02 sec)

mysql> insert into libros (codigo,titulo,autor,editorial) values(-5,'Alicia a tr


aves del espejo','Lewis Carroll','Planeta');
Query OK, 1 row affected, 1 warning (0.00 sec)

mysql> select * from libros;


+--------+----------------------+----------------+-----------+
| codigo | titulo | autor | editorial |
+--------+----------------------+----------------+-----------+
| 1 | El aleph | Borges | Planeta |
| 2 | Martin Fierro | Jose Hernandez | Emece |
| 3 | Aprenda PHP | Mario Molina | Emece |
| 4 | Cervantes y el quijo | Borges | Paidos |
| 5 | Matematica estas ahi | Paenza | Paidos |
| 6 | Martin Fierro | Jose Hernandez | Paidos |
| 15 | Harry Potter y la pi | J.K. Rowling | Emece |
| 16 | Harry Potter y la ca | J.K. Rowling | Emece |
| 17 | Alicia en el pais de | Lewis Carroll | Planeta |
| -5 | Alicia a traves del | Lewis Carroll | Planeta |
+--------+----------------------+----------------+-----------+
10 rows in set (0.01 sec)

mysql> drop table if exists medicamentos;


Query OK, 0 rows affected, 1 warning (0.02 sec)

mysql> create table medicamentos(


-> codigo integer auto_increment,
-> nombre varchar(20),
-> laboratorio varchar(20),
-> precio float,
-> cantidad integer,
-> primary key (codigo)
-> );
Query OK, 0 rows affected (0.06 sec)

mysql> describe medicamentos;


+-------------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------+-------------+------+-----+---------+----------------+
| codigo | int(11) | NO | PRI | NULL | auto_increment |
| nombre | varchar(20) | YES | | NULL | |
| laboratorio | varchar(20) | YES | | NULL | |
| precio | float | YES | | NULL | |
| cantidad | int(11) | YES | | NULL | |
+-------------+-------------+------+-----+---------+----------------+
5 rows in set (0.09 sec)

mysql> insert into medicamentos (nombre, laboratorio,precio,cantidad)


-> values('Sertal','Roche',5.2,100);
Query OK, 1 row affected (0.00 sec)

mysql> insert into medicamentos (nombre, laboratorio,precio,cantidad)


-> values('Buscapina','Roche',4.10,200);
Query OK, 1 row affected (0.00 sec)

mysql> insert into medicamentos (nombre, laboratorio,precio,cantidad)


-> values('Amoxidal 500','Bayer',15.60,100);
Query OK, 1 row affected (0.00 sec)

mysql> select codigo,nombre,laboratorio,precio,cantidad


-> from medicamentos;
+--------+--------------+-------------+--------+----------+
| codigo | nombre | laboratorio | precio | cantidad |
+--------+--------------+-------------+--------+----------+
| 1 | Sertal | Roche | 5.2 | 100 |
| 2 | Buscapina | Roche | 4.1 | 200 |
| 3 | Amoxidal 500 | Bayer | 15.6 | 100 |
+--------+--------------+-------------+--------+----------+
3 rows in set (0.00 sec)

mysql> insert into medicamentos (codigo,nombre, laboratorio,precio,cantidad)


-> values(12,'Paracetamol 500','Bago',1.90,200);
Query OK, 1 row affected (0.00 sec)

mysql> insert into medicamentos (nombre, laboratorio,precio,cantidad)


-> values('Bayaspirina','Bayer',2.10,150);
Query OK, 1 row affected (0.00 sec)

mysql> drop table peliculas;


Query OK, 0 rows affected (0.06 sec)

mysql> create table(


-> -codigo (entero), autoincremento,
-> -titulo (cadena de 30),
-> -actor (cadena de 20),
-> -duracion (entero),
-> -clave primaria: codigo.
-> );
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 '(
-codigo (entero), autoincremento,
-titulo (cadena de 30),
-actor (cadena de 20' at line 1
mysql> create table peliculas(
-> -codigo (entero), autoincremento,
-> -titulo (cadena de 30),
-> -actor (cadena de 20),
-> -duracion (entero),
-> -clave primaria: codigo.
-> );
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 '-codi
go (entero), autoincremento,
-titulo (cadena de 30),
-actor (cadena de 20),' at line 2
mysql> create table peliculas(
-> -codigo autoincremento,
-> titulo varchar(30),
-> actor varchar(20),
-> duracion integer,
-> clave primaria
-> );
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 '-codi
go autoincremento,
titulo varchar(30),
actor varchar(20),
duracion integer' at line 2
mysql> create table peliculas(
-> codigo autoincremento,
-> actor varchar(20),
-> duracion (entero),
-> clave primaria
-> );
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 'autoi
ncremento,
actor varchar(20),
duracion (entero),
clave primaria
)' at line 2
mysql> create table(
-> ;
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 '(' at
line 1
mysql>
mysql>
mysql> drop table if exists libros;
Query OK, 0 rows affected (0.08 sec)

mysql> create table libros(


-> codigo integer auto_increment,
-> titulo varchar(20),
-> autor varchar(30),
-> editorial varchar(15),
-> primary key (codigo)
-> );
Query OK, 0 rows affected (0.05 sec)

mysql> insert into libros (titulo,autor,editorial)


-> values('Martin Fierro','Jose Hernandez','Planeta');
Query OK, 1 row affected (0.05 sec)

mysql> insert into libros (titulo,autor,editorial)


-> values('Aprenda PHP','Mario Molina','Emece');
Query OK, 1 row affected (0.00 sec)

mysql> insert into libros (titulo,autor,editorial)


-> values('Cervantes y el quijote','Borges','Paidos');
Query OK, 1 row affected, 1 warning (0.00 sec)

mysql> insert into libros (titulo,autor,editorial)


-> values('Matematica estas ahi', 'Paenza', 'Paidos');
Query OK, 1 row affected (0.00 sec)

mysql> insert into libros (titulo,autor,editorial)


-> values('El aleph', 'Borges', 'Emece');
Query OK, 1 row affected (0.00 sec)

mysql> delete from libros;


Query OK, 5 rows affected (0.00 sec)

mysql> select * from libros;


Empty set (0.00 sec)

mysql> insert into libros (titulo,autor,editorial)


-> values('Antología poetica', 'Borges', 'Emece');
Query OK, 1 row affected, 1 warning (0.00 sec)

mysql> select * from libros;


+--------+---------+--------+-----------+
| codigo | titulo | autor | editorial |
+--------+---------+--------+-----------+
| 6 | Antolog | Borges | Emece |
+--------+---------+--------+-----------+
1 row in set (0.00 sec)

mysql> truncate table libros;


Query OK, 0 rows affected (0.08 sec)

mysql> insert into libros (titulo,autor,editorial)


-> values('Antología poetica', 'Borges', 'Emece');
Query OK, 1 row affected, 1 warning (0.05 sec)

mysql> select * from libros;


+--------+---------+--------+-----------+
| codigo | titulo | autor | editorial |
+--------+---------+--------+-----------+
| 1 | Antolog | Borges | Emece |
+--------+---------+--------+-----------+
1 row in set (0.00 sec)

mysql> drop table if exists libros;


Query OK, 0 rows affected (0.05 sec)

mysql> create table libros(


-> codigo integer auto_increment,
-> titulo varchar(20),
-> autor varchar(30),
-> editorial varchar(15),
-> primary key (codigo)
-> );
Query OK, 0 rows affected (0.05 sec)

mysql> insert into libros (titulo,autor,editorial)


-> values('Martin Fierro','Jose Hernandez','Planeta');
Query OK, 1 row affected (0.03 sec)

mysql> insert into libros (titulo,autor,editorial)


-> values('Aprenda PHP','Mario Molina','Emece');
Query OK, 1 row affected (0.00 sec)

mysql> insert into libros (titulo,autor,editorial)


-> values('Cervantes y el quijote','Borges','Paidos');
Query OK, 1 row affected, 1 warning (0.00 sec)

mysql> insert into libros (titulo,autor,editorial)


-> values('Matematica estas ahi', 'Paenza', 'Paidos');
Query OK, 1 row affected (0.00 sec)

mysql> insert into libros (titulo,autor,editorial)


-> values('El aleph', 'Borges', 'Emece');
Query OK, 1 row affected (0.00 sec)

mysql> delete from libros;


Query OK, 5 rows affected (0.00 sec)

mysql> select * from libros;


Empty set (0.00 sec)

mysql> insert into libros (titulo,autor,editorial)


-> values('Antología poetica', 'Borges', 'Emece');
Query OK, 1 row affected, 1 warning (0.02 sec)

mysql> select * from libros;


+--------+---------+--------+-----------+
| codigo | titulo | autor | editorial |
+--------+---------+--------+-----------+
| 6 | Antolog | Borges | Emece |
+--------+---------+--------+-----------+
1 row in set (0.00 sec)

mysql> truncate table libros;


Query OK, 0 rows affected (0.05 sec)

mysql> insert into libros (titulo,autor,editorial)


-> values('Antología poetica', 'Borges', 'Emece');
Query OK, 1 row affected, 1 warning (0.05 sec)

mysql> select * from libros;


+--------+---------+--------+-----------+
| codigo | titulo | autor | editorial |
+--------+---------+--------+-----------+
| 1 | Antolog | Borges | Emece |
+--------+---------+--------+-----------+
1 row in set (0.00 sec)

mysql> select * from libros;

-actor (cadena de 20),' at line 2

mysql> create table peliculas(

-> -codigo autoincremento,

-> titulo varchar(30),

-> actor varchar(20),

-> duracion integer,

-> clave primaria


-> );

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 '-codi

go autoincremento,

titulo varchar(30),

actor varchar(20),

duracion integer' at line 2

mysql> create table peliculas(

-> codigo autoincremento,

-> actor varchar(20),

-> duracion (entero),

-> clave primaria

-> );

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 'autoi

ncremento,

actor varchar(20),

duracion (entero),

clave primaria

)' at line 2

mysql> create table(

-> ;

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 '(' at

line 1

mysql>

mysql>

mysql> drop table if exists libros;

Query OK, 0 rows affected (0.08 sec)

mysql> create table libros(

-> codigo integer auto_increment,

-> titulo varchar(20),

-> autor varchar(30),


-> editorial varchar(15),

-> primary key (codigo)

-> );

Query OK, 0 rows affected (0.05 sec)

mysql> insert into libros (titulo,autor,editorial)

-> values('Martin Fierro','Jose Hernandez','Planeta');

Query OK, 1 row affected (0.05 sec)

mysql> insert into libros (titulo,autor,editorial)

-> values('Aprenda PHP','Mario Molina','Emece');

Query OK, 1 row affected (0.00 sec)

mysql> insert into libros (titulo,autor,editorial)

-> values('Cervantes y el quijote','Borges','Paidos');

Query OK, 1 row affected, 1 warning (0.00 sec)

mysql> insert into libros (titulo,autor,editorial)

-> values('Matematica estas ahi', 'Paenza', 'Paidos');

Query OK, 1 row affected (0.00 sec)

mysql> insert into libros (titulo,autor,editorial)

-> values('El aleph', 'Borges', 'Emece');

Query OK, 1 row affected (0.00 sec)

mysql> delete from libros;

Query OK, 5 rows affected (0.00 sec)

mysql> select * from libros;

Empty set (0.00 sec)

mysql> insert into libros (titulo,autor,editorial)

-> values('Antología poetica', 'Borges', 'Emece');

Query OK, 1 row affected, 1 warning (0.00 sec)


mysql> select * from libros;

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

| codigo | titulo | autor | editorial |

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

| 6 | Antolog | Borges | Emece |

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

1 row in set (0.00 sec)

mysql> truncate table libros;

Query OK, 0 rows affected (0.08 sec)

mysql> insert into libros (titulo,autor,editorial)

-> values('Antología poetica', 'Borges', 'Emece');

Query OK, 1 row affected, 1 warning (0.05 sec)

mysql> select * from libros;

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

| codigo | titulo | autor | editorial |

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

| 1 | Antolog | Borges | Emece |

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

1 row in set (0.00 sec)

mysql> drop table if exists libros;

Query OK, 0 rows affected (0.05 sec)

mysql> create table libros(

-> codigo integer auto_increment,

-> titulo varchar(20),

-> autor varchar(30),

-> editorial varchar(15),

-> primary key (codigo)

-> );
Query OK, 0 rows affected (0.05 sec)

mysql> insert into libros (titulo,autor,editorial)

-> values('Martin Fierro','Jose Hernandez','Planeta');

Query OK, 1 row affected (0.03 sec)

mysql> insert into libros (titulo,autor,editorial)

-> values('Aprenda PHP','Mario Molina','Emece');

Query OK, 1 row affected (0.00 sec)

mysql> insert into libros (titulo,autor,editorial)

-> values('Cervantes y el quijote','Borges','Paidos');

Query OK, 1 row affected, 1 warning (0.00 sec)

mysql> insert into libros (titulo,autor,editorial)

-> values('Matematica estas ahi', 'Paenza', 'Paidos');

Query OK, 1 row affected (0.00 sec)

mysql> insert into libros (titulo,autor,editorial)

-> values('El aleph', 'Borges', 'Emece');

Query OK, 1 row affected (0.00 sec)

mysql> delete from libros;

Query OK, 5 rows affected (0.00 sec)

mysql> select * from libros;

Empty set (0.00 sec)

mysql> insert into libros (titulo,autor,editorial)

-> values('Antología poetica', 'Borges', 'Emece');

Query OK, 1 row affected, 1 warning (0.02 sec)

mysql> select * from libros;

+--------+---------+--------+-----------+
| codigo | titulo | autor | editorial |

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

| 6 | Antolog | Borges | Emece |

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

1 row in set (0.00 sec)

mysql> truncate table libros;

Query OK, 0 rows affected (0.05 sec)

mysql> insert into libros (titulo,autor,editorial)

-> values('Antología poetica', 'Borges', 'Emece');

Query OK, 1 row affected, 1 warning (0.05 sec)

mysql> select * from libros;

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

| codigo | titulo | autor | editorial |

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

| 1 | Antolog | Borges | Emece |

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

1 row in set (0.00 sec)

mysql> select * from libros;

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

| codigo | titulo | autor | editorial |

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

| 1 | Antolog | Borges | Emece |

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

1 row in set (0.00 sec)

mysql> drop table if exists medicamentos;

Query OK, 0 rows affected (0.06 sec)

mysql> create table medicamentos(

-> codigo integer auto_increment,


-> nombre varchar(20),

-> laboratorio varchar(20),

-> precio float,

-> cantidad integer,

-> primary key (codigo)

-> );

Query OK, 0 rows affected (0.05 sec)

mysql> insert into medicamentos (nombre, laboratorio,precio,cantidad)

-> values('Sertal','Roche',5.2,100);

Query OK, 1 row affected (0.05 sec)

mysql> insert into medicamentos (nombre, laboratorio,precio,cantidad)

-> values('Buscapina','Roche',4.10,200);

Query OK, 1 row affected (0.02 sec)

mysql> insert into medicamentos (nombre, laboratorio,precio,cantidad)

-> values('Amoxidal 500','Bayer',15.60,100);

Query OK, 1 row affected (0.00 sec)

mysql> delete from medicamentos;

Query OK, 3 rows affected (0.01 sec)

mysql> insert into medicamentos (nombre, laboratorio,precio,cantidad)

-> values('Sertal','Roche',5.2,100);

Query OK, 1 row affected (0.00 sec)

mysql> insert into medicamentos (nombre, laboratorio,precio,cantidad)

-> values('Amoxidal 500','Bayer',15.60,100);

Query OK, 1 row affected (0.00 sec)

mysql> select * from medicamentos;

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

| codigo | nombre | laboratorio | precio | cantidad |


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

| 4 | Sertal | Roche | 5.2 | 100 |

| 5 | Amoxidal 500 | Bayer | 15.6 | 100 |

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

2 rows in set (0.02 sec)

mysql> truncate table medicamentos;

Query OK, 0 rows affected (0.09 sec)

mysql> insert into medicamentos (nombre, laboratorio,precio,cantidad)

-> values('Buscapina','Roche',4.10,200);

Query OK, 1 row affected (0.03 sec)

mysql> drop table if exists peliculas;

Query OK, 0 rows affected, 1 warning (0.02 sec)

mysql> create table peliculas(

-> codigo entero(autoincremento),

-> titulo varchar(30),

-> autor varchar(20),

-> duracion(entero),

-> clave primaria:codigo

-> );

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 'enter

o(autoincremento),

titulo varchar(30),

autor varchar(20),

duracion(entero),' at line 2

mysql> create table peliculas(

-> codigo varchar(30),

-> titulo varchar(30),

-> actor varchar(20),

-> duracion varchar(30),


-> clave primaria varchar(20)

-> );

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 'prima

ria varchar(20)

)' at line 6

mysql> );

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 ')' at

line 1

mysql> create table peliculas;

ERROR 1113 (42000): A table must have at least 1 column

mysql> insert into peliculas (titulo,actor,duracion)

-> values('Mision imposible','Tom Cruise',120);

ERROR 1146 (42S02): Table 'administracion.peliculas' doesn't exist

mysql> insert into peliculas (titulo,actor,duracion)

-> values('Harry Potter y la piedra filosofal','xxx',180);

ERROR 1146 (42S02): Table 'administracion.peliculas' doesn't exist

mysql> insert into peliculas (titulo,actor,duracion)

-> values('Harry Potter y la camara secreta','xxx',190);

ERROR 1146 (42S02): Table 'administracion.peliculas' doesn't exist

mysql> insert into peliculas (titulo,actor,duracion)

-> values('Mision imposible 2','Tom Cruise',120);

ERROR 1146 (42S02): Table 'administracion.peliculas' doesn't exist

mysql> insert into peliculas (titulo,actor,duracion)

-> values('La vida es bella','zzz',220);

ERROR 1146 (42S02): Table 'administracion.peliculas' doesn't exist

mysql> truncate table peliculas;

ERROR 1146 (42S02): Table 'administracion.peliculas' doesn't exist

mysql> drop table if exists libros;

Query OK, 0 rows affected (0.06 sec)

mysql> create table libros(

-> codigo integer auto_increment,


-> titulo varchar(20) not null,

-> autor varchar(30),

-> editorial varchar(15),

-> precio float,

-> primary key(codigo)

-> );

Query OK, 0 rows affected (0.05 sec)

mysql> describe libros;

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

| Field | Type | Null | Key | Default | Extra |

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

| codigo | int(11) | NO | PRI | NULL | auto_increment |

| titulo | varchar(20) | NO | | NULL | |

| autor | varchar(30) | YES | | NULL | |

| editorial | varchar(15) | YES | | NULL | |

| precio | float | YES | | NULL | |

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

5 rows in set (0.08 sec)

mysql>

mysql> insert into libros (titulo,autor,editorial)

-> values('El aleph', 'Borges', 'Emece');

Query OK, 1 row affected (0.00 sec)

mysql> delete from libros;

Query OK, 5 rows affected (0.00 sec)

mysql> select * from libros;

Empty set (0.00 sec)

mysql> insert into libros (titulo,autor,editorial)

-> values('Antología poetica', 'Borges', 'Emece');

Query OK, 1 row affected, 1 warning (0.02 sec)


mysql> select * from libros;

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

| codigo | titulo | autor | editorial |

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

| 6 | Antolog | Borges | Emece |

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

1 row in set (0.00 sec)

mysql> truncate table libros;

Query OK, 0 rows affected (0.05 sec)

mysql> insert into libros (titulo,autor,editorial)

-> values('Antología poetica', 'Borges', 'Emece');

Query OK, 1 row affected, 1 warning (0.05 sec)

mysql> select * from libros;

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

| codigo | titulo | autor | editorial |

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

| 1 | Antolog | Borges | Emece |

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

1 row in set (0.00 sec)

mysql> select * from libros;

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

| codigo | titulo | autor | editorial |

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

| 1 | Antolog | Borges | Emece |

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

1 row in set (0.00 sec)

mysql> drop table if exists medicamentos;

Query OK, 0 rows affected (0.06 sec)


mysql> create table medicamentos(

-> codigo integer auto_increment,

-> nombre varchar(20),

-> laboratorio varchar(20),

-> precio float,

-> cantidad integer,

-> primary key (codigo)

-> );

Query OK, 0 rows affected (0.05 sec)

mysql> insert into medicamentos (nombre, laboratorio,precio,cantidad)

-> values('Sertal','Roche',5.2,100);

Query OK, 1 row affected (0.05 sec)

mysql> insert into medicamentos (nombre, laboratorio,precio,cantidad)

-> values('Buscapina','Roche',4.10,200);

Query OK, 1 row affected (0.02 sec)

mysql> insert into medicamentos (nombre, laboratorio,precio,cantidad)

-> values('Amoxidal 500','Bayer',15.60,100);

Query OK, 1 row affected (0.00 sec)

mysql> delete from medicamentos;

Query OK, 3 rows affected (0.01 sec)

mysql> insert into medicamentos (nombre, laboratorio,precio,cantidad)

-> values('Sertal','Roche',5.2,100);

Query OK, 1 row affected (0.00 sec)

mysql> insert into medicamentos (nombre, laboratorio,precio,cantidad)

-> values('Amoxidal 500','Bayer',15.60,100);

Query OK, 1 row affected (0.00 sec)


mysql> select * from medicamentos;

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

| codigo | nombre | laboratorio | precio | cantidad |

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

| 4 | Sertal | Roche | 5.2 | 100 |

| 5 | Amoxidal 500 | Bayer | 15.6 | 100 |

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

2 rows in set (0.02 sec)

mysql> truncate table medicamentos;

Query OK, 0 rows affected (0.09 sec)

mysql> insert into medicamentos (nombre, laboratorio,precio,cantidad)

-> values('Buscapina','Roche',4.10,200);

Query OK, 1 row affected (0.03 sec)

mysql> drop table if exists peliculas;

Query OK, 0 rows affected, 1 warning (0.02 sec)

mysql> create table peliculas(

-> codigo entero(autoincremento),

-> titulo varchar(30),

-> autor varchar(20),

-> duracion(entero),

-> clave primaria:codigo

-> );

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 'enter

o(autoincremento),

titulo varchar(30),

autor varchar(20),

duracion(entero),' at line 2

mysql> create table peliculas(

-> codigo varchar(30),


-> titulo varchar(30),

-> actor varchar(20),

-> duracion varchar(30),

-> clave primaria varchar(20)

-> );

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 'prima

ria varchar(20)

)' at line 6

mysql> );

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 ')' at

line 1

mysql> create table peliculas;

ERROR 1113 (42000): A table must have at least 1 column

mysql> insert into peliculas (titulo,actor,duracion)

-> values('Mision imposible','Tom Cruise',120);

ERROR 1146 (42S02): Table 'administracion.peliculas' doesn't exist

mysql> insert into peliculas (titulo,actor,duracion)

-> values('Harry Potter y la piedra filosofal','xxx',180);

ERROR 1146 (42S02): Table 'administracion.peliculas' doesn't exist

mysql> insert into peliculas (titulo,actor,duracion)

-> values('Harry Potter y la camara secreta','xxx',190);

ERROR 1146 (42S02): Table 'administracion.peliculas' doesn't exist

mysql> insert into peliculas (titulo,actor,duracion)

-> values('Mision imposible 2','Tom Cruise',120);

ERROR 1146 (42S02): Table 'administracion.peliculas' doesn't exist

mysql> insert into peliculas (titulo,actor,duracion)

-> values('La vida es bella','zzz',220);

ERROR 1146 (42S02): Table 'administracion.peliculas' doesn't exist

mysql> truncate table peliculas;

ERROR 1146 (42S02): Table 'administracion.peliculas' doesn't exist

mysql> drop table if exists libros;

Query OK, 0 rows affected (0.06 sec)


mysql> create table libros(

-> codigo integer auto_increment,

-> titulo varchar(20) not null,

-> autor varchar(30),

-> editorial varchar(15),

-> precio float,

-> primary key(codigo)

-> );

Query OK, 0 rows affected (0.05 sec)

mysql> describe libros;

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

| Field | Type | Null | Key | Default | Extra |

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

| codigo | int(11) | NO | PRI | NULL | auto_increment |

| titulo | varchar(20) | NO | | NULL | |

| autor | varchar(30) | YES | | NULL | |

| editorial | varchar(15) | YES | | NULL | |

| precio | float | YES | | NULL | |

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

5 rows in set (0.08 sec)

mysql> insert into libros (titulo,autor,editorial,precio)

-> values('El aleph','Borges','Planeta',null);

Query OK, 1 row affected (0.00 sec)

mysql> insert into libros (titulo,autor,editorial,precio)

-> values (null,'Paenza','Paidos',10.30);

ERROR 1048 (23000): Column 'titulo' cannot be null

mysql> insert into libros (codigo,titulo,autor,editorial,precio)

-> values (null,'El quijote de la mancha', 'Cervantes Saavedra', 'Emece',25.

50);

Query OK, 1 row affected, 1 warning (0.02 sec)


mysql> insert into libros (titulo,autor,editorial,precio)

-> values ('Harry Potter y la piedra filosofal', 'J.K. Rowling',null,30.00);

Query OK, 1 row affected, 1 warning (0.00 sec)

mysql> insert into libros (titulo,autor,editorial,precio)

-> values ('Matematica estas ahi','Paenza','Paidos',0);

Query OK, 1 row affected (0.00 sec)

mysql> insert into libros (titulo,autor,editorial,precio)

-> values ('Martin Fierro','Jose Hernandez','',22.50);

Query OK, 1 row affected (0.01 sec)

mysql> select * from libros

-> where precio is null;

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

| codigo | titulo | autor | editorial | precio |

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

| 1 | El aleph | Borges | Planeta | NULL |

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

1 row in set (0.00 sec)

mysql> select * from libros

-> where precio=0;

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

| codigo | titulo | autor | editorial | precio |

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

| 4 | Matematica estas ahi | Paenza | Paidos | 0 |

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

1 row in set (0.00 sec)

mysql> select * from libros

-> where editorial is null;


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

| codigo | titulo | autor | editorial | precio |

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

| 3 | Harry Potter y la pi | J.K. Rowling | NULL | 30 |

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

1 row in set (0.00 sec)

mysql> select *from libros

-> where editorial='';

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

| codigo | titulo | autor | editorial | precio |

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

| 5 | Martin Fierro | Jose Hernandez | | 22.5 |

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

1 row in set (0.00 sec)

mysql> drop table if exists libros;

Query OK, 0 rows affected (0.09 sec)

mysql> create table libros(

-> codigo integer auto_increment,

-> titulo varchar(20) not null,

-> autor varchar(30),

-> editorial varchar(15),

-> precio float,

-> primary key(codigo)

-> );

Query OK, 0 rows affected (0.05 sec)

mysql> insert into libros (titulo,autor,editorial,precio)

-> values('El aleph','Borges','Planeta',null);

Query OK, 1 row affected (0.03 sec)

mysql> insert into libros (titulo,autor,editorial,precio)


-> values ('Matematica estas ahi','Paenza','Paidos',0);

Query OK, 1 row affected (0.00 sec)

mysql> insert into libros (titulo,autor,editorial,precio)

-> values ('Martin Fierro','Jose Hernandez','',22.50);

Query OK, 1 row affected (0.00 sec)

mysql> insert into libros (titulo,autor,editorial,precio)

-> values ('Harry Potter y la piedra filosofal', 'J.K. Rowling',null,30.00);

Query OK, 1 row affected, 1 warning (0.01 sec)

mysql> select * from libros

-> where precio is null;

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

| codigo | titulo | autor | editorial | precio |

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

| 1 | El aleph | Borges | Planeta | NULL |

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

1 row in set (0.01 sec)

mysql> select * from libros

-> where precio=0;

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

| codigo | titulo | autor | editorial | precio |

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

| 2 | Matematica estas ahi | Paenza | Paidos | 0 |

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

1 row in set (0.02 sec)

mysql> select * from libros

-> where editorial is null;

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

| codigo | titulo | autor | editorial | precio |


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

| 4 | Harry Potter y la pi | J.K. Rowling | NULL | 30 |

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

1 row in set (0.01 sec)

mysql> select *from libros

-> where editorial='';

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

| codigo | titulo | autor | editorial | precio |

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

| 3 | Martin Fierro | Jose Hernandez | | 22.5 |

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

1 row in set (0.00 sec)

mysql>

Enter password: ***

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 4

Server version: 5.0.51b-community-nt-log MySQL Community Edition (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show databases;

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

| Database |

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

| information_schema |

| administracion |

| mysql |

| phpmyadmin |

| test |

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

5 rows in set (0.00 sec)


mysql> use administracion;

Database changed

mysql> describe administracion;

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

mysql> drop table medicamentos;

Query OK, 0 rows affected (0.09 sec)

mysql> create table medicamentos(

-> codigo integer auto_increment,

-> nombre varchar(20) not null,

-> laboratorio varchar(20),

-> precio float,

-> cantidad integer not null,

-> primary key (codigo)

-> );

Query OK, 0 rows affected (0.03 sec)

mysql> insert into medicamentos (nombre,laboratorio,precio,cantidad)

-> values('Sertal gotas','Roche',5.2,100);

Query OK, 1 row affected (0.05 sec)

mysql> insert into medicamentos (nombre,laboratorio,precio,cantidad)

-> values('Sertal compuesto','Roche',7.1,150);

Query OK, 1 row affected (0.00 sec)

mysql> insert into medicamentos (nombre,laboratorio,precio,cantidad)

-> values('Buscapina','Roche',null,200);

Query OK, 1 row affected (0.00 sec)

mysql> insert into medicamentos (nombre,laboratorio,precio,cantidad)

-> values('Amoxidal 500','Bayer',15.60,0);

Query OK, 1 row affected (0.00 sec)

mysql> insert into medicamentos (nombre,laboratorio,precio,cantidad)


-> values('Amoxidal jarabe','Bayer',25,120);

Query OK, 1 row affected (0.02 sec)

mysql> insert into medicamentos (nombre,laboratorio,precio,cantidad)

-> values('Amoxinil',null,25,120);

Query OK, 1 row affected (0.00 sec)

mysql> insert into medicamentos (nombre, laboratorio,precio,cantidad)

-> values('Bayaspirina','',0,150);

Query OK, 1 row affected (0.00 sec)

mysql> select codigo from medicamentos;

+--------+

| codigo |

+--------+

| 1 |

| 2 |

| 3 |

| 4 |

| 5 |

| 6 |

| 7 |

+--------+

7 rows in set (0.00 sec)

mysql> select * from medicamentos where laboratorio is null;

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

| codigo | nombre | laboratorio | precio | cantidad |

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

| 6 | Amoxinil | NULL | 25 | 120 |

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

1 row in set (0.00 sec)

mysql>
Enter password: ***

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 4

Server version: 5.0.51b-community-nt-log MySQL Community Edition (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show databases;

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

| Database |

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

| information_schema |

| administracion |

| mysql |

| phpmyadmin |

| test |

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

5 rows in set (0.00 sec)

mysql> use administracion;

Database changed

mysql> describe administracion;

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

mysql> drop table medicamentos;

Query OK, 0 rows affected (0.09 sec)

mysql> create table medicamentos(

-> codigo integer auto_increment,

-> nombre varchar(20) not null,

-> laboratorio varchar(20),

-> precio float,

-> cantidad integer not null,

-> primary key (codigo)

-> );
Query OK, 0 rows affected (0.03 sec)

mysql> insert into medicamentos (nombre,laboratorio,precio,cantidad)

-> values('Sertal gotas','Roche',5.2,100);

Query OK, 1 row affected (0.05 sec)

mysql> insert into medicamentos (nombre,laboratorio,precio,cantidad)

-> values('Sertal compuesto','Roche',7.1,150);

Query OK, 1 row affected (0.00 sec)

mysql> insert into medicamentos (nombre,laboratorio,precio,cantidad)

-> values('Buscapina','Roche',null,200);

Query OK, 1 row affected (0.00 sec)

mysql> insert into medicamentos (nombre,laboratorio,precio,cantidad)

-> values('Amoxidal 500','Bayer',15.60,0);

Query OK, 1 row affected (0.00 sec)

mysql> insert into medicamentos (nombre,laboratorio,precio,cantidad)

-> values('Amoxidal jarabe','Bayer',25,120);

Query OK, 1 row affected (0.02 sec)

mysql> insert into medicamentos (nombre,laboratorio,precio,cantidad)

-> values('Amoxinil',null,25,120);

Query OK, 1 row affected (0.00 sec)

mysql> insert into medicamentos (nombre, laboratorio,precio,cantidad)

-> values('Bayaspirina','',0,150);

Query OK, 1 row affected (0.00 sec)

mysql> select codigo from medicamentos;

+--------+

| codigo |

+--------+
| 1 |

| 2 |

| 3 |

| 4 |

| 5 |

| 6 |

| 7 |

+--------+

7 rows in set (0.00 sec)

mysql> select * from medicamentos where laboratorio is null;

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

| codigo | nombre | laboratorio | precio | cantidad |

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

| 6 | Amoxinil | NULL | 25 | 120 |

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

1 row in set (0.00 sec)

mysql> select * from medicamentos where laboratorio='';

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

| codigo | nombre | laboratorio | precio | cantidad |

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

| 7 | Bayaspirina | | 0 | 150 |

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

1 row in set (0.00 sec)

mysql> select * from medicamentos where precio is null;

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

| codigo | nombre | laboratorio | precio | cantidad |

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

| 3 | Buscapina | Roche | NULL | 200 |

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

1 row in set (0.00 sec)


mysql> select * from medicamentos where precio=0;

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

| codigo | nombre | laboratorio | precio | cantidad |

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

| 7 | Bayaspirina | | 0 | 150 |

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

1 row in set (0.00 sec)

mysql> insert into medicamentos (nombre, laboratorio,precio,cantidad)

-> values(null,'Bayer',10.20,100);

ERROR 1048 (23000): Column 'nombre' cannot be null

mysql> insert into medicamentos (nombre, laboratorio,precio,cantidad)

-> values('Benadryl comprimidos','Bayer',10.20,null);

ERROR 1048 (23000): Column 'cantidad' cannot be null

mysql> insert into medicamentos (codigo,nombre, laboratorio,precio,cantidad)

-> values(null,'Benadryl comprimidos','Bayer',10.20,null);

ERROR 1048 (23000): Column 'cantidad' cannot be null

mysql> select * from medicamentos where precio<>0;

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

| codigo | nombre | laboratorio | precio | cantidad |

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

| 1 | Sertal gotas | Roche | 5.2 | 100 |

| 2 | Sertal compuesto | Roche | 7.1 | 150 |

| 4 | Amoxidal 500 | Bayer | 15.6 | 0 |

| 5 | Amoxidal jarabe | Bayer | 25 | 120 |

| 6 | Amoxinil | NULL | 25 | 120 |

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

5 rows in set (0.00 sec)

mysql> select * from medicamentos where precio is not null;

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

| codigo | nombre | laboratorio | precio | cantidad |

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

| 1 | Sertal gotas | Roche | 5.2 | 100 |


| 2 | Sertal compuesto | Roche | 7.1 | 150 |

| 4 | Amoxidal 500 | Bayer | 15.6 | 0 |

| 5 | Amoxidal jarabe | Bayer | 25 | 120 |

| 6 | Amoxinil | NULL | 25 | 120 |

| 7 | Bayaspirina | | 0 | 150 |

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

6 rows in set (0.01 sec)

mysql> select * from medicamentos where laboratorio is null;

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

| codigo | nombre | laboratorio | precio | cantidad |

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

| 6 | Amoxinil | NULL | 25 | 120 |

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

1 row in set (0.00 sec)

mysql> select * from medicamentos where laboratorio='';

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

| codigo | nombre | laboratorio | precio | cantidad |

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

| 7 | Bayaspirina | | 0 | 150 |

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

1 row in set (0.00 sec)

mysql> select * from medicamentos where precio is null;

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

| codigo | nombre | laboratorio | precio | cantidad |

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

| 3 | Buscapina | Roche | NULL | 200 |

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

1 row in set (0.00 sec)

mysql> select * from medicamentos where precio=0;

+--------+-------------+-------------+--------+----------+
| codigo | nombre | laboratorio | precio | cantidad |

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

| 7 | Bayaspirina | | 0 | 150 |

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

1 row in set (0.01 sec)

mysql>

Enter password: ***

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 4

Server version: 5.0.51b-community-nt-log MySQL Community Edition (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show databases;

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

| Database |

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

| information_schema |

| administracion |

| mysql |

| phpmyadmin |

| test |

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

5 rows in set (0.00 sec)

mysql> use administracion;

Database changed

mysql> describe administracion;

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

mysql> drop table medicamentos;

Query OK, 0 rows affected (0.09 sec)

mysql> create table medicamentos(


-> codigo integer auto_increment,

-> nombre varchar(20) not null,

-> laboratorio varchar(20),

-> precio float,

-> cantidad integer not null,

-> primary key (codigo)

-> );

Query OK, 0 rows affected (0.03 sec)

mysql> insert into medicamentos (nombre,laboratorio,precio,cantidad)

-> values('Sertal gotas','Roche',5.2,100);

Query OK, 1 row affected (0.05 sec)

mysql> insert into medicamentos (nombre,laboratorio,precio,cantidad)

-> values('Sertal compuesto','Roche',7.1,150);

Query OK, 1 row affected (0.00 sec)

mysql> insert into medicamentos (nombre,laboratorio,precio,cantidad)

-> values('Buscapina','Roche',null,200);

Query OK, 1 row affected (0.00 sec)

mysql> insert into medicamentos (nombre,laboratorio,precio,cantidad)

-> values('Amoxidal 500','Bayer',15.60,0);

Query OK, 1 row affected (0.00 sec)

mysql> insert into medicamentos (nombre,laboratorio,precio,cantidad)

-> values('Amoxidal jarabe','Bayer',25,120);

Query OK, 1 row affected (0.02 sec)

mysql> insert into medicamentos (nombre,laboratorio,precio,cantidad)

-> values('Amoxinil',null,25,120);

Query OK, 1 row affected (0.00 sec)

mysql> insert into medicamentos (nombre, laboratorio,precio,cantidad)


-> values('Bayaspirina','',0,150);

Query OK, 1 row affected (0.00 sec)

mysql> select codigo from medicamentos;

+--------+

| codigo |

+--------+

| 1 |

| 2 |

| 3 |

| 4 |

| 5 |

| 6 |

| 7 |

+--------+

7 rows in set (0.00 sec)

mysql> select * from medicamentos where laboratorio is null;

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

| codigo | nombre | laboratorio | precio | cantidad |

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

| 6 | Amoxinil | NULL | 25 | 120 |

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

1 row in set (0.00 sec)

mysql> select * from medicamentos where laboratorio='';

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

| codigo | nombre | laboratorio | precio | cantidad |

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

| 7 | Bayaspirina | | 0 | 150 |

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

1 row in set (0.00 sec)

mysql> select * from medicamentos where precio is null;


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

| codigo | nombre | laboratorio | precio | cantidad |

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

| 3 | Buscapina | Roche | NULL | 200 |

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

1 row in set (0.00 sec)

mysql> select * from medicamentos where precio=0;

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

| codigo | nombre | laboratorio | precio | cantidad |

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

| 7 | Bayaspirina | | 0 | 150 |

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

1 row in set (0.00 sec)

mysql> insert into medicamentos (nombre, laboratorio,precio,cantidad)

-> values(null,'Bayer',10.20,100);

ERROR 1048 (23000): Column 'nombre' cannot be null

mysql> insert into medicamentos (nombre, laboratorio,precio,cantidad)

-> values('Benadryl comprimidos','Bayer',10.20,null);

ERROR 1048 (23000): Column 'cantidad' cannot be null

mysql> insert into medicamentos (codigo,nombre, laboratorio,precio,cantidad)

-> values(null,'Benadryl comprimidos','Bayer',10.20,null);

ERROR 1048 (23000): Column 'cantidad' cannot be null

mysql> select * from medicamentos where precio<>0;

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

| codigo | nombre | laboratorio | precio | cantidad |

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

| 1 | Sertal gotas | Roche | 5.2 | 100 |

| 2 | Sertal compuesto | Roche | 7.1 | 150 |

| 4 | Amoxidal 500 | Bayer | 15.6 | 0 |

| 5 | Amoxidal jarabe | Bayer | 25 | 120 |

| 6 | Amoxinil | NULL | 25 | 120 |

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

mysql> select * from medicamentos where precio is not null;

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

| codigo | nombre | laboratorio | precio | cantidad |

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

| 1 | Sertal gotas | Roche | 5.2 | 100 |

| 2 | Sertal compuesto | Roche | 7.1 | 150 |

| 4 | Amoxidal 500 | Bayer | 15.6 | 0 |

| 5 | Amoxidal jarabe | Bayer | 25 | 120 |

| 6 | Amoxinil | NULL | 25 | 120 |

| 7 | Bayaspirina | | 0 | 150 |

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

6 rows in set (0.01 sec)

mysql> select * from medicamentos where laboratorio is null;

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

| codigo | nombre | laboratorio | precio | cantidad |

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

| 6 | Amoxinil | NULL | 25 | 120 |

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

1 row in set (0.00 sec)

mysql> select * from medicamentos where laboratorio='';

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

| codigo | nombre | laboratorio | precio | cantidad |

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

| 7 | Bayaspirina | | 0 | 150 |

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

1 row in set (0.00 sec)

mysql> select * from medicamentos where precio is null;

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

| codigo | nombre | laboratorio | precio | cantidad |


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

| 3 | Buscapina | Roche | NULL | 200 |

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

1 row in set (0.00 sec)

mysql> select * from medicamentos where precio=0;

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

| codigo | nombre | laboratorio | precio | cantidad |

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

| 7 | Bayaspirina | | 0 | 150 |

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

1 row in set (0.01 sec)

mysql> insert into medicamentos (nombre, laboratorio,precio,cantidad)

-> values(null,'Bayer',10.20,100);

ERROR 1048 (23000): Column 'nombre' cannot be null

mysql> insert into medicamentos (nombre, laboratorio,precio,cantidad)

-> values('Benadryl comprimidos','Bayer',10.20,null);

ERROR 1048 (23000): Column 'cantidad' cannot be null

mysql> insert into medicamentos (codigo,nombre, laboratorio,precio,cantidad)

-> values(null,'Benadryl comprimidos','Bayer',10.20,null);

ERROR 1048 (23000): Column 'cantidad' cannot be null

mysql> select * from medicamentos where precio<>0;

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

| codigo | nombre | laboratorio | precio | cantidad |

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

| 1 | Sertal gotas | Roche | 5.2 | 100 |

| 2 | Sertal compuesto | Roche | 7.1 | 150 |

| 4 | Amoxidal 500 | Bayer | 15.6 | 0 |

| 5 | Amoxidal jarabe | Bayer | 25 | 120 |

| 6 | Amoxinil | NULL | 25 | 120 |

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

5 rows in set (0.00 sec)


mysql> select * from medicamentos where precio is not null;

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

| codigo | nombre | laboratorio | precio | cantidad |

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

| 1 | Sertal gotas | Roche | 5.2 | 100 |

| 2 | Sertal compuesto | Roche | 7.1 | 150 |

| 4 | Amoxidal 500 | Bayer | 15.6 | 0 |

| 5 | Amoxidal jarabe | Bayer | 25 | 120 |

| 6 | Amoxinil | NULL | 25 | 120 |

| 7 | Bayaspirina | | 0 | 150 |

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

6 rows in set (0.00 sec)

mysql> select * from medicamentos where laboratorio<>'';

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

| codigo | nombre | laboratorio | precio | cantidad |

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

| 1 | Sertal gotas | Roche | 5.2 | 100 |

| 2 | Sertal compuesto | Roche | 7.1 | 150 |

| 3 | Buscapina | Roche | NULL | 200 |

| 4 | Amoxidal 500 | Bayer | 15.6 | 0 |

| 5 | Amoxidal jarabe | Bayer | 25 | 120 |

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

5 rows in set (0.00 sec)

mysql> select * from medicamentos where laboratorio is not null;

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

| codigo | nombre | laboratorio | precio | cantidad |

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

| 1 | Sertal gotas | Roche | 5.2 | 100 |

| 2 | Sertal compuesto | Roche | 7.1 | 150 |

| 3 | Buscapina | Roche | NULL | 200 |

| 4 | Amoxidal 500 | Bayer | 15.6 | 0 |

| 5 | Amoxidal jarabe | Bayer | 25 | 120 |


| 7 | Bayaspirina | | 0 | 150 |

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

6 rows in set (0.00 sec)

mysql> drop table if exists libros;

Query OK, 0 rows affected (0.03 sec)

mysql> create table libros(

-> codigo integer unsigned auto_increment,

-> titulo varchar(20) not null,

-> autor varchar(30),

-> editorial varchar(15),

-> precio float unsigned,

-> cantidad integer unsigned,

-> primary key (codigo)

-> );

Query OK, 0 rows affected (0.08 sec)

mysql> describe libros;

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

| Field | Type | Null | Key | Default | Extra |

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

| codigo | int(10) unsigned | NO | PRI | NULL | auto_increment |

| titulo | varchar(20) | NO | | NULL | |

| autor | varchar(30) | YES | | NULL | |

| editorial | varchar(15) | YES | | NULL | |

| precio | float unsigned | YES | | NULL | |

| cantidad | int(10) unsigned | YES | | NULL | |

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

6 rows in set (0.08 sec)

mysql> drop table if exists libros;

Query OK, 0 rows affected (0.06 sec)


mysql> create table libros(

-> codigo integer unsigned auto_increment,

-> titulo varchar(20) not null,

-> autor varchar(30),

-> editorial varchar(15),

-> precio float unsigned,

-> cantidad integer unsigned,

-> primary key (codigo)

-> );

Query OK, 0 rows affected (0.03 sec)

mysql> describe libros;

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

| Field | Type | Null | Key | Default | Extra |

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

| codigo | int(10) unsigned | NO | PRI | NULL | auto_increment |

| titulo | varchar(20) | NO | | NULL | |

| autor | varchar(30) | YES | | NULL | |

| editorial | varchar(15) | YES | | NULL | |

| precio | float unsigned | YES | | NULL | |

| cantidad | int(10) unsigned | YES | | NULL | |

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

6 rows in set (0.06 sec)

mysql>

Você também pode gostar