Microsoft Windows [Versión 10.0.22000.856] (c) Microsoft Corporation. Todos los derechos reservados. Z:\>c: C:\>cd/xampp/mysql/bin C:\xampp\mysql\bin>mysql -uroot -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 8 Server version: 10.4.21-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)]> source C:\Users\A01-1-0505-06\Downloads\libreria.sql Query OK, 0 rows affected (0.002 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 1 row affected (0.001 sec) Database changed Query OK, 0 rows affected (0.017 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.011 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.001 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 9 rows affected (0.001 sec) Records: 9 Duplicates: 0 Warnings: 0 Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.001 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.010 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.001 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 6 rows affected (0.001 sec) Records: 6 Duplicates: 0 Warnings: 0 Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.010 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.001 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 3 rows affected (0.001 sec) Records: 3 Duplicates: 0 Warnings: 0 Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.011 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.001 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 7 rows affected (0.001 sec) Records: 7 Duplicates: 0 Warnings: 0 Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.010 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.001 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 8 rows affected (0.001 sec) Records: 8 Duplicates: 0 Warnings: 0 Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) MariaDB [libreria]> show tables; +--------------------+ | Tables_in_libreria | +--------------------+ | asignatura | | autor | | editorial | | liautedi | | libro | +--------------------+ 5 rows in set (0.003 sec) MariaDB [libreria]> MariaDB [libreria]> Select* form 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 'form libro' at line 1 MariaDB [libreria]> 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.001 sec) MariaDB [libreria]> Select descrpcion,precio from libro; ERROR 1054 (42S22): Unknown column 'descrpcion' in 'field list' MariaDB [libreria]> Select descrpcion, precio from libro; ERROR 1054 (42S22): Unknown column 'descrpcion' in 'field list' MariaDB [libreria]> 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.000 sec) MariaDB [libreria]> 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.001 sec) MariaDB [libreria]> select * from editorial; +---------+--------------+ | codedit | nombre | +---------+--------------+ | E01 | Oveja Negra | | E02 | Norma | | E03 | Mc Graw Hill | +---------+--------------+ 3 rows in set (0.001 sec) MariaDB [libreria]> select * -> from libro where idlibro = 'l01'; +---------+-------------+-----------+--------+-----------+ | idlibro | descripcion | nropagina | precio | codigomat | +---------+-------------+-----------+--------+-----------+ | L01 | Calculo II | 120 | 55000 | M01 | +---------+-------------+-----------+--------+-----------+ 1 row in set (0.001 sec) MariaDB [libreria]> tee c:/xampp/claseCondicionales.txt Logging to file 'c:/xampp/claseCondicionales.txt' MariaDB [libreria]> Ctrl-C -- exit! Bye C:\xampp\mysql\bin> C:\xampp\mysql\bin>mysql -uroot -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 9 Server version: 10.4.21-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)]> sourceC:\Users\A01-1-0505-06\Downloads\libreria.sql ERROR: Unknown command '\U'. ERROR: Unknown command '\A'. ERROR: Unknown command '\D'. ERROR: Unknown command '\l'. -> source C:\Users\A01-1-0505-06\Downloads\libreria.sql ERROR: Unknown command '\U'. ERROR: Unknown command '\A'. ERROR: Unknown command '\D'. ERROR: Unknown command '\l'. -> use libreria; 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 'sourceC:\Users\A01-1-0505-06\Downloads\libreria.sql source C:\Users\A01-1-050...' at line 1 MariaDB [(none)]> use libreria; Database changed MariaDB [libreria]> from libro where idlibro = 'l01'; 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 'from libro where idlibro = 'l01'' at line 1 MariaDB [libreria]> show tables; +--------------------+ | Tables_in_libreria | +--------------------+ | asignatura | | autor | | editorial | | liautedi | | libro | +--------------------+ 5 rows in set (0.000 sec) MariaDB [libreria]> Select* form 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 'form libro' at line 1 MariaDB [libreria]> 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.000 sec) MariaDB [libreria]> describe libro; +-------------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------------+-------------+------+-----+---------+-------+ | idlibro | varchar(10) | NO | PRI | NULL | | | descripcion | varchar(50) | NO | | NULL | | | nropagina | int(8) | NO | | NULL | | | precio | int(8) | NO | | NULL | | | codigomat | varchar(10) | NO | | NULL | | +-------------+-------------+------+-----+---------+-------+ 5 rows in set (0.007 sec) MariaDB [libreria]> select * from libro where nropagina < 160; +---------+---------------------+-----------+--------+-----------+ | idlibro | descripcion | nropagina | precio | codigomat | +---------+---------------------+-----------+--------+-----------+ | L01 | Calculo II | 120 | 55000 | M01 | | L02 | BD II | 150 | 65000 | M09 | | L05 | Admon en una pagina | 70 | 7500 | M05 | | L08 | Diagramacion | 85 | 45000 | M08 | +---------+---------------------+-----------+--------+-----------+ 4 rows in set (0.001 sec) MariaDB [libreria]> select descripcion, nropaginas, precio from libro where precio > 5000; ERROR 1054 (42S22): Unknown column 'nropaginas' in 'field list' MariaDB [libreria]> select descripcion, nropagina, precio from libro where precio > 5000; +---------------------+-----------+--------+ | descripcion | nropagina | precio | +---------------------+-----------+--------+ | Calculo II | 120 | 55000 | | BD II | 150 | 65000 | | Estructura de datos | 180 | 85000 | | Ingles | 280 | 105000 | | Admon en una pagina | 70 | 7500 | | Contabilidad I | 170 | 27500 | | Redes | 370 | 32500 | | Diagramacion | 85 | 45000 | +---------------------+-----------+--------+ 8 rows in set (0.000 sec) MariaDB [libreria]> select descripcion, nropagina, precio from libro where precio > 50000; +---------------------+-----------+--------+ | descripcion | nropagina | precio | +---------------------+-----------+--------+ | Calculo II | 120 | 55000 | | BD II | 150 | 65000 | | Estructura de datos | 180 | 85000 | | Ingles | 280 | 105000 | +---------------------+-----------+--------+ 4 rows in set (0.000 sec) MariaDB [libreria]> select * from libro where descripcion = 'BD II'; +---------+-------------+-----------+--------+-----------+ | idlibro | descripcion | nropagina | precio | codigomat | +---------+-------------+-----------+--------+-----------+ | L02 | BD II | 150 | 65000 | M09 | +---------+-------------+-----------+--------+-----------+ 1 row in set (0.000 sec) MariaDB [libreria]> select * from libre where nropagina >= 100 and precio >= 10000; ERROR 1146 (42S02): Table 'libreria.libre' doesn't exist MariaDB [libreria]> select * from libro where nropagina >= 100 and precio >= 10000; +---------+---------------------+-----------+--------+-----------+ | 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 | | L06 | Contabilidad I | 170 | 27500 | M06 | | L07 | Redes | 370 | 32500 | M07 | +---------+---------------------+-----------+--------+-----------+ 6 rows in set (0.000 sec) MariaDB [libreria]> select * from libro where idlibro = l01; ERROR 1054 (42S22): Unknown column 'l01' in 'where clause' MariaDB [libreria]> select * from libro where idlibro = 'l01'; +---------+-------------+-----------+--------+-----------+ | idlibro | descripcion | nropagina | precio | codigomat | +---------+-------------+-----------+--------+-----------+ | L01 | Calculo II | 120 | 55000 | M01 | +---------+-------------+-----------+--------+-----------+ 1 row in set (0.000 sec) MariaDB [libreria]> select * from libro where idlibro = 'l01'and idlibro = 'l02'; Empty set (0.000 sec) MariaDB [libreria]> select * from libro where idlibro = 'l01'or idlibro = 'l02'or idlibro ='l03'; +---------+---------------------+-----------+--------+-----------+ | idlibro | descripcion | nropagina | precio | codigomat | +---------+---------------------+-----------+--------+-----------+ | L01 | Calculo II | 120 | 55000 | M01 | | L02 | BD II | 150 | 65000 | M09 | | L03 | Estructura de datos | 180 | 85000 | M03 | +---------+---------------------+-----------+--------+-----------+ 3 rows in set (0.001 sec) MariaDB [libreria]> select * from libro where idlibro = 'l01'or idlibro = 'l02'or idlibro ='l03' or idlibro='l04' or idlibro='l05'; +---------+---------------------+-----------+--------+-----------+ | 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 | +---------+---------------------+-----------+--------+-----------+ 5 rows in set (0.000 sec) MariaDB [libreria]> select * from libro where idlibro >= 'l01'and idlibro<='l05'; +---------+---------------------+-----------+--------+-----------+ | 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 | +---------+---------------------+-----------+--------+-----------+ 5 rows in set (0.000 sec) MariaDB [libreria]> select * from libro where idlibro in ('l01', 'l02', 'l03'); +---------+---------------------+-----------+--------+-----------+ | idlibro | descripcion | nropagina | precio | codigomat | +---------+---------------------+-----------+--------+-----------+ | L01 | Calculo II | 120 | 55000 | M01 | | L02 | BD II | 150 | 65000 | M09 | | L03 | Estructura de datos | 180 | 85000 | M03 | +---------+---------------------+-----------+--------+-----------+ 3 rows in set (0.001 sec) MariaDB [libreria]> select * from libro where idlibro between 'L01' and 'L06'; +---------+---------------------+-----------+--------+-----------+ | 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 | +---------+---------------------+-----------+--------+-----------+ 6 rows in set (0.001 sec) MariaDB [libreria]> select * from libro where descripcion like 'C%'; +---------+----------------+-----------+--------+-----------+ | idlibro | descripcion | nropagina | precio | codigomat | +---------+----------------+-----------+--------+-----------+ | L01 | Calculo II | 120 | 55000 | M01 | | L06 | Contabilidad I | 170 | 27500 | M06 | +---------+----------------+-----------+--------+-----------+ 2 rows in set (0.000 sec) MariaDB [libreria]> select * from libro where descripcion like '%S'; +---------+---------------------+-----------+--------+-----------+ | idlibro | descripcion | nropagina | precio | codigomat | +---------+---------------------+-----------+--------+-----------+ | L03 | Estructura de datos | 180 | 85000 | M03 | | L04 | Ingles | 280 | 105000 | M04 | | L07 | Redes | 370 | 32500 | M07 | +---------+---------------------+-----------+--------+-----------+ 3 rows in set (0.000 sec) MariaDB [libreria]> select * from libro where descripcion like '%T%'; +---------+---------------------+-----------+--------+-----------+ | idlibro | descripcion | nropagina | precio | codigomat | +---------+---------------------+-----------+--------+-----------+ | L03 | Estructura de datos | 180 | 85000 | M03 | | L06 | Contabilidad I | 170 | 27500 | M06 | +---------+---------------------+-----------+--------+-----------+ 2 rows in set (0.000 sec) MariaDB [libreria]> select * from libro where descripcion like '%datos%'; +---------+---------------------+-----------+--------+-----------+ | idlibro | descripcion | nropagina | precio | codigomat | +---------+---------------------+-----------+--------+-----------+ | L03 | Estructura de datos | 180 | 85000 | M03 | +---------+---------------------+-----------+--------+-----------+ 1 row in set (0.000 sec) MariaDB [libreria]> describe editorial -> ; +---------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +---------+-------------+------+-----+---------+-------+ | codedit | varchar(10) | NO | PRI | NULL | | | nombre | varchar(50) | NO | | NULL | | +---------+-------------+------+-----+---------+-------+ 2 rows in set (0.006 sec) MariaDB [libreria]> select libro.idlibro,libro.descripcion,autor.codautor,autor.nombre from libro,autor,liautedi where libro.idlibro=liautedi.idlibro and liautedi.codautor=autor.codautor; +---------+----------------+----------+----------------------+ | idlibro | descripcion | codautor | nombre | +---------+----------------+----------+----------------------+ | L02 | BD II | A01 | Luis Joyanes | | L02 | BD II | A05 | Robert Lorber | | L06 | Contabilidad I | A02 | Jorge Vasquez Posada | | L07 | Redes | A05 | Robert Lorber | | L04 | Ingles | A04 | Riaz Khadem | | L04 | Ingles | A04 | Riaz Khadem | | L04 | Ingles | A04 | Riaz Khadem | +---------+----------------+----------+----------------------+ 7 rows in set (0.002 sec) MariaDB [libreria]> select * from liautedi; +---------+----------+---------+ | idlibro | codautor | codedit | +---------+----------+---------+ | L02 | A01 | E01 | | L02 | A05 | E03 | | L06 | A02 | E02 | | L07 | A05 | E03 | | L04 | A04 | E01 | | L04 | A04 | E02 | | L04 | A04 | E03 | +---------+----------+---------+ 7 rows in set (0.000 sec) MariaDB [libreria]> select distinct libro.idlibro,libro.descripcion,autor.codautor,autor.nombre from libro,autor,liautedi where libro.idlibro=liautedi.idlibro and liautedi.codautor=autor.codautor; +---------+----------------+----------+----------------------+ | idlibro | descripcion | codautor | nombre | +---------+----------------+----------+----------------------+ | L02 | BD II | A01 | Luis Joyanes | | L02 | BD II | A05 | Robert Lorber | | L06 | Contabilidad I | A02 | Jorge Vasquez Posada | | L07 | Redes | A05 | Robert Lorber | | L04 | Ingles | A04 | Riaz Khadem | +---------+----------------+----------+----------------------+ 5 rows in set (0.000 sec) MariaDB [libreria]> select libro.descripcion,autor.nombre from libro,autor,liautedi where libro.descripcion='Estructura de datos' and libro.idlibro=liautedi.idlibro and liautedi.codautor=autor.codautor; Empty set (0.000 sec) MariaDB [libreria]> exit Bye C:\xampp\mysql\bin>mysqldump -B -uroot -p Biblioteca>c:/xampp/libreria.sql Enter password: mysqldump: Got error: 1049: "Unknown database 'biblioteca'" when selecting the database C:\xampp\mysql\bin>mysqldump -B -uroot -p libreria>c:/xampp/libreria.sql Enter password: C:\xampp\mysql\bin>