A) Listar libros MariaDB [libreria1]> select *from libro; +---------+---------------------+-----------+--------+-----------+ | idlibro | descripcion | nropagina | precio | codigomat | +---------+---------------------+-----------+--------+-----------+ | L01 | Calculo II | 120 | 55000 | M01 | | L02 | BD II | 150 | 65000 | M09 | | L03 | Estructura de datos | 180 | 85000 | M03 | | L04 | Ingles | 280 | 105000 | M04 | | L05 | Admon en una pagina | 70 | 7500 | M05 | | L06 | Contabilidad I | 170 | 27500 | M06 | | L07 | Redes | 370 | 32500 | M07 | | L08 | Diagramacion | 85 | 45000 | M08 | +---------+---------------------+-----------+--------+-----------+ 8 rows in set (0.00 sec) B) Listar autores MariaDB [libreria1]> select *from autor; +----------+----------------------+ | codautor | nombre | +----------+----------------------+ | A01 | Luis Joyanes | | A02 | Jorge Vasquez Posada | | A03 | Jhon Soars | | A04 | Riaz Khadem | | A05 | Robert Lorber | | A06 | Mario Dream | +----------+----------------------+ 6 rows in set (0.00 sec) C) Listar editoriales select *from editorial; +---------+--------------+ | codedit | nombre | +---------+--------------+ | E01 | Oveja negra | | E02 | Norma | | E03 | Mc Graw Hill | +---------+--------------+ 3 rows in set (0.00 sec) D) Listar materias MariaDB [libreria1]> select *from materia; +-----------+---------------------+ | codigomat | nombre | +-----------+---------------------+ | M01 | Calculo | | M02 | Matematicas | | M03 | Estructura de datos | | M04 | Ingl | | M05 | Sistemas de inf. | | M06 | Contabilidad | | M07 | Redes | | M08 | Diagramacion | | M09 | Base de datos | +-----------+---------------------+ 9 rows in set (0.00 sec) Cambiar titulo por descripcion MariaDB [libreria1]> alter table libro change titulo descripcion char(50) not null; Query OK, 0 rows affected (0.10 sec) Records: 0 Duplicates: 0 Warnings: 0 E) select descripcion, precio from libro; +---------------------+--------+ | descripcion | precio | +---------------------+--------+ | Calculo II | 55000 | | BD II | 65000 | | Estructura de datos | 85000 | | Ingles | 105000 | | Admon en una pagina | 7500 | | Contabilidad I | 27500 | | Redes | 32500 | | Diagramacion | 45000 | +---------------------+--------+ 8 rows in set (0.00 sec) F) Cambiar nombre tabla materia por asignatura MariaDB [libreria1]> alter table materia rename to asignatura; Query OK, 0 rows affected (0.20 sec) G) Consultas con like y condiciones MariaDB [libreria1]> select *from libro where descripcion like 'a%'; +---------+---------------------+-----------+--------+-----------+ | idlibro | descripcion | nropagina | precio | codigomat | +---------+---------------------+-----------+--------+-----------+ | L05 | Admon en una pagina | 70 | 7500 | M05 | +---------+---------------------+-----------+--------+-----------+ 1 row in set (0.05 sec) MariaDB [libreria1]> select precio,descripcion,idlibro from libro where descripcion like '%a%'; +--------+---------------------+---------+ | precio | descripcion | idlibro | +--------+---------------------+---------+ | 55000 | Calculo II | L01 | | 85000 | Estructura de datos | L03 | | 7500 | Admon en una pagina | L05 | | 27500 | Contabilidad I | L06 | | 45000 | Diagramacion | L08 | +--------+---------------------+---------+ 5 rows in set (0.00 sec) MariaDB [libreria1]> select *from asignatura where nombre like '%a%'; +-----------+---------------------+ | codigomat | nombre | +-----------+---------------------+ | M01 | Calculo | | M02 | Matematicas | | M03 | Estructura de datos | | M05 | Sistemas de inf. | | M06 | Contabilidad | | M08 | Diagramacion | | M09 | Base de datos | +-----------+---------------------+ 7 rows in set (0.00 sec) MariaDB [libreria1]> select *from autor where nombre like '%a'; +----------+----------------------+ | codautor | nombre | +----------+----------------------+ | A02 | Jorge Vasquez Posada | +----------+----------------------+ 1 row in set (0.00 sec) MariaDB [libreria1]> select *from asignatura where nombre like '%a'; Empty set (0.00 sec) H) Calculos (?) Creo que esta parte no la hemos visto MariaDB [libreria1]> select descripcion, precio from libro where precio>20000; +---------------------+--------+ | descripcion | precio | +---------------------+--------+ | Calculo II | 55000 | | BD II | 65000 | | Estructura de datos | 85000 | | Ingles | 105000 | | Contabilidad I | 27500 | | Redes | 32500 | | Diagramacion | 45000 | +---------------------+--------+ 7 rows in set (0.00 sec) MariaDB [libreria1]> select descripcion, nropagina from libro where nropagina>=150; +---------------------+-----------+ | descripcion | nropagina | +---------------------+-----------+ | BD II | 150 | | Estructura de datos | 180 | | Ingles | 280 | | Contabilidad I | 170 | | Redes | 370 | +---------------------+-----------+ 5 rows in set (0.00 sec)