MariaDB [(none)]> source c:/xampp/inventario.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, 1 row affected (0.001 sec) Database changed 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.013 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, 10 rows affected (0.002 sec) Records: 10 Duplicates: 0 Warnings: 0 Query OK, 0 rows affected (0.000 sec) 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.018 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, 5 rows affected (0.002 sec) Records: 5 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.018 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, 10 rows affected (0.007 sec) Records: 10 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.017 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.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.008 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, 10 rows affected (0.002 sec) Records: 10 Duplicates: 0 Warnings: 0 Query OK, 0 rows affected (0.000 sec) 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.007 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, 10 rows affected (0.003 sec) Records: 10 Duplicates: 0 Warnings: 0 Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.005 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.031 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, 10 rows affected (0.001 sec) Records: 10 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 [inventario]> describe producto; +--------------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +--------------+-------------+------+-----+---------+-------+ | id_producto | varchar(20) | NO | PRI | NULL | | | Nombre | varchar(45) | NO | | NULL | | | Precio_costo | int(45) | NO | | NULL | | | Precio_venta | int(45) | NO | | NULL | | | Disponible | int(45) | NO | | NULL | | +--------------+-------------+------+-----+---------+-------+ 5 rows in set (0.013 sec) MariaDB [inventario]> Delimiter // MariaDB [inventario]> Create procedure insertar_producto( in _id_producto char(20), in _nombre char(45), in _Precio_costo int(45), in _Precio_venta int(45), in _Disponible int(45)) -> Begin -> Insert into producto values(_id_producto, _nombre, _Precio_costo, Precio_venta,Disponible); -> end -> // Query OK, 0 rows affected (0.007 sec) MariaDB [inventario]> Delimiter ; MariaDB [inventario]> Show procedure status; +------------+-------------------+-----------+----------------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+ | Db | Name | Type | Definer | Modified | Created | Security_type | Comment | character_set_client | collation_connection | Database Collation | +------------+-------------------+-----------+----------------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+ | inventario | insertar_producto | PROCEDURE | root@localhost | 2024-11-01 19:59:44 | 2024-11-01 19:59:44 | DEFINER | | cp850 | cp850_general_ci | utf8mb4_general_ci | | matricula | cons_alumno | PROCEDURE | root@localhost | 2024-11-01 19:16:09 | 2024-11-01 19:16:09 | DEFINER | | utf8 | utf8_general_ci | latin1_swedish_ci | | matricula | eliminar_alumno | PROCEDURE | root@localhost | 2024-11-01 19:21:08 | 2024-11-01 19:21:08 | DEFINER | | utf8 | utf8_general_ci | latin1_swedish_ci | | matricula | insertar_alumno | PROCEDURE | root@localhost | 2024-11-01 18:51:13 | 2024-11-01 18:51:13 | DEFINER | | utf8 | utf8_general_ci | latin1_swedish_ci | | matricula | listar | PROCEDURE | root@localhost | 2024-11-01 19:09:46 | 2024-11-01 19:09:46 | DEFINER | | utf8 | utf8_general_ci | latin1_swedish_ci | | matricula | modificar_alumno | PROCEDURE | root@localhost | 2024-11-01 19:25:51 | 2024-11-01 19:25:51 | DEFINER | | utf8 | utf8_general_ci | latin1_swedish_ci | +------------+-------------------+-----------+----------------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+ 6 rows in set (0.050 sec) MariaDB [inventario]> select * from producto; +-------------+--------------+--------------+--------------+------------+ | id_producto | Nombre | Precio_costo | Precio_venta | Disponible | +-------------+--------------+--------------+--------------+------------+ | P001 | Refrigerador | 1500000 | 0 | 50 | | P002 | Lavadora | 1200000 | 0 | 30 | | P003 | Microondas | 300000 | 0 | 100 | | P004 | Horno | 700000 | 0 | 60 | | P005 | Licuadora | 150000 | 0 | 200 | | P006 | Aspiradora | 500000 | 0 | 80 | | P007 | Televisor | 2000000 | 0 | 40 | | P008 | Ventilador | 80000 | 0 | 150 | | P009 | Cafetera | 120000 | 0 | 120 | | P010 | Plancha | 90000 | 0 | 70 | +-------------+--------------+--------------+--------------+------------+ 10 rows in set (0.001 sec) MariaDB [inventario]> Call insertar_producto("P001"," Refrigerador Toyota",2000000,0,50); ERROR 1062 (23000): Duplicate entry 'P001' for key 'PRIMARY' MariaDB [inventario]> Call insertar_producto("P0011"," Refrigerador Toyota",2000000,0,50); Query OK, 1 row affected (0.003 sec) MariaDB [inventario]> select * from producto; +-------------+----------------------+--------------+--------------+------------+ | id_producto | Nombre | Precio_costo | Precio_venta | Disponible | +-------------+----------------------+--------------+--------------+------------+ | P001 | Refrigerador | 1500000 | 0 | 50 | | P0011 | Refrigerador Toyota | 2000000 | 0 | 0 | | P002 | Lavadora | 1200000 | 0 | 30 | | P003 | Microondas | 300000 | 0 | 100 | | P004 | Horno | 700000 | 0 | 60 | | P005 | Licuadora | 150000 | 0 | 200 | | P006 | Aspiradora | 500000 | 0 | 80 | | P007 | Televisor | 2000000 | 0 | 40 | | P008 | Ventilador | 80000 | 0 | 150 | | P009 | Cafetera | 120000 | 0 | 120 | | P010 | Plancha | 90000 | 0 | 70 | +-------------+----------------------+--------------+--------------+------------+ 11 rows in set (0.001 sec) MariaDB [inventario]> Delimiter // MariaDB [inventario]> Create procedure listar_producto() -> Begin -> Select * from producto; -> end -> // Query OK, 0 rows affected (0.006 sec) MariaDB [inventario]> Delimiter ; MariaDB [inventario]> call listar_producto; +-------------+----------------------+--------------+--------------+------------+ | id_producto | Nombre | Precio_costo | Precio_venta | Disponible | +-------------+----------------------+--------------+--------------+------------+ | P001 | Refrigerador | 1500000 | 0 | 50 | | P0011 | Refrigerador Toyota | 2000000 | 0 | 0 | | P002 | Lavadora | 1200000 | 0 | 30 | | P003 | Microondas | 300000 | 0 | 100 | | P004 | Horno | 700000 | 0 | 60 | | P005 | Licuadora | 150000 | 0 | 200 | | P006 | Aspiradora | 500000 | 0 | 80 | | P007 | Televisor | 2000000 | 0 | 40 | | P008 | Ventilador | 80000 | 0 | 150 | | P009 | Cafetera | 120000 | 0 | 120 | | P010 | Plancha | 90000 | 0 | 70 | +-------------+----------------------+--------------+--------------+------------+ 11 rows in set (0.001 sec) Query OK, 0 rows affected (0.025 sec) MariaDB [inventario]> how create procedurelistar_producto; 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 'how create procedurelistar_producto' at line 1 MariaDB [inventario]> show create procedurelistar_producto; 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 'procedurelistar_producto' at line 1 MariaDB [inventario]> show create procedure listar_producto; +-----------------+-----------------------------------------------------+---------------------------------------------------------------------------------------------------+----------------------+----------------------+--------------------+ | Procedure | sql_mode | Create Procedure | character_set_client | collation_connection | Database Collation | +-----------------+-----------------------------------------------------+---------------------------------------------------------------------------------------------------+----------------------+----------------------+--------------------+ | listar_producto | NO_ZERO_IN_DATE,NO_ZERO_DATE,NO_ENGINE_SUBSTITUTION | CREATE DEFINER=`root`@`localhost` PROCEDURE `listar_producto`() Begin Select * from producto; end | cp850 | cp850_general_ci | utf8mb4_general_ci | +-----------------+-----------------------------------------------------+---------------------------------------------------------------------------------------------------+----------------------+----------------------+--------------------+ 1 row in set (0.001 sec) MariaDB [inventario]> show procedure status; +------------+-------------------+-----------+----------------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+ | Db | Name | Type | Definer | Modified | Created | Security_type | Comment | character_set_client | collation_connection | Database Collation | +------------+-------------------+-----------+----------------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+ | inventario | insertar_producto | PROCEDURE | root@localhost | 2024-11-01 19:59:44 | 2024-11-01 19:59:44 | DEFINER | | cp850 | cp850_general_ci | utf8mb4_general_ci | | inventario | listar_producto | PROCEDURE | root@localhost | 2024-11-01 20:15:18 | 2024-11-01 20:15:18 | DEFINER | | cp850 | cp850_general_ci | utf8mb4_general_ci | | matricula | cons_alumno | PROCEDURE | root@localhost | 2024-11-01 19:16:09 | 2024-11-01 19:16:09 | DEFINER | | utf8 | utf8_general_ci | latin1_swedish_ci | | matricula | eliminar_alumno | PROCEDURE | root@localhost | 2024-11-01 19:21:08 | 2024-11-01 19:21:08 | DEFINER | | utf8 | utf8_general_ci | latin1_swedish_ci | | matricula | insertar_alumno | PROCEDURE | root@localhost | 2024-11-01 18:51:13 | 2024-11-01 18:51:13 | DEFINER | | utf8 | utf8_general_ci | latin1_swedish_ci | | matricula | listar | PROCEDURE | root@localhost | 2024-11-01 19:09:46 | 2024-11-01 19:09:46 | DEFINER | | utf8 | utf8_general_ci | latin1_swedish_ci | | matricula | modificar_alumno | PROCEDURE | root@localhost | 2024-11-01 19:25:51 | 2024-11-01 19:25:51 | DEFINER | | utf8 | utf8_general_ci | latin1_swedish_ci | +------------+-------------------+-----------+----------------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+ 7 rows in set (0.015 sec) MariaDB [inventario]> exit