Professional Documents
Culture Documents
Actividad 5 Comandos
Bibliografía
Estos son comenados los resultados de la actividad 6:
Database changed
mysql> create table song (Id song int(10) primary key not null unique, nombre va
rchar(50), artista varchar (20), album varchar(50), genero varchar(20), año int(
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 'song
int(10) primary key not null unique, nombre varchar(50), artista varchar (2' at
line 1
mysql> create table song (Idsong int(10) primary key not null unique, nombre var
char(50), artista varchar (20), album varchar(50), genero varchar(20), año int(4
), duracion time);
mysql> insert into song values (1, "Sumpremacy", "Muse", "The 2nd Law", "Rock",
2014, "00:05:30");
mysql> insert into song values (1, "Sumpremacy", "Muse", "The 2nd Law", "Rock",
2014, "00::03:30");
ERROR 1292 (22007): Incorrect time value: '00::03:30' for column 'duracion' at r
ow 1
mysql> insert into song values (1, "Sumpremacy", "Muse", "The 2nd Law", "Rock",
2014, "00:03:30");
mysql> insert into song values (3, "Come on over", "royal blood", "careless", "R
mysql> insert into song values (4, "outside", "infantiles", "foo fighters", "Roc
mysql> insert into song values (5, "reapers", "drones", "muse", "Rock", 2015, "0
0:04:30");
mysql> insert into song values (6, "angel", "theory of a deadman", "savage", "Ro
ck", 2010, "00:02:45");
mysql> insert into song values (7, "luz control", "motion city", "luz control",
mysql> insert into song values (8, "good bye horses", "q lazzarus", "silencio de
mysql> insert into song values (9, "luciernaga", "miss cafeina", "de polvo y flo
mysql> insert into song values (10, "dream a little dream", "ella fitz gerald",
+----------+-------------+------+-----+---------+-------+
+----------+-------------+------+-----+---------+-------+
+----------+-------------+------+-----+---------+-------+
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
song' at line 1
+-----------------------+
| Tables_in_universidad |
+-----------------------+
| song |
+-----------------------+
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 'colum
n genero=rock' at line 1
+--------+----------------------+---------------------+-------------------------
--+--------+------+----------+
+--------+----------------------+---------------------+-------------------------
--+--------+------+----------+
+--------+----------------------+---------------------+-------------------------
--+--------+------+----------+
+--------+------------+--------------+-------------------+--------+------+------
----+
ion |
+--------+------------+--------------+-------------------+--------+------+------
----+
:05 |
+--------+------------+--------------+-------------------+--------+------+------
----+
+------------+--------------+
| nombre | artista |
+------------+--------------+
mysql> select nombre, artista from song where duracion >= "00:05:00";
+-----------------+--------------+
| nombre | artista |
+-----------------+--------------+
| Sumpremacy | Muse |
+-----------------+--------------+
mysql> select nombre, artista from song where nombre like "ang";
mysql> select nombre, artista from song where nombre like "angel";
+--------+---------------------+
| nombre | artista |
+--------+---------------------+
+--------+---------------------+
mysql> select nombre, artista from song where nombre like "ANGEL";
+--------+---------------------+
| nombre | artista |
+--------+---------------------+
+--------+---------------------+
mysql> select nombre, artista from song where nombre like "ang%";
+--------+---------------------+
| nombre | artista |
+--------+---------------------+
+--------+---------------------+
mysql> select nombre, artista from song where nombre like "%g%";
+-----------------+---------------------+
| nombre | artista |
+-----------------+---------------------+
| Mr.brightsde | TheKillers |
+-----------------+---------------------+
mysql> select nombre, artista from song where nombre like "A%g%";
+--------+---------------------+
| nombre | artista |
+--------+---------------------+
+--------+---------------------+
mysql>
mysql> select nombre, duracion from song where nombre="angel" and duracion>="00:
02:00";
+--------+----------+
| nombre | duracion |
+--------+----------+
| angel | 00:02:45 |
+--------+----------+
2:00";
+----------------------+----------+
| nombre | duracion |
+----------------------+----------+
| Sumpremacy | 00:05:30 |
| Mr.brightsde | 00:04:30 |
| outside | 00:03:30 |
| reapers | 00:04:30 |
| angel | 00:02:45 |
| luciernaga | 00:06:05 |
+----------------------+----------+
4:30";
+-----------------+----------+
| nombre | duracion |
+-----------------+----------+
| Sumpremacy | 00:05:30 |
| Mr.brightsde | 00:04:30 |
| reapers | 00:04:30 |
| angel | 00:02:45 |
| luz control | 00:05:25 |
| luciernaga | 00:06:05 |
+-----------------+----------+
mysql>
mysql>