Microsoft Windows [Versión 10.0.22000.978] (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 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)]> source C:\Users\A01-1-0505-06\Downloads\matricula.sql 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) Query OK, 0 rows affected (0.000 sec) Database changed Query OK, 0 rows affected (0.004 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, 5 rows affected (0.001 sec) Records: 5 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.003 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.012 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, 5 rows affected (0.001 sec) Records: 5 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.003 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, 2 rows affected (0.001 sec) Records: 2 Duplicates: 0 Warnings: 0 Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.001 sec) MariaDB [matricula]> show tables; +---------------------+ | Tables_in_matricula | +---------------------+ | alumno | | alumno_materia | | materia | +---------------------+ 3 rows in set (0.000 sec) MariaDB [matricula]> delimiter // MariaDB [matricula]> create procedure insertar_alumno(in_cernet char(10), in_nombre char(40), in_estado char(10)) -> begin -> insert into alumno values(_carnet,_nombre,_estado); -> end -> // Query OK, 0 rows affected (0.004 sec) MariaDB [matricula]> delimiter ; MariaDB [matricula]> show tables; +---------------------+ | Tables_in_matricula | +---------------------+ | alumno | | alumno_materia | | materia | +---------------------+ 3 rows in set (0.000 sec) MariaDB [matricula]> show procedure; 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 [matricula]> show proceduce status; 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 'proceduce status' at line 1 MariaDB [matricula]> Show procedure status; +-----------+-----------------+-----------+----------------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+ | Db | Name | Type | Definer | Modified | Created | Security_type | Comment | character_set_client | collation_connection | Database Collation | +-----------+-----------------+-----------+----------------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+ | matricula | insertar | PROCEDURE | root@localhost | 2022-11-01 23:46:07 | 2022-11-01 23:46:07 | DEFINER | | utf8 | utf8_general_ci | latin1_swedish_ci | | matricula | insertar_alumno | PROCEDURE | root@localhost | 2022-11-01 23:53:18 | 2022-11-01 23:53:18 | DEFINER | | utf8 | utf8_general_ci | latin1_swedish_ci | +-----------+-----------------+-----------+----------------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+ 2 rows in set (0.005 sec) MariaDB [matricula]> show create procedure insertar_alumno; +-----------------+-----------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+--------------------+ | Procedure | sql_mode | Create Procedure | character_set_client | collation_connection | Database Collation | +-----------------+-----------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+--------------------+ | insertar_alumno | NO_AUTO_VALUE_ON_ZERO | CREATE DEFINER=`root`@`localhost` PROCEDURE `insertar_alumno`(in_cernet char(10), in_nombre char(40), in_estado char(10)) begin insert into alumno values(_carnet,_nombre,_estado); end | utf8 | utf8_general_ci | latin1_swedish_ci | +-----------------+-----------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+--------------------+ 1 row in set (0.000 sec) MariaDB [matricula]> Drop procedure insertar; Query OK, 0 rows affected (0.003 sec) MariaDB [matricula]> Show procedure status; +-----------+-----------------+-----------+----------------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+ | Db | Name | Type | Definer | Modified | Created | Security_type | Comment | character_set_client | collation_connection | Database Collation | +-----------+-----------------+-----------+----------------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+ | matricula | insertar_alumno | PROCEDURE | root@localhost | 2022-11-01 23:53:18 | 2022-11-01 23:53:18 | DEFINER | | utf8 | utf8_general_ci | latin1_swedish_ci | +-----------+-----------------+-----------+----------------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+ 1 row in set (0.005 sec) MariaDB [matricula]> select * from alumno; +-----------+-----------------------+----------+ | carnet | nombre | estado | +-----------+-----------------------+----------+ | 1000 | gloria | activo | | 112121545 | kelly ruiz | inactivo | | 2000 | jose miguel jaramillo | activo | | 3000 | luna | activo | | dsfds | sdfsdf | Activo | +-----------+-----------------------+----------+ 5 rows in set (0.001 sec) MariaDB [matricula]> Call insertar(‘012’,’sofia’,'Activo'); ERROR 1305 (42000): PROCEDURE matricula.insertar does not exist MariaDB [matricula]> Call insertar_alumno(‘012’,’sofia’,'Activo'); ERROR 1054 (42S22): Unknown column '_carnet' in 'field list' MariaDB [matricula]> Call insertar_alumno(‘012’,’sofia’,'Activo'); ERROR 1054 (42S22): Unknown column '_carnet' in 'field list' MariaDB [matricula]> drop procedure insertar_alumno; Query OK, 0 rows affected (0.004 sec) MariaDB [matricula]> show procedure status; Empty set (0.005 sec) MariaDB [matricula]> Delimiter // MariaDB [matricula]> Create procedure insertar_alumno(in _carnet char(10), in _nombre char(40), in _estado char(10)) -> Begin -> Insert into alumno values(_carnet, _nombre, _estado); -> End -> // Query OK, 0 rows affected (0.002 sec) MariaDB [matricula]> Delimiter ; MariaDB [matricula]> show tables; +---------------------+ | Tables_in_matricula | +---------------------+ | alumno | | alumno_materia | | materia | +---------------------+ 3 rows in set (0.000 sec) MariaDB [matricula]> Call insertar_alumno(‘012’,’sofia’,'Activo'); Query OK, 1 row affected (0.002 sec) MariaDB [matricula]> select * from alumno; +-----------+-----------------------+----------+ | carnet | nombre | estado | +-----------+-----------------------+----------+ | 012 | sofia | Activo | | 1000 | gloria | activo | | 112121545 | kelly ruiz | inactivo | | 2000 | jose miguel jaramillo | activo | | 3000 | luna | activo | | dsfds | sdfsdf | Activo | +-----------+-----------------------+----------+ 6 rows in set (0.000 sec) MariaDB [matricula]> select * from alumno; +-----------+-----------------------+----------+ | carnet | nombre | estado | +-----------+-----------------------+----------+ | 012 | sofia | Activo | | 1000 | gloria | activo | | 112121545 | kelly ruiz | inactivo | | 2000 | jose miguel jaramillo | activo | | 3000 | luna | activo | | dsfds | sdfsdf | Activo | +-----------+-----------------------+----------+ 6 rows in set (0.000 sec) MariaDB [matricula]> Call insertar_alumno(‘1026152612', 'Harold', 'Activo'); Query OK, 1 row affected (0.002 sec) MariaDB [matricula]> Call insertar_alumno(‘1026152612', 'Harold', 'Activo'); ERROR 1062 (23000): Duplicate entry '1026152612' for key 'PRIMARY' MariaDB [matricula]> select * from alumno; +------------+-----------------------+----------+ | carnet | nombre | estado | +------------+-----------------------+----------+ | 012 | sofia | Activo | | 1000 | gloria | activo | | 1026152612 | Harold | Activo | | 112121545 | kelly ruiz | inactivo | | 2000 | jose miguel jaramillo | activo | | 3000 | luna | activo | | dsfds | sdfsdf | Activo | +------------+-----------------------+----------+ 7 rows in set (0.000 sec) MariaDB [matricula]> Delimiter // MariaDB [matricula]> Crete procedure listar_alumno -> Begin -> Select * from alumno; -> End -> // 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 'Crete procedure listar_alumno Begin Select * from alumno; End' at line 1 MariaDB [matricula]> Delimiter ; MariaDB [matricula]> Delimiter // MariaDB [matricula]> Create procedure listar_alumno -> Begin -> Select * from alumno; -> End -> // 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 'Begin Select * from alumno; End' at line 2 MariaDB [matricula]> Delimiter ; MariaDB [matricula]> show tables; +---------------------+ | Tables_in_matricula | +---------------------+ | alumno | | alumno_materia | | materia | +---------------------+ 3 rows in set (0.000 sec) MariaDB [matricula]> Show procedure status; +-----------+-----------------+-----------+----------------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+ | Db | Name | Type | Definer | Modified | Created | Security_type | Comment | character_set_client | collation_connection | Database Collation | +-----------+-----------------+-----------+----------------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+ | matricula | insertar_alumno | PROCEDURE | root@localhost | 2022-11-02 00:12:57 | 2022-11-02 00:12:57 | DEFINER | | utf8 | utf8_general_ci | latin1_swedish_ci | +-----------+-----------------+-----------+----------------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+ 1 row in set (0.005 sec) MariaDB [matricula]> Delimiter // MariaDB [matricula]> Create procedure listar_alumno -> Begin -> Select * from alumno; -> End -> // 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 'Begin Select * from alumno; End' at line 2 MariaDB [matricula]> Delimiter ; MariaDB [matricula]> show create listar_alumno; 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 'listar_alumno' at line 1 MariaDB [matricula]> Delimiter // MariaDB [matricula]> Create procedure listar_alumno() -> Begin -> Select * from alumno; -> End -> // Query OK, 0 rows affected (0.002 sec) MariaDB [matricula]> Delimiter ; MariaDB [matricula]> call listar_alumno; +------------+-----------------------+----------+ | carnet | nombre | estado | +------------+-----------------------+----------+ | 012 | sofia | Activo | | 1000 | gloria | activo | | 1026152612 | Harold | Activo | | 112121545 | kelly ruiz | inactivo | | 2000 | jose miguel jaramillo | activo | | 3000 | luna | activo | | dsfds | sdfsdf | Activo | +------------+-----------------------+----------+ 7 rows in set (0.000 sec) Query OK, 0 rows affected (0.006 sec) MariaDB [matricula]> Delimiter // MariaDB [matricula]> Create procedure cons_alumno(in _carnet char(10)) -> Begin -> Select *from alumno where carnet=_carnet; -> End -> // Query OK, 0 rows affected (0.003 sec) MariaDB [matricula]> Delimiter ;call cons_alumno('1026152612'); MariaDB [matricula]> // -> delimiter ; -> end -> // -> delimiter ; -> ) -> ' '> -- '> ' -> // -> ByeCtrl-C -- exit! C:\xampp\mysql\bin>mysql -uroot -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 10 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)]> use matricula; Database changed MariaDB [matricula]> Delimiter // MariaDB [matricula]> Create procedure cons_alumno(in _carnet char(10)) -> Begin -> Select *from alumno where carnet=_carnet; -> End -> // ERROR 1304 (42000): PROCEDURE cons_alumno already exists MariaDB [matricula]> Delimiter ; MariaDB [matricula]> call cons_alumno('1026152612'); +------------+--------+--------+ | carnet | nombre | estado | +------------+--------+--------+ | 1026152612 | Harold | Activo | +------------+--------+--------+ 1 row in set (0.000 sec) Query OK, 0 rows affected (0.002 sec) MariaDB [matricula]> Delimiter // MariaDB [matricula]> Create procedure modi_alumno(in carnet char(10), in nombre char(40), in _estado(10)) -> Begin -> Update alumno set nombre=_nombre, estado=_estado where carnet=_carnet; -> End -> // 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 '(10)) Begin Update alumno set nombre=_nombre, estado=_estado where carnet=...' at line 1 MariaDB [matricula]> Delimiter ;Delimiter // MariaDB [matricula]> Create procedure modi_alumno(in _carnet char(10), in _nombre char(40), in _estado(10)) -> Begin -> Update alumno set nombre=_nombre, estado=_estado where carnet=_carnet; -> End -> // -> Delimiter ; -> Bye Ctrl-C -- exit! C:\xampp\mysql\bin>mysql -uroot -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 11 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)]> use matricula; Database changed MariaDB [matricula]> Delimiter // MariaDB [matricula]> Create procedure modi_alumno(in _carnet char(10), in _nombre char(40), in _estado(10)) -> Begin -> Update alumno set nombre=_nombre, estado=_estado where carnet=_carnet; -> End -> // 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 '(10)) Begin Update alumno set nombre=_nombre, estado=_estado where carnet=...' at line 1 MariaDB [matricula]> Delimiter ; MariaDB [matricula]> Delimiter // MariaDB [matricula]> Create procedure modi_alumno(in _carnet char(10), in _nombre char(40), in _estado(10)) -> Begin -> Update alumno set nombre= _nombre, estado= _estado where carnet= _carnet; -> End -> // 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 '(10)) Begin Update alumno set nombre= _nombre, estado= _estado where carne...' at line 1 MariaDB [matricula]> Delimiter ;Delimiter // MariaDB [matricula]> Create procedure modi_alumno(in _carnet char(10), in _nombre char(40), in _estado char(10)) -> Begin -> Update alumno set nombre= _nombre, estado= _estado where carnet= _carnet; -> End -> // -> Delimiter ; -> Bye Ctrl-C -- exit! C:\xampp\mysql\bin>mysql -uroot -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 12 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)]> use matricula; Database changed MariaDB [matricula]> Delimiter // MariaDB [matricula]> Create procedure modi_alumno(in _carnet char(10), in _nombre char(40), in _estado char(10)) -> Begin -> Update alumno set nombre= _nombre, estado= _estado where carnet= _carnet; -> End -> // Query OK, 0 rows affected (0.002 sec) MariaDB [matricula]> Delimiter ; MariaDB [matricula]> call modi_alumno ('012','Maria de las nieves','Inactiva'); Query OK, 1 row affected (0.002 sec) MariaDB [matricula]> select * from alumno; +------------+-----------------------+----------+ | carnet | nombre | estado | +------------+-----------------------+----------+ | 012 | Maria de las nieves | Inactiva | | 1000 | gloria | activo | | 1026152612 | Harold | Activo | | 112121545 | kelly ruiz | inactivo | | 2000 | jose miguel jaramillo | activo | | 3000 | luna | activo | | dsfds | sdfsdf | Activo | +------------+-----------------------+----------+ 7 rows in set (0.000 sec) MariaDB [matricula]> Delimiter // MariaDB [matricula]> Create procedure eli_alumno(in _carnet char(10)) -> Begin -> Delete from alumno where carnet=_carnet; -> End -> // Query OK, 0 rows affected (0.002 sec) MariaDB [matricula]> Delimiter ; MariaDB [matricula]> call eli_alumno ('012'); Query OK, 1 row affected (0.002 sec) MariaDB [matricula]> select * from alumno; +------------+-----------------------+----------+ | carnet | nombre | estado | +------------+-----------------------+----------+ | 1000 | gloria | activo | | 1026152612 | Harold | Activo | | 112121545 | kelly ruiz | inactivo | | 2000 | jose miguel jaramillo | activo | | 3000 | luna | activo | | dsfds | sdfsdf | Activo | +------------+-----------------------+----------+ 6 rows in set (0.000 sec) MariaDB [matricula]> exit Bye C:\xampp\mysql\bin>mysqldump -B -uroot -p --routines matricula>c:/xampp/matricula.sql Enter password: C:\xampp\mysql\bin>