MariaDB [libreria]> show tables; +--------------------+ | Tables_in_libreria | +--------------------+ | autor | | editorial | | liautedi | | libro | | materia | +--------------------+ 5 rows in set (0.039 sec) MariaDB [libreria]> describe libro; +-----------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-----------+-------------+------+-----+---------+-------+ | id_libro | varchar(10) | NO | PRI | NULL | | | Titulo | varchar(60) | NO | | NULL | | | Numpg | float | NO | | NULL | | | Precio | float | NO | | NULL | | | codigmat1 | varchar(10) | NO | MUL | NULL | | +-----------+-------------+------+-----+---------+-------+ 5 rows in set (0.037 sec) MariaDB [libreria]> select count(*) from libro; +----------+ | count(*) | +----------+ | 7 | +----------+ 1 row in set (0.065 sec) MariaDB [libreria]> select * from libro; +----------+---------------------+-------+--------+-----------+ | id_libro | Titulo | Numpg | Precio | codigmat1 | +----------+---------------------+-------+--------+-----------+ | L01 | C lculo II | 120 | 55000 | M01 | | L02 | Bd II | 150 | 65000 | M09 | | L03 | Estructura de Datos | 180 | 85000 | M03 | | L04 | Ingl‚s | 280 | 105000 | M04 | | L05 | Admon en una p gina | 70 | 7500 | M05 | | L06 | Contabiloidad I | 170 | 27500 | M06 | | L07 | Redes | 370 | 32500 | M07 | +----------+---------------------+-------+--------+-----------+ 7 rows in set (0.001 sec) MariaDB [libreria]> select count(*) 'Cantidad de libros' from libro; +--------------------+ | Cantidad de libros | +--------------------+ | 7 | +--------------------+ 1 row in set (0.044 sec) MariaDB [libreria]> select sum(precio) 'Precio de todos los libros' from libro; +----------------------------+ | Precio de todos los libros | +----------------------------+ | 377500 | +----------------------------+ 1 row in set (0.041 sec) MariaDB [libreria]> select max(precio) 'Precio m s alto de los libros' from libro; +-------------------------------+ | Precio m s alto de los libros | +-------------------------------+ | 105000 | +-------------------------------+ 1 row in set (0.002 sec) MariaDB [libreria]> select min(precio) 'Precio m s bajo de todos los libros' from libro; +-------------------------------------+ | Precio m s bajo de todos los libros | +-------------------------------------+ | 7500 | +-------------------------------------+ 1 row in set (0.000 sec) MariaDB [libreria]> select avg(precio) 'Precio promedio de todos los libros' from libro; +-------------------------------------+ | Precio promedio de todos los libros | +-------------------------------------+ | 53928.57142857143 | +-------------------------------------+ 1 row in set (0.000 sec) MariaDB [libreria]> select min(numpg) 'N£mero de p ginas del libro m s peque¤o' from libro; +-----------------------------------------+ | N£mero de p ginas del libro m s peque¤o | +-----------------------------------------+ | 70 | +-----------------------------------------+ 1 row in set (0.000 sec) MariaDB [libreria]> update libro set Titulo='Redes y comunicaciones' where id_libro='L07'; Query OK, 1 row affected (0.066 sec) Rows matched: 1 Changed: 1 Warnings: 0 MariaDB [libreria]> select * from libro; +----------+------------------------+-------+--------+-----------+ | id_libro | Titulo | Numpg | Precio | codigmat1 | +----------+------------------------+-------+--------+-----------+ | L01 | C lculo II | 120 | 55000 | M01 | | L02 | Bd II | 150 | 65000 | M09 | | L03 | Estructura de Datos | 180 | 85000 | M03 | | L04 | Ingl‚s | 280 | 105000 | M04 | | L05 | Admon en una p gina | 70 | 7500 | M05 | | L06 | Contabiloidad I | 170 | 27500 | M06 | | L07 | Redes y comunicaciones | 370 | 32500 | M07 | +----------+------------------------+-------+--------+-----------+ 7 rows in set (0.000 sec) MariaDB [libreria]> update libro set Titulo='Contabilidad I' where id_libro='L06'; Query OK, 1 row affected (0.051 sec) Rows matched: 1 Changed: 1 Warnings: 0 MariaDB [libreria]> select * from libro; +----------+------------------------+-------+--------+-----------+ | id_libro | Titulo | Numpg | Precio | codigmat1 | +----------+------------------------+-------+--------+-----------+ | L01 | C lculo II | 120 | 55000 | M01 | | L02 | Bd II | 150 | 65000 | M09 | | L03 | Estructura de Datos | 180 | 85000 | M03 | | L04 | Ingl‚s | 280 | 105000 | M04 | | L05 | Admon en una p gina | 70 | 7500 | M05 | | L06 | Contabilidad I | 170 | 27500 | M06 | | L07 | Redes y comunicaciones | 370 | 32500 | M07 | +----------+------------------------+-------+--------+-----------+ 7 rows in set (0.000 sec) MariaDB [libreria]> alter table libro add cantidad int not null after numpg; Query OK, 0 rows affected (0.087 sec) Records: 0 Duplicates: 0 Warnings: 0 MariaDB [libreria]> alter table libro add vtotal float not null after precio; Query OK, 0 rows affected (0.027 sec) Records: 0 Duplicates: 0 Warnings: 0 MariaDB [libreria]> select * from libro; +----------+------------------------+-------+----------+--------+--------+-----------+ | id_libro | Titulo | Numpg | cantidad | Precio | vtotal | codigmat1 | +----------+------------------------+-------+----------+--------+--------+-----------+ | L01 | C lculo II | 120 | 0 | 55000 | 0 | M01 | | L02 | Bd II | 150 | 0 | 65000 | 0 | M09 | | L03 | Estructura de Datos | 180 | 0 | 85000 | 0 | M03 | | L04 | Ingl‚s | 280 | 0 | 105000 | 0 | M04 | | L05 | Admon en una p gina | 70 | 0 | 7500 | 0 | M05 | | L06 | Contabilidad I | 170 | 0 | 27500 | 0 | M06 | | L07 | Redes y comunicaciones | 370 | 0 | 32500 | 0 | M07 | +----------+------------------------+-------+----------+--------+--------+-----------+ 7 rows in set (0.000 sec) MariaDB [libreria]> update libro set cantidad=5 where id_libro='L01'; Query OK, 1 row affected (0.046 sec) Rows matched: 1 Changed: 1 Warnings: 0 MariaDB [libreria]> select * from libro; +----------+------------------------+-------+----------+--------+--------+-----------+ | id_libro | Titulo | Numpg | cantidad | Precio | vtotal | codigmat1 | +----------+------------------------+-------+----------+--------+--------+-----------+ | L01 | C lculo II | 120 | 5 | 55000 | 0 | M01 | | L02 | Bd II | 150 | 0 | 65000 | 0 | M09 | | L03 | Estructura de Datos | 180 | 0 | 85000 | 0 | M03 | | L04 | Ingl‚s | 280 | 0 | 105000 | 0 | M04 | | L05 | Admon en una p gina | 70 | 0 | 7500 | 0 | M05 | | L06 | Contabilidad I | 170 | 0 | 27500 | 0 | M06 | | L07 | Redes y comunicaciones | 370 | 0 | 32500 | 0 | M07 | +----------+------------------------+-------+----------+--------+--------+-----------+ 7 rows in set (0.000 sec) MariaDB [libreria]> update libro set cantidad=10 where id_libro='L02'; Query OK, 1 row affected (0.024 sec) Rows matched: 1 Changed: 1 Warnings: 0 MariaDB [libreria]> update libro set cantidad=15 where id_libro='L03'; Query OK, 1 row affected (0.049 sec) Rows matched: 1 Changed: 1 Warnings: 0 MariaDB [libreria]> update libro set cantidad=20 where id_libro='L04'; Query OK, 1 row affected (0.038 sec) Rows matched: 1 Changed: 1 Warnings: 0 MariaDB [libreria]> update libro set cantidad=25 where id_libro='L05'; Query OK, 1 row affected (0.026 sec) Rows matched: 1 Changed: 1 Warnings: 0 MariaDB [libreria]> update libro set cantidad=30 where id_libro='L06'; Query OK, 1 row affected (0.025 sec) Rows matched: 1 Changed: 1 Warnings: 0 MariaDB [libreria]> update libro set cantidad=35 where id_libro='L07'; Query OK, 1 row affected (0.047 sec) Rows matched: 1 Changed: 1 Warnings: 0 MariaDB [libreria]> update libro set cantidad=35 where id_libro='L08'; Query OK, 0 rows affected (0.000 sec) Rows matched: 0 Changed: 0 Warnings: 0 MariaDB [libreria]> select * from libro; +----------+------------------------+-------+----------+--------+--------+-----------+ | id_libro | Titulo | Numpg | cantidad | Precio | vtotal | codigmat1 | +----------+------------------------+-------+----------+--------+--------+-----------+ | L01 | C lculo II | 120 | 5 | 55000 | 0 | M01 | | L02 | Bd II | 150 | 10 | 65000 | 0 | M09 | | L03 | Estructura de Datos | 180 | 15 | 85000 | 0 | M03 | | L04 | Ingl‚s | 280 | 20 | 105000 | 0 | M04 | | L05 | Admon en una p gina | 70 | 25 | 7500 | 0 | M05 | | L06 | Contabilidad I | 170 | 30 | 27500 | 0 | M06 | | L07 | Redes y comunicaciones | 370 | 35 | 32500 | 0 | M07 | +----------+------------------------+-------+----------+--------+--------+-----------+ 7 rows in set (0.000 sec) MariaDB [libreria]> update libro set vtotal=cantidad*precio where id_libro='L01'; Query OK, 1 row affected (0.035 sec) Rows matched: 1 Changed: 1 Warnings: 0 MariaDB [libreria]> select * from libro; +----------+------------------------+-------+----------+--------+--------+-----------+ | id_libro | Titulo | Numpg | cantidad | Precio | vtotal | codigmat1 | +----------+------------------------+-------+----------+--------+--------+-----------+ | L01 | C lculo II | 120 | 5 | 55000 | 275000 | M01 | | L02 | Bd II | 150 | 10 | 65000 | 0 | M09 | | L03 | Estructura de Datos | 180 | 15 | 85000 | 0 | M03 | | L04 | Ingl‚s | 280 | 20 | 105000 | 0 | M04 | | L05 | Admon en una p gina | 70 | 25 | 7500 | 0 | M05 | | L06 | Contabilidad I | 170 | 30 | 27500 | 0 | M06 | | L07 | Redes y comunicaciones | 370 | 35 | 32500 | 0 | M07 | +----------+------------------------+-------+----------+--------+--------+-----------+ 7 rows in set (0.000 sec) MariaDB [libreria]> update libro set vtotal=cantidad*precio where id_libro='L02'; Query OK, 1 row affected (0.050 sec) Rows matched: 1 Changed: 1 Warnings: 0 MariaDB [libreria]> update libro set vtotal=cantidad*precio where id_libro='L03'; Query OK, 1 row affected (0.044 sec) Rows matched: 1 Changed: 1 Warnings: 0 MariaDB [libreria]> update libro set vtotal=cantidad*precio where id_libro='L04'; Query OK, 1 row affected (0.004 sec) Rows matched: 1 Changed: 1 Warnings: 0 MariaDB [libreria]> update libro set vtotal=cantidad*precio where id_libro='L05'; Query OK, 1 row affected (0.004 sec) Rows matched: 1 Changed: 1 Warnings: 0 MariaDB [libreria]> update libro set vtotal=cantidad*precio where id_libro='L06'; Query OK, 1 row affected (0.064 sec) Rows matched: 1 Changed: 1 Warnings: 0 MariaDB [libreria]> update libro set vtotal=cantidad*precio where id_libro='L07'; Query OK, 1 row affected (0.064 sec) Rows matched: 1 Changed: 1 Warnings: 0 MariaDB [libreria]> select * from libro; +----------+------------------------+-------+----------+--------+---------+-----------+ | id_libro | Titulo | Numpg | cantidad | Precio | vtotal | codigmat1 | +----------+------------------------+-------+----------+--------+---------+-----------+ | L01 | C lculo II | 120 | 5 | 55000 | 275000 | M01 | | L02 | Bd II | 150 | 10 | 65000 | 650000 | M09 | | L03 | Estructura de Datos | 180 | 15 | 85000 | 1275000 | M03 | | L04 | Ingl‚s | 280 | 20 | 105000 | 2100000 | M04 | | L05 | Admon en una p gina | 70 | 25 | 7500 | 187500 | M05 | | L06 | Contabilidad I | 170 | 30 | 27500 | 825000 | M06 | | L07 | Redes y comunicaciones | 370 | 35 | 32500 | 1137500 | M07 | +----------+------------------------+-------+----------+--------+---------+-----------+ 7 rows in set (0.000 sec) MariaDB [libreria]> delete from libro where id_libro='07' -> ; Query OK, 0 rows affected (0.002 sec) MariaDB [libreria]> selec * from libro; 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 libro' at line 1 MariaDB [libreria]> selec * from libro -> ; 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 libro' at line 1 MariaDB [libreria]> select * from libro -> ; +----------+------------------------+-------+----------+--------+---------+-----------+ | id_libro | Titulo | Numpg | cantidad | Precio | vtotal | codigmat1 | +----------+------------------------+-------+----------+--------+---------+-----------+ | L01 | C lculo II | 120 | 5 | 55000 | 275000 | M01 | | L02 | Bd II | 150 | 10 | 65000 | 650000 | M09 | | L03 | Estructura de Datos | 180 | 15 | 85000 | 1275000 | M03 | | L04 | Ingl‚s | 280 | 20 | 105000 | 2100000 | M04 | | L05 | Admon en una p gina | 70 | 25 | 7500 | 187500 | M05 | | L06 | Contabilidad I | 170 | 30 | 27500 | 825000 | M06 | | L07 | Redes y comunicaciones | 370 | 35 | 32500 | 1137500 | M07 | +----------+------------------------+-------+----------+--------+---------+-----------+ 7 rows in set (0.000 sec) MariaDB [libreria]> delete from libro where id_libro='L07': -> ; 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 [libreria]> delete from libro where id_libro='L07'; Query OK, 1 row affected (0.046 sec) MariaDB [libreria]> select * from libro; +----------+---------------------+-------+----------+--------+---------+-----------+ | id_libro | Titulo | Numpg | cantidad | Precio | vtotal | codigmat1 | +----------+---------------------+-------+----------+--------+---------+-----------+ | L01 | C lculo II | 120 | 5 | 55000 | 275000 | M01 | | L02 | Bd II | 150 | 10 | 65000 | 650000 | M09 | | L03 | Estructura de Datos | 180 | 15 | 85000 | 1275000 | M03 | | L04 | Ingl‚s | 280 | 20 | 105000 | 2100000 | M04 | | L05 | Admon en una p gina | 70 | 25 | 7500 | 187500 | M05 | | L06 | Contabilidad I | 170 | 30 | 27500 | 825000 | M06 | +----------+---------------------+-------+----------+--------+---------+-----------+ 6 rows in set (0.000 sec) MariaDB [libreria]> select * from libro order by titulo; +----------+---------------------+-------+----------+--------+---------+-----------+ | id_libro | Titulo | Numpg | cantidad | Precio | vtotal | codigmat1 | +----------+---------------------+-------+----------+--------+---------+-----------+ | L05 | Admon en una p gina | 70 | 25 | 7500 | 187500 | M05 | | L02 | Bd II | 150 | 10 | 65000 | 650000 | M09 | | L01 | C lculo II | 120 | 5 | 55000 | 275000 | M01 | | L06 | Contabilidad I | 170 | 30 | 27500 | 825000 | M06 | | L03 | Estructura de Datos | 180 | 15 | 85000 | 1275000 | M03 | | L04 | Ingl‚s | 280 | 20 | 105000 | 2100000 | M04 | +----------+---------------------+-------+----------+--------+---------+-----------+ 6 rows in set (0.002 sec) MariaDB [libreria]> select * from libro order by titulo as; 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 'as' at line 1 MariaDB [libreria]> select * from libro order by titulo asc; +----------+---------------------+-------+----------+--------+---------+-----------+ | id_libro | Titulo | Numpg | cantidad | Precio | vtotal | codigmat1 | +----------+---------------------+-------+----------+--------+---------+-----------+ | L05 | Admon en una p gina | 70 | 25 | 7500 | 187500 | M05 | | L02 | Bd II | 150 | 10 | 65000 | 650000 | M09 | | L01 | C lculo II | 120 | 5 | 55000 | 275000 | M01 | | L06 | Contabilidad I | 170 | 30 | 27500 | 825000 | M06 | | L03 | Estructura de Datos | 180 | 15 | 85000 | 1275000 | M03 | | L04 | Ingl‚s | 280 | 20 | 105000 | 2100000 | M04 | +----------+---------------------+-------+----------+--------+---------+-----------+ 6 rows in set (0.000 sec) MariaDB [libreria]> select * from libro order by titulo desc; +----------+---------------------+-------+----------+--------+---------+-----------+ | id_libro | Titulo | Numpg | cantidad | Precio | vtotal | codigmat1 | +----------+---------------------+-------+----------+--------+---------+-----------+ | L04 | Ingl‚s | 280 | 20 | 105000 | 2100000 | M04 | | L03 | Estructura de Datos | 180 | 15 | 85000 | 1275000 | M03 | | L06 | Contabilidad I | 170 | 30 | 27500 | 825000 | M06 | | L01 | C lculo II | 120 | 5 | 55000 | 275000 | M01 | | L02 | Bd II | 150 | 10 | 65000 | 650000 | M09 | | L05 | Admon en una p gina | 70 | 25 | 7500 | 187500 | M05 | +----------+---------------------+-------+----------+--------+---------+-----------+ 6 rows in set (0.000 sec) MariaDB [libreria]> select * from libro; +----------+---------------------+-------+----------+--------+---------+-----------+ | id_libro | Titulo | Numpg | cantidad | Precio | vtotal | codigmat1 | +----------+---------------------+-------+----------+--------+---------+-----------+ | L01 | C lculo II | 120 | 5 | 55000 | 275000 | M01 | | L02 | Bd II | 150 | 10 | 65000 | 650000 | M09 | | L03 | Estructura de Datos | 180 | 15 | 85000 | 1275000 | M03 | | L04 | Ingl‚s | 280 | 20 | 105000 | 2100000 | M04 | | L05 | Admon en una p gina | 70 | 25 | 7500 | 187500 | M05 | | L06 | Contabilidad I | 170 | 30 | 27500 | 825000 | M06 | +----------+---------------------+-------+----------+--------+---------+-----------+ 6 rows in set (0.000 sec) MariaDB [libreria]> select * from libro order by titulo asc; +----------+---------------------+-------+----------+--------+---------+-----------+ | id_libro | Titulo | Numpg | cantidad | Precio | vtotal | codigmat1 | +----------+---------------------+-------+----------+--------+---------+-----------+ | L05 | Admon en una p gina | 70 | 25 | 7500 | 187500 | M05 | | L02 | Bd II | 150 | 10 | 65000 | 650000 | M09 | | L01 | C lculo II | 120 | 5 | 55000 | 275000 | M01 | | L06 | Contabilidad I | 170 | 30 | 27500 | 825000 | M06 | | L03 | Estructura de Datos | 180 | 15 | 85000 | 1275000 | M03 | | L04 | Ingl‚s | 280 | 20 | 105000 | 2100000 | M04 | +----------+---------------------+-------+----------+--------+---------+-----------+ 6 rows in set (0.000 sec) MariaDB [libreria]> select * from libro order by numpg asc; +----------+---------------------+-------+----------+--------+---------+-----------+ | id_libro | Titulo | Numpg | cantidad | Precio | vtotal | codigmat1 | +----------+---------------------+-------+----------+--------+---------+-----------+ | L05 | Admon en una p gina | 70 | 25 | 7500 | 187500 | M05 | | L01 | C lculo II | 120 | 5 | 55000 | 275000 | M01 | | L02 | Bd II | 150 | 10 | 65000 | 650000 | M09 | | L06 | Contabilidad I | 170 | 30 | 27500 | 825000 | M06 | | L03 | Estructura de Datos | 180 | 15 | 85000 | 1275000 | M03 | | L04 | Ingl‚s | 280 | 20 | 105000 | 2100000 | M04 | +----------+---------------------+-------+----------+--------+---------+-----------+ 6 rows in set (0.000 sec) MariaDB [libreria]> select * from libro order by numpg desc; +----------+---------------------+-------+----------+--------+---------+-----------+ | id_libro | Titulo | Numpg | cantidad | Precio | vtotal | codigmat1 | +----------+---------------------+-------+----------+--------+---------+-----------+ | L04 | Ingl‚s | 280 | 20 | 105000 | 2100000 | M04 | | L03 | Estructura de Datos | 180 | 15 | 85000 | 1275000 | M03 | | L06 | Contabilidad I | 170 | 30 | 27500 | 825000 | M06 | | L02 | Bd II | 150 | 10 | 65000 | 650000 | M09 | | L01 | C lculo II | 120 | 5 | 55000 | 275000 | M01 | | L05 | Admon en una p gina | 70 | 25 | 7500 | 187500 | M05 | +----------+---------------------+-------+----------+--------+---------+-----------+ 6 rows in set (0.000 sec) MariaDB [libreria]> select * from libro inner join liautedi on libro.id_libro=liautedi.id_libro1 inner join autor on liautedi.cod_aut1=autor.cod_aut; ERROR 1054 (42S22): Unknown column 'liautedi.cod_aut1' in 'on clause' MariaDB [libreria]> describe liautedi; +-----------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-----------+-------------+------+-----+---------+-------+ | id_libro1 | varchar(10) | NO | MUL | NULL | | | codaut1 | varchar(10) | NO | MUL | NULL | | | codedit1 | varchar(10) | NO | MUL | NULL | | +-----------+-------------+------+-----+---------+-------+ 3 rows in set (0.060 sec) MariaDB [libreria]> select * from libro inner join liautedi on libro.id_libro=liautedi.id_libro1 inner join autor on liautedi.codaut1=autor.codaut; +----------+----------------+-------+----------+--------+---------+-----------+-----------+---------+----------+--------+---------------------+ | id_libro | Titulo | Numpg | cantidad | Precio | vtotal | codigmat1 | id_libro1 | codaut1 | codedit1 | codaut | Nombre | +----------+----------------+-------+----------+--------+---------+-----------+-----------+---------+----------+--------+---------------------+ | L02 | Bd II | 150 | 10 | 65000 | 650000 | M09 | L02 | A01 | E01 | A01 | Luis Joyanes | | L02 | Bd II | 150 | 10 | 65000 | 650000 | M09 | L02 | A05 | E03 | A05 | Robert Lorber | | L06 | Contabilidad I | 170 | 30 | 27500 | 825000 | M06 | L06 | A02 | E02 | A02 | Jorge Vaquez Posada | | L04 | Ingl‚s | 280 | 20 | 105000 | 2100000 | M04 | L04 | A04 | E01 | A04 | Riaz Khadem | | L04 | Ingl‚s | 280 | 20 | 105000 | 2100000 | M04 | L04 | A04 | E02 | A04 | Riaz Khadem | | L04 | Ingl‚s | 280 | 20 | 105000 | 2100000 | M04 | L04 | A04 | E03 | A04 | Riaz Khadem | +----------+----------------+-------+----------+--------+---------+-----------+-----------+---------+----------+--------+---------------------+ 6 rows in set (0.049 sec) MariaDB [libreria]> select libro.id_libro,libro.titulo,autor.codaut,autor.nombre from libro inner join liautedi on libro.id_libro=liautedi.id_libro1 inner join autor on liautedi.codaut1=autor.codaut; +----------+----------------+--------+---------------------+ | id_libro | titulo | codaut | nombre | +----------+----------------+--------+---------------------+ | L02 | Bd II | A01 | Luis Joyanes | | L02 | Bd II | A05 | Robert Lorber | | L06 | Contabilidad I | A02 | Jorge Vaquez Posada | | L04 | Ingl‚s | A04 | Riaz Khadem | | L04 | Ingl‚s | A04 | Riaz Khadem | | L04 | Ingl‚s | A04 | Riaz Khadem | +----------+----------------+--------+---------------------+ 6 rows in set (0.001 sec) MariaDB [libreria]> select distinct libro.id_libro,libro.titulo,autor.codaut,autor.nombre from libro inner join liautedi on libro.id_libro=liautedi.id_libro1 inner join autor on liautedi.codaut1=autor.codaut; +----------+----------------+--------+---------------------+ | id_libro | titulo | codaut | nombre | +----------+----------------+--------+---------------------+ | L02 | Bd II | A01 | Luis Joyanes | | L02 | Bd II | A05 | Robert Lorber | | L06 | Contabilidad I | A02 | Jorge Vaquez Posada | | L04 | Ingl‚s | A04 | Riaz Khadem | +----------+----------------+--------+---------------------+ 4 rows in set (0.001 sec) MariaDB [libreria]> exit