Está en la página 1de 12

Setting environment for using XAMPP for Windows.

Laraa@MATISS c:\Users\Laraa\Documents\xamp
# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 8
Server version: 10.4.27-MariaDB mariadb.org binary distribution

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>
MariaDB [(none)]> use dbcinemax
Database changed
MariaDB [dbcinemax]> use dbcinemax;
Database changed
MariaDB [dbcinemax]> select * from tblpelicula;
+------------+------------------------+-----------+----------+
| pkpelicula | nombre | genero | duracion |
+------------+------------------------+-----------+----------+
| 1 | Titanic | Romantico | 01:45:00 |
| 2 | Cenicienta | Animada | 03:20:00 |
| 3 | Blanca Nieves | Animada | 01:40:00 |
| 4 | Sirenita | Animada | 01:55:00 |
| 5 | El conjuro | Terror | 02:30:00 |
| 6 | La noche del demonio | Terror | 02:55:00 |
| 7 | Camino hacia el terror | Terror | 03:15:00 |
| 8 | Aquaman | Accion | 03:20:00 |
| 9 | Venom | Accion | 03:55:00 |
| 10 | Divergent | Accion | 02:30:00 |
+------------+------------------------+-----------+----------+
10 rows in set (0.039 sec)

MariaDB [dbcinemax]> create table tblgenero (pkgenero int not null primary key
auto_increment, descripcion varchar (20) not null);
Query OK, 0 rows affected (0.021 sec)

MariaDB [dbcinemax]> show tables


-> show tables;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MariaDB server version for the right syntax to use near 'show
tables' at line 2
MariaDB [dbcinemax]> show tables;
+---------------------+
| Tables_in_dbcinemax |
+---------------------+
| tblgenero |
| tblpelicula |
| tblprueba |
+---------------------+
3 rows in set (0.011 sec)

MariaDB [dbcinemax]> insert into tblgenero(descripcion) values ("Accion");


Query OK, 1 row affected (0.013 sec)

MariaDB [dbcinemax]> describe tblpelicula;


+------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------+--------------+------+-----+---------+----------------+
| pkpelicula | int(11) | NO | PRI | NULL | auto_increment |
| nombre | varchar(200) | NO | | NULL | |
| genero | varchar(30) | NO | | NULL | |
| duracion | time | YES | | NULL | |
+------------+--------------+------+-----+---------+----------------+
4 rows in set (0.026 sec)

MariaDB [dbcinemax]> alter table tblpelicula modify column genero int;


Query OK, 10 rows affected, 10 warnings (0.039 sec)
Records: 10 Duplicates: 0 Warnings: 10

MariaDB [dbcinemax]> describe tblpelicula;


+------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------+--------------+------+-----+---------+----------------+
| pkpelicula | int(11) | NO | PRI | NULL | auto_increment |
| nombre | varchar(200) | NO | | NULL | |
| genero | int(11) | YES | | NULL | |
| duracion | time | YES | | NULL | |
+------------+--------------+------+-----+---------+----------------+
4 rows in set (0.022 sec)

MariaDB [dbcinemax]> select * from tblpelicula;


+------------+------------------------+--------+----------+
| pkpelicula | nombre | genero | duracion |
+------------+------------------------+--------+----------+
| 1 | Titanic | 0 | 01:45:00 |
| 2 | Cenicienta | 0 | 03:20:00 |
| 3 | Blanca Nieves | 0 | 01:40:00 |
| 4 | Sirenita | 0 | 01:55:00 |
| 5 | El conjuro | 0 | 02:30:00 |
| 6 | La noche del demonio | 0 | 02:55:00 |
| 7 | Camino hacia el terror | 0 | 03:15:00 |
| 8 | Aquaman | 0 | 03:20:00 |
| 9 | Venom | 0 | 03:55:00 |
| 10 | Divergent | 0 | 02:30:00 |
+------------+------------------------+--------+----------+
10 rows in set (0.000 sec)

MariaDB [dbcinemax]> select * from tblgenero;


+----------+-------------+
| pkgenero | descripcion |
+----------+-------------+
| 1 | Accion |
+----------+-------------+
1 row in set (0.000 sec)

MariaDB [dbcinemax]> update tblpelicula set genero=1;


Query OK, 10 rows affected (0.013 sec)
Rows matched: 10 Changed: 10 Warnings: 0

MariaDB [dbcinemax]> select * from tblpelicula;


+------------+------------------------+--------+----------+
| pkpelicula | nombre | genero | duracion |
+------------+------------------------+--------+----------+
| 1 | Titanic | 1 | 01:45:00 |
| 2 | Cenicienta | 1 | 03:20:00 |
| 3 | Blanca Nieves | 1 | 01:40:00 |
| 4 | Sirenita | 1 | 01:55:00 |
| 5 | El conjuro | 1 | 02:30:00 |
| 6 | La noche del demonio | 1 | 02:55:00 |
| 7 | Camino hacia el terror | 1 | 03:15:00 |
| 8 | Aquaman | 1 | 03:20:00 |
| 9 | Venom | 1 | 03:55:00 |
| 10 | Divergent | 1 | 02:30:00 |
+------------+------------------------+--------+----------+
10 rows in set (0.000 sec)

MariaDB [dbcinemax]> update tblpelicula set genero=2 where pkpelicula=5;


Query OK, 1 row affected (0.013 sec)
Rows matched: 1 Changed: 1 Warnings: 0

MariaDB [dbcinemax]> select * tblpelicula;


ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MariaDB server version for the right syntax to use near
'tblpelicula' at line 1
MariaDB [dbcinemax]> select * from tblpelicula;
+------------+------------------------+--------+----------+
| pkpelicula | nombre | genero | duracion |
+------------+------------------------+--------+----------+
| 1 | Titanic | 1 | 01:45:00 |
| 2 | Cenicienta | 1 | 03:20:00 |
| 3 | Blanca Nieves | 1 | 01:40:00 |
| 4 | Sirenita | 1 | 01:55:00 |
| 5 | El conjuro | 2 | 02:30:00 |
| 6 | La noche del demonio | 1 | 02:55:00 |
| 7 | Camino hacia el terror | 1 | 03:15:00 |
| 8 | Aquaman | 1 | 03:20:00 |
| 9 | Venom | 1 | 03:55:00 |
| 10 | Divergent | 1 | 02:30:00 |
+------------+------------------------+--------+----------+
10 rows in set (0.001 sec)

MariaDB [dbcinemax]> select * from tblgenero;


+----------+-------------+
| pkgenero | descripcion |
+----------+-------------+
| 1 | Accion |
+----------+-------------+
1 row in set (0.000 sec)

MariaDB [dbcinemax]> insert into tblgenero


-> (descripcion)
-> values
-> ('Animada');
Query OK, 1 row affected (0.012 sec)

MariaDB [dbcinemax]> select * from tblgenro;


ERROR 1146 (42S02): Table 'dbcinemax.tblgenro' doesn't exist
MariaDB [dbcinemax]> select * from tblgenero;
+----------+-------------+
| pkgenero | descripcion |
+----------+-------------+
| 1 | Accion |
| 2 | Animada |
+----------+-------------+
2 rows in set (0.000 sec)

MariaDB [dbcinemax]> insert into tblgenero


-> (descripcion)
-> values
-> ('romantica');
Query OK, 1 row affected (0.012 sec)

MariaDB [dbcinemax]> insert into tblgenero;


ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MariaDB server version for the right syntax to use near '' at
line 1
MariaDB [dbcinemax]> insert into tblgenero
-> (descripcion)
-> values
-> ('terror');
Query OK, 1 row affected (0.012 sec)

MariaDB [dbcinemax]> select * from tblgenero;


+----------+-------------+
| pkgenero | descripcion |
+----------+-------------+
| 1 | Accion |
| 2 | Animada |
| 3 | romantica |
| 4 | terror |
+----------+-------------+
4 rows in set (0.000 sec)

MariaDB [dbcinemax]> update tblpelicula set genero=1 where pkpelicula=8;


Query OK, 0 rows affected (0.000 sec)
Rows matched: 1 Changed: 0 Warnings: 0

MariaDB [dbcinemax]> select * from tblpelicula;


+------------+------------------------+--------+----------+
| pkpelicula | nombre | genero | duracion |
+------------+------------------------+--------+----------+
| 1 | Titanic | 1 | 01:45:00 |
| 2 | Cenicienta | 1 | 03:20:00 |
| 3 | Blanca Nieves | 1 | 01:40:00 |
| 4 | Sirenita | 1 | 01:55:00 |
| 5 | El conjuro | 2 | 02:30:00 |
| 6 | La noche del demonio | 1 | 02:55:00 |
| 7 | Camino hacia el terror | 1 | 03:15:00 |
| 8 | Aquaman | 1 | 03:20:00 |
| 9 | Venom | 1 | 03:55:00 |
| 10 | Divergent | 1 | 02:30:00 |
+------------+------------------------+--------+----------+
10 rows in set (0.000 sec)

MariaDB [dbcinemax]> update tblpelicula set genero=2 where pkpelicula=2;


Query OK, 1 row affected (0.012 sec)
Rows matched: 1 Changed: 1 Warnings: 0

MariaDB [dbcinemax]> select * from tblpelicula;


+------------+------------------------+--------+----------+
| pkpelicula | nombre | genero | duracion |
+------------+------------------------+--------+----------+
| 1 | Titanic | 1 | 01:45:00 |
| 2 | Cenicienta | 2 | 03:20:00 |
| 3 | Blanca Nieves | 1 | 01:40:00 |
| 4 | Sirenita | 1 | 01:55:00 |
| 5 | El conjuro | 2 | 02:30:00 |
| 6 | La noche del demonio | 1 | 02:55:00 |
| 7 | Camino hacia el terror | 1 | 03:15:00 |
| 8 | Aquaman | 1 | 03:20:00 |
| 9 | Venom | 1 | 03:55:00 |
| 10 | Divergent | 1 | 02:30:00 |
+------------+------------------------+--------+----------+
10 rows in set (0.000 sec)

MariaDB [dbcinemax]> update tblpelicula set genero=2 where pkpelicula;


Query OK, 8 rows affected (0.012 sec)
Rows matched: 10 Changed: 8 Warnings: 0

MariaDB [dbcinemax]> update tblpelicula set genero=5 where pkpelicula;


Query OK, 10 rows affected (0.039 sec)
Rows matched: 10 Changed: 10 Warnings: 0

MariaDB [dbcinemax]> select * from tblpelicula;


+------------+------------------------+--------+----------+
| pkpelicula | nombre | genero | duracion |
+------------+------------------------+--------+----------+
| 1 | Titanic | 5 | 01:45:00 |
| 2 | Cenicienta | 5 | 03:20:00 |
| 3 | Blanca Nieves | 5 | 01:40:00 |
| 4 | Sirenita | 5 | 01:55:00 |
| 5 | El conjuro | 5 | 02:30:00 |
| 6 | La noche del demonio | 5 | 02:55:00 |
| 7 | Camino hacia el terror | 5 | 03:15:00 |
| 8 | Aquaman | 5 | 03:20:00 |
| 9 | Venom | 5 | 03:55:00 |
| 10 | Divergent | 5 | 02:30:00 |
+------------+------------------------+--------+----------+
10 rows in set (0.000 sec)

MariaDB [dbcinemax]> update tblpelicula set genero=1 where pkpelicula=8;


Query OK, 1 row affected (0.013 sec)
Rows matched: 1 Changed: 1 Warnings: 0

MariaDB [dbcinemax]> update tblpelicula set genero=1 where pkpelicula=9;


Query OK, 1 row affected (0.012 sec)
Rows matched: 1 Changed: 1 Warnings: 0

MariaDB [dbcinemax]> update tblpelicula set genero=1 where pkpelicula=10;


Query OK, 1 row affected (0.012 sec)
Rows matched: 1 Changed: 1 Warnings: 0

MariaDB [dbcinemax]> select * from tblpelicula;


+------------+------------------------+--------+----------+
| pkpelicula | nombre | genero | duracion |
+------------+------------------------+--------+----------+
| 1 | Titanic | 5 | 01:45:00 |
| 2 | Cenicienta | 5 | 03:20:00 |
| 3 | Blanca Nieves | 5 | 01:40:00 |
| 4 | Sirenita | 5 | 01:55:00 |
| 5 | El conjuro | 5 | 02:30:00 |
| 6 | La noche del demonio | 5 | 02:55:00 |
| 7 | Camino hacia el terror | 5 | 03:15:00 |
| 8 | Aquaman | 1 | 03:20:00 |
| 9 | Venom | 1 | 03:55:00 |
| 10 | Divergent | 1 | 02:30:00 |
+------------+------------------------+--------+----------+
10 rows in set (0.001 sec)

MariaDB [dbcinemax]> update tblpelicula set genero=2 where pkpelicula=2;


Query OK, 1 row affected (0.012 sec)
Rows matched: 1 Changed: 1 Warnings: 0

MariaDB [dbcinemax]> update tblpelicula set genero=2 where pkpelicula=3;


Query OK, 1 row affected (0.012 sec)
Rows matched: 1 Changed: 1 Warnings: 0

MariaDB [dbcinemax]> update tblpelicula set genero=2 where pkpelicula=4;


Query OK, 1 row affected (0.012 sec)
Rows matched: 1 Changed: 1 Warnings: 0

MariaDB [dbcinemax]> update tblpelicula set genero=4 where pkpelicula=5;


Query OK, 1 row affected (0.012 sec)
Rows matched: 1 Changed: 1 Warnings: 0

MariaDB [dbcinemax]> update tblpelicula set genero=4 where pkpelicula=6;


Query OK, 1 row affected (0.012 sec)
Rows matched: 1 Changed: 1 Warnings: 0

MariaDB [dbcinemax]> update tblpelicula set genero=4 where pkpelicula=7;


Query OK, 1 row affected (0.002 sec)
Rows matched: 1 Changed: 1 Warnings: 0

MariaDB [dbcinemax]> selec * from tblpelicula;


ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MariaDB server version for the right syntax to use near 'selec
* from tblpelicula' at line 1
MariaDB [dbcinemax]> select * from tblpelicula;
+------------+------------------------+--------+----------+
| pkpelicula | nombre | genero | duracion |
+------------+------------------------+--------+----------+
| 1 | Titanic | 5 | 01:45:00 |
| 2 | Cenicienta | 2 | 03:20:00 |
| 3 | Blanca Nieves | 2 | 01:40:00 |
| 4 | Sirenita | 2 | 01:55:00 |
| 5 | El conjuro | 4 | 02:30:00 |
| 6 | La noche del demonio | 4 | 02:55:00 |
| 7 | Camino hacia el terror | 4 | 03:15:00 |
| 8 | Aquaman | 1 | 03:20:00 |
| 9 | Venom | 1 | 03:55:00 |
| 10 | Divergent | 1 | 02:30:00 |
+------------+------------------------+--------+----------+
10 rows in set (0.001 sec)

MariaDB [dbcinemax]> update tblpelicula set genero=3 where pkpelicula=1;


Query OK, 1 row affected (0.012 sec)
Rows matched: 1 Changed: 1 Warnings: 0

MariaDB [dbcinemax]> select * from tblpelicula;


+------------+------------------------+--------+----------+
| pkpelicula | nombre | genero | duracion |
+------------+------------------------+--------+----------+
| 1 | Titanic | 3 | 01:45:00 |
| 2 | Cenicienta | 2 | 03:20:00 |
| 3 | Blanca Nieves | 2 | 01:40:00 |
| 4 | Sirenita | 2 | 01:55:00 |
| 5 | El conjuro | 4 | 02:30:00 |
| 6 | La noche del demonio | 4 | 02:55:00 |
| 7 | Camino hacia el terror | 4 | 03:15:00 |
| 8 | Aquaman | 1 | 03:20:00 |
| 9 | Venom | 1 | 03:55:00 |
| 10 | Divergent | 1 | 02:30:00 |
+------------+------------------------+--------+----------+
10 rows in set (0.000 sec)

MariaDB [dbcinemax]> create table tblidiomas


-> (pkidiomas int not null auto_increment,
-> descripcion varchar (30) not null,
-> primary key (pkidiomas);
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MariaDB server version for the right syntax to use near '' at
line 4
MariaDB [dbcinemax]> create table tblidiomas
-> (pkidiomas int not null auto_increment,
-> descripcion varchar (30) not null,
-> primary key (pkidiomas));
Query OK, 0 rows affected (0.023 sec)

MariaDB [dbcinemax]> show tables;


+---------------------+
| Tables_in_dbcinemax |
+---------------------+
| tblgenero |
| tblidiomas |
| tblpelicula |
| tblprueba |
+---------------------+
4 rows in set (0.001 sec)

MariaDB [dbcinemax]> insert into tblidiomas


-> (descripcion)
-> values
-> ('ingles');
Query OK, 1 row affected (0.013 sec)

MariaDB [dbcinemax]> select * from tblidiomas;


+-----------+-------------+
| pkidiomas | descripcion |
+-----------+-------------+
| 1 | ingles |
+-----------+-------------+
1 row in set (0.001 sec)

MariaDB [dbcinemax]> insert into tblidiomas


-> (descripcion)
-> values
-> ('japones');
Query OK, 1 row affected (0.012 sec)

MariaDB [dbcinemax]> select * from tblidiomas;


+-----------+-------------+
| pkidiomas | descripcion |
+-----------+-------------+
| 1 | ingles |
| 2 | japones |
+-----------+-------------+
2 rows in set (0.000 sec)

MariaDB [dbcinemax]> insert into tbldiomas


-> (descripcion)
-> values
-> ('espaniol');
ERROR 1146 (42S02): Table 'dbcinemax.tbldiomas' doesn't exist
MariaDB [dbcinemax]> select * from tblidiomas;
+-----------+-------------+
| pkidiomas | descripcion |
+-----------+-------------+
| 1 | ingles |
| 2 | japones |
+-----------+-------------+
2 rows in set (0.000 sec)

MariaDB [dbcinemax]> insert into tblidiomas


-> (descripcion)
-> values
-> ('italiano');
Query OK, 1 row affected (0.012 sec)

MariaDB [dbcinemax]> select * from tblidiomas;


+-----------+-------------+
| pkidiomas | descripcion |
+-----------+-------------+
| 1 | ingles |
| 2 | japones |
| 3 | italiano |
+-----------+-------------+
3 rows in set (0.000 sec)

MariaDB [dbcinemax]> insert into tbldiomas


-> (descripcion)
-> values
-> ('chino');
ERROR 1146 (42S02): Table 'dbcinemax.tbldiomas' doesn't exist
MariaDB [dbcinemax]> insert into tbldiomas
-> (descripcion)
-> values
-> ('chino');
ERROR 1146 (42S02): Table 'dbcinemax.tbldiomas' doesn't exist
MariaDB [dbcinemax]> insert into tbldiomas
-> (descripcion)
-> values
-> ('castellano');
ERROR 1146 (42S02): Table 'dbcinemax.tbldiomas' doesn't exist
MariaDB [dbcinemax]> describe tblpeliculas;
ERROR 1146 (42S02): Table 'dbcinemax.tblpeliculas' doesn't exist
MariaDB [dbcinemax]> describe tblpelicula;
+------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------+--------------+------+-----+---------+----------------+
| pkpelicula | int(11) | NO | PRI | NULL | auto_increment |
| nombre | varchar(200) | NO | | NULL | |
| genero | int(11) | YES | | NULL | |
| duracion | time | YES | | NULL | |
+------------+--------------+------+-----+---------+----------------+
4 rows in set (0.018 sec)

MariaDB [dbcinemax]> alter table tblpelicula add column idioma (11);


ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MariaDB server version for the right syntax to use near '(11)'
at line 1
MariaDB [dbcinemax]> alter table tblpelicula add column idioma int(11);
Query OK, 0 rows affected (0.020 sec)
Records: 0 Duplicates: 0 Warnings: 0

MariaDB [dbcinemax]> select * from tblpelicula;


+------------+------------------------+--------+----------+--------+
| pkpelicula | nombre | genero | duracion | idioma |
+------------+------------------------+--------+----------+--------+
| 1 | Titanic | 3 | 01:45:00 | NULL |
| 2 | Cenicienta | 2 | 03:20:00 | NULL |
| 3 | Blanca Nieves | 2 | 01:40:00 | NULL |
| 4 | Sirenita | 2 | 01:55:00 | NULL |
| 5 | El conjuro | 4 | 02:30:00 | NULL |
| 6 | La noche del demonio | 4 | 02:55:00 | NULL |
| 7 | Camino hacia el terror | 4 | 03:15:00 | NULL |
| 8 | Aquaman | 1 | 03:20:00 | NULL |
| 9 | Venom | 1 | 03:55:00 | NULL |
| 10 | Divergent | 1 | 02:30:00 | NULL |
+------------+------------------------+--------+----------+--------+
10 rows in set (0.000 sec)

MariaDB [dbcinemax]> select * from tblidiomas;


+-----------+-------------+
| pkidiomas | descripcion |
+-----------+-------------+
| 1 | ingles |
| 2 | japones |
| 3 | italiano |
+-----------+-------------+
3 rows in set (0.000 sec)

MariaDB [dbcinemax]> insert into tbldiomas


-> (descripcion)
-> values
-> ('castellano');
ERROR 1146 (42S02): Table 'dbcinemax.tbldiomas' doesn't exist
MariaDB [dbcinemax]> insert into tblidiomas
-> (descripcion)
-> values
-> ('castellano');
Query OK, 1 row affected (0.012 sec)

MariaDB [dbcinemax]> selec * from tblidioma;


ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MariaDB server version for the right syntax to use near 'selec
* from tblidioma' at line 1
MariaDB [dbcinemax]> selecvt * from tblidioma;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MariaDB server version for the right syntax to use near
'selecvt * from tblidioma' at line 1
MariaDB [dbcinemax]> select * from tblidioma;
ERROR 1146 (42S02): Table 'dbcinemax.tblidioma' doesn't exist
MariaDB [dbcinemax]> select * from tblidiomas;
+-----------+-------------+
| pkidiomas | descripcion |
+-----------+-------------+
| 1 | ingles |
| 2 | japones |
| 3 | italiano |
| 4 | castellano |
+-----------+-------------+
4 rows in set (0.000 sec)

MariaDB [dbcinemax]> insert into tblidiomas


-> (descripcion)
-> values
-> ('español');
Query OK, 1 row affected, 1 warning (0.011 sec)

MariaDB [dbcinemax]> insert into tblidiomas


-> (descripcion)
-> values
-> ('latin');
Query OK, 1 row affected (0.011 sec)

MariaDB [dbcinemax]> select * from tblidiomas;


+-----------+-------------+
| pkidiomas | descripcion |
+-----------+-------------+
| 1 | ingles |
| 2 | japones |
| 3 | italiano |
| 4 | castellano |
| 5 | espa?ol |
| 6 | latin |
+-----------+-------------+
6 rows in set (0.000 sec)

MariaDB [dbcinemax]> select * from tblidioma;


ERROR 1146 (42S02): Table 'dbcinemax.tblidioma' doesn't exist
MariaDB [dbcinemax]> select * from tblpelicula;
+------------+------------------------+--------+----------+--------+
| pkpelicula | nombre | genero | duracion | idioma |
+------------+------------------------+--------+----------+--------+
| 1 | Titanic | 3 | 01:45:00 | NULL |
| 2 | Cenicienta | 2 | 03:20:00 | NULL |
| 3 | Blanca Nieves | 2 | 01:40:00 | NULL |
| 4 | Sirenita | 2 | 01:55:00 | NULL |
| 5 | El conjuro | 4 | 02:30:00 | NULL |
| 6 | La noche del demonio | 4 | 02:55:00 | NULL |
| 7 | Camino hacia el terror | 4 | 03:15:00 | NULL |
| 8 | Aquaman | 1 | 03:20:00 | NULL |
| 9 | Venom | 1 | 03:55:00 | NULL |
| 10 | Divergent | 1 | 02:30:00 | NULL |
+------------+------------------------+--------+----------+--------+
10 rows in set (0.000 sec)
MariaDB [dbcinemax]> select * from tblidiomas;
+-----------+-------------+
| pkidiomas | descripcion |
+-----------+-------------+
| 1 | ingles |
| 2 | japones |
| 3 | italiano |
| 4 | castellano |
| 5 | espa?ol |
| 6 | latin |
+-----------+-------------+
6 rows in set (0.000 sec)

MariaDB [dbcinemax]> update tblpelicula set idioma=1 where pkpelicula=1 or


pkpelicula=10;
Query OK, 2 rows affected (0.040 sec)
Rows matched: 2 Changed: 2 Warnings: 0

MariaDB [dbcinemax]> update tblpelicula set idioma=2 where pkpelicula=3 or


pkpelicula=4;
Query OK, 2 rows affected (0.011 sec)
Rows matched: 2 Changed: 2 Warnings: 0

MariaDB [dbcinemax]> update tblpelicula set idioma=4 where pkpelicula=8 or


pkpelicula=6;
Query OK, 2 rows affected (0.012 sec)
Rows matched: 2 Changed: 2 Warnings: 0

MariaDB [dbcinemax]> update tblpelicula set idioma=3 where pkpelicula=7;


Query OK, 1 row affected (0.012 sec)
Rows matched: 1 Changed: 1 Warnings: 0

MariaDB [dbcinemax]> update tblpelicula set idioma=5 where pkpelicula=2;


Query OK, 1 row affected (0.011 sec)
Rows matched: 1 Changed: 1 Warnings: 0

MariaDB [dbcinemax]> update tblpelicula set idioma=6 where pkpelicula=9 or


pkpelicula=5;
Query OK, 2 rows affected (0.012 sec)
Rows matched: 2 Changed: 2 Warnings: 0

MariaDB [dbcinemax]> select * from tblpelicula;


+------------+------------------------+--------+----------+--------+
| pkpelicula | nombre | genero | duracion | idioma |
+------------+------------------------+--------+----------+--------+
| 1 | Titanic | 3 | 01:45:00 | 1 |
| 2 | Cenicienta | 2 | 03:20:00 | 5 |
| 3 | Blanca Nieves | 2 | 01:40:00 | 2 |
| 4 | Sirenita | 2 | 01:55:00 | 2 |
| 5 | El conjuro | 4 | 02:30:00 | 6 |
| 6 | La noche del demonio | 4 | 02:55:00 | 4 |
| 7 | Camino hacia el terror | 4 | 03:15:00 | 3 |
| 8 | Aquaman | 1 | 03:20:00 | 4 |
| 9 | Venom | 1 | 03:55:00 | 6 |
| 10 | Divergent | 1 | 02:30:00 | 1 |
+------------+------------------------+--------+----------+--------+
10 rows in set (0.000 sec)

MariaDB [dbcinemax]>

También podría gustarte