MariaDB [(none)]> source C:\Users\USUARIO\Downloads\inventario2.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.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.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.072 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.007 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.001 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.000 sec) Query OK, 0 rows affected (0.032 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.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.006 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.002 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 10 rows affected (0.004 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.008 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.041 sec) 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, 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.006 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.004 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 11 rows affected (0.002 sec) Records: 11 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.009 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.001 sec) Query OK, 0 rows affected (0.003 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.001 sec) 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.020 sec) Query OK, 0 rows affected (0.001 sec) Query OK, 0 rows affected (0.001 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.001 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, 0 rows affected (0.026 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.008 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) 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.004 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.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.000 sec) Query OK, 0 rows affected (0.000 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-06 17:53:09 | 2024-11-06 17:53:09 | DEFINER | | cp850 | cp850_general_ci | utf8mb4_general_ci | | inventario | listar_producto | PROCEDURE | root@localhost | 2024-11-06 17:53:09 | 2024-11-06 17:53:09 | DEFINER | | cp850 | cp850_general_ci | utf8mb4_general_ci | +------------+-------------------+-----------+----------------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+ 2 rows in set (0.025 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.006 sec) 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.065 sec) 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.000 sec) MariaDB [inventario]> Delimiter // MariaDB [inventario]> Create procedure consultar_producto(in _id_producto char(20)) -> Begin -> select * from producto where id_producto=_id_producto; -> End -> // Query OK, 0 rows affected (0.005 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 | consultar_producto | PROCEDURE | root@localhost | 2024-11-06 18:07:03 | 2024-11-06 18:07:03 | DEFINER | | cp850 | cp850_general_ci | utf8mb4_general_ci | | inventario | insertar_producto | PROCEDURE | root@localhost | 2024-11-06 17:53:09 | 2024-11-06 17:53:09 | DEFINER | | cp850 | cp850_general_ci | utf8mb4_general_ci | | inventario | listar_producto | PROCEDURE | root@localhost | 2024-11-06 17:53:09 | 2024-11-06 17:53:09 | DEFINER | | cp850 | cp850_general_ci | utf8mb4_general_ci | +------------+--------------------+-----------+----------------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+ 3 rows in set (0.024 sec) MariaDB [inventario]> call consultar_producto("P002"); +-------------+----------+--------------+--------------+------------+ | id_producto | Nombre | Precio_costo | Precio_venta | Disponible | +-------------+----------+--------------+--------------+------------+ | P002 | Lavadora | 1200000 | 0 | 30 | +-------------+----------+--------------+--------------+------------+ 1 row in set (0.001 sec) Query OK, 0 rows affected (0.006 sec) MariaDB [inventario]> Delimiter // MariaDB [inventario]> Create procedure eliminar_producto(in _id_producto char(20)) -> Begin -> Delete from producto where id_producto=_id_producto; -> End -> // Query OK, 0 rows affected (0.005 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 | consultar_producto | PROCEDURE | root@localhost | 2024-11-06 18:07:03 | 2024-11-06 18:07:03 | DEFINER | | cp850 | cp850_general_ci | utf8mb4_general_ci | | inventario | eliminar_producto | PROCEDURE | root@localhost | 2024-11-06 18:14:46 | 2024-11-06 18:14:46 | DEFINER | | cp850 | cp850_general_ci | utf8mb4_general_ci | | inventario | insertar_producto | PROCEDURE | root@localhost | 2024-11-06 17:53:09 | 2024-11-06 17:53:09 | DEFINER | | cp850 | cp850_general_ci | utf8mb4_general_ci | | inventario | listar_producto | PROCEDURE | root@localhost | 2024-11-06 17:53:09 | 2024-11-06 17:53:09 | DEFINER | | cp850 | cp850_general_ci | utf8mb4_general_ci | +------------+--------------------+-----------+----------------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+ 4 rows in set (0.021 sec) MariaDB [inventario]> show create procedure eliminar_producto; +-------------------+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+--------------------+ | Procedure | sql_mode | Create Procedure | character_set_client | collation_connection | Database Collation | +-------------------+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+--------------------+ | eliminar_producto | NO_ZERO_IN_DATE,NO_ZERO_DATE,NO_ENGINE_SUBSTITUTION | CREATE DEFINER=`root`@`localhost` PROCEDURE `eliminar_producto`(in _id_producto char(20)) Begin Delete from producto where id_producto=_id_producto; End | cp850 | cp850_general_ci | utf8mb4_general_ci | +-------------------+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+--------------------+ 1 row in set (0.001 sec) MariaDB [inventario]> call eliminar+ -> ; 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 [inventario]> call eliminar_producto("P0011"); 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 | | 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.000 sec) MariaDB [inventario]> Delimiter // MariaDB [inventario]> Create procedure modificar_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 -> Update producto set nombre = _nombre, Precio_costo = _Precio_costo, Precio_venta = _Precio_venta, Disponible = _Disponible where id_producto = _id_producto; -> End -> // Query OK, 0 rows affected (0.005 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 | consultar_producto | PROCEDURE | root@localhost | 2024-11-06 18:07:03 | 2024-11-06 18:07:03 | DEFINER | | cp850 | cp850_general_ci | utf8mb4_general_ci | | inventario | eliminar_producto | PROCEDURE | root@localhost | 2024-11-06 18:14:46 | 2024-11-06 18:14:46 | DEFINER | | cp850 | cp850_general_ci | utf8mb4_general_ci | | inventario | insertar_producto | PROCEDURE | root@localhost | 2024-11-06 17:53:09 | 2024-11-06 17:53:09 | DEFINER | | cp850 | cp850_general_ci | utf8mb4_general_ci | | inventario | listar_producto | PROCEDURE | root@localhost | 2024-11-06 17:53:09 | 2024-11-06 17:53:09 | DEFINER | | cp850 | cp850_general_ci | utf8mb4_general_ci | | inventario | modificar_producto | PROCEDURE | root@localhost | 2024-11-06 18:31:48 | 2024-11-06 18:31:48 | DEFINER | | cp850 | cp850_general_ci | utf8mb4_general_ci | +------------+--------------------+-----------+----------------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+ 5 rows in set (0.023 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 modificar_producto("P010","Plancha_Toyota", 90000, 0, 70); Query OK, 1 row affected (0.004 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_Toyota | 90000 | 0 | 70 | +-------------+----------------+--------------+--------------+------------+ 10 rows in set (0.000 sec) MariaDB [inventario]> update producto set Precio_venta =(select valorunitario + (valorunitario * 0.25); 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 [inventario]> update producto set Precio_venta = Precio_costo + (Precio_costo * 0.25); Query OK, 10 rows affected (0.002 sec) Rows matched: 10 Changed: 10 Warnings: 0 MariaDB [inventario]> select * from producto; +-------------+----------------+--------------+--------------+------------+ | id_producto | Nombre | Precio_costo | Precio_venta | Disponible | +-------------+----------------+--------------+--------------+------------+ | P001 | Refrigerador | 1500000 | 1875000 | 50 | | P002 | Lavadora | 1200000 | 1500000 | 30 | | P003 | Microondas | 300000 | 375000 | 100 | | P004 | Horno | 700000 | 875000 | 60 | | P005 | Licuadora | 150000 | 187500 | 200 | | P006 | Aspiradora | 500000 | 625000 | 80 | | P007 | Televisor | 2000000 | 2500000 | 40 | | P008 | Ventilador | 80000 | 100000 | 150 | | P009 | Cafetera | 120000 | 150000 | 120 | | P010 | Plancha_Toyota | 90000 | 112500 | 70 | +-------------+----------------+--------------+--------------+------------+ 10 rows in set (0.000 sec) MariaDB [inventario]> SELECT producto.Nombre AS Producto, proveedores.Nombre AS ProveedorFROM productoINNER JOIN Detalles_Pedido ON producto.id_producto = Detalles_Pedido.FK_produtoINNER JOIN Pedidos_Proveedores ON Pedidos_Proveedores.id_pedidoProve = Detalles_Pedido.FK_pedidoProveINNER JOIN proveedores ON proveedores.id_proveedor = Pedidos_Proveedores.FK_proveedor; 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 'productoINNER JOIN Detalles_Pedido ON producto.id_producto = Detalles_Pedido....' at line 1 MariaDB [inventario]> select min(Precio_venta) "Valor producto m s barato" from producto; +---------------------------+ | Valor producto m s barato | +---------------------------+ | 100000 | +---------------------------+ 1 row in set (0.001 sec) MariaDB [inventario]> exit ____________________//___________________________//______________________//_________________ MariaDB [(none)]> source C:\Users\USUARIO\Downloads\inventario2.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.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.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.089 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.016 sec) 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, 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.000 sec) Query OK, 0 rows affected (0.008 sec) Query OK, 0 rows affected (0.001 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.047 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.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.007 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.001 sec) Query OK, 0 rows affected (0.001 sec) Query OK, 10 rows affected (0.006 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.008 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.043 sec) 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, 5 rows affected (0.002 sec) Records: 5 Duplicates: 0 Warnings: 0 Query OK, 0 rows affected (0.001 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.000 sec) Query OK, 0 rows affected (0.008 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.003 sec) Query OK, 0 rows affected (0.001 sec) Query OK, 11 rows affected (0.003 sec) Records: 11 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.008 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.001 sec) Query OK, 0 rows affected (0.008 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.003 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.000 sec) Query OK, 0 rows affected (0.007 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.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.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.028 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.004 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.004 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.004 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) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) MariaDB [inventario]> select * from proveedores; +--------------+----------------------+------------+--------------+ | id_proveedor | Nombre | Telefono | Ciudad | +--------------+----------------------+------------+--------------+ | PR001 | ElectroHouse | 3001234567 | Medellin | | PR002 | MegaElectro | 3012345678 | Bogota | | PR003 | HogarPlus | 3023456789 | Cali | | PR004 | TecnoElectro | 3034567890 | Barranquilla | | PR005 | ElectroCenter | 3045678901 | Cartagena | | PR006 | HomeElectronics | 3056789012 | Pereira | | PR007 | TotalElectro | 3067890123 | Bucaramanga | | PR008 | ElectroService | 3078901234 | Santa Marta | | PR009 | ElectroDistribuidora | 3089012345 | Manizales | | PR010 | ElectroTienda | 3090123456 | Ibagu‚ | +--------------+----------------------+------------+--------------+ 10 rows in set (0.001 sec) MariaDB [inventario]> describe proveedores; +--------------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +--------------+-------------+------+-----+---------+-------+ | id_proveedor | varchar(20) | NO | PRI | NULL | | | Nombre | varchar(45) | NO | | NULL | | | Telefono | varchar(45) | NO | | NULL | | | Ciudad | varchar(45) | NO | | NULL | | +--------------+-------------+------+-----+---------+-------+ 4 rows in set (0.019 sec) MariaDB [inventario]> update proveedores set nombre="TecnoElectro_Toyota" where id_proveedor=PR004; ERROR 1054 (42S22): Unknown column 'PR004' in 'where clause' MariaDB [inventario]> update proveedores set nombre="TecnoElectro_Toyota" where id_proveedor="PR004"; Query OK, 1 row affected (0.003 sec) Rows matched: 1 Changed: 1 Warnings: 0 MariaDB [inventario]> select * from proveedores; +--------------+----------------------+------------+--------------+ | id_proveedor | Nombre | Telefono | Ciudad | +--------------+----------------------+------------+--------------+ | PR001 | ElectroHouse | 3001234567 | Medellin | | PR002 | MegaElectro | 3012345678 | Bogota | | PR003 | HogarPlus | 3023456789 | Cali | | PR004 | TecnoElectro_Toyota | 3034567890 | Barranquilla | | PR005 | ElectroCenter | 3045678901 | Cartagena | | PR006 | HomeElectronics | 3056789012 | Pereira | | PR007 | TotalElectro | 3067890123 | Bucaramanga | | PR008 | ElectroService | 3078901234 | Santa Marta | | PR009 | ElectroDistribuidora | 3089012345 | Manizales | | PR010 | ElectroTienda | 3090123456 | Ibagu‚ | +--------------+----------------------+------------+--------------+ 10 rows in set (0.000 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.006 sec) MariaDB [inventario]> select id_producto, nombre, disponible from producto where Disponible < 50; +-------------+----------------------+------------+ | id_producto | nombre | disponible | +-------------+----------------------+------------+ | P0011 | Refrigerador Toyota | 0 | | P002 | Lavadora | 30 | | P007 | Televisor | 40 | +-------------+----------------------+------------+ 3 rows in set (0.001 sec) MariaDB [inventario]> select * from Detalles_Venta; +----------------+------------------+----------+-------------+ | id_detalleVent | Cantidad_vendida | FK_venta | FK_producto | +----------------+------------------+----------+-------------+ | DV001 | 2 | V001 | P001 | | DV002 | 1 | V002 | P002 | | DV003 | 3 | V003 | P003 | | DV004 | 2 | V004 | P004 | | DV005 | 1 | V005 | P005 | | DV006 | 2 | V006 | P006 | | DV007 | 1 | V007 | P007 | | DV008 | 4 | V008 | P008 | | DV009 | 2 | V009 | P009 | | DV010 | 3 | V010 | P010 | +----------------+------------------+----------+-------------+ 10 rows in set (0.001 sec) MariaDB [inventario]> select id_detalleVent, Cantidad_vendida, FK_venta, FK_producto from Detalles_Venta where FK_producto in(select id_producto from producto > 1000000); 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 '> 1000000)' at line 1 MariaDB [inventario]> select id_detalleVent, Cantidad_vendida, FK_venta, FK_producto from Detalles_Venta where FK_producto in(select id_producto from producto where Precio_costo > 1000000); +----------------+------------------+----------+-------------+ | id_detalleVent | Cantidad_vendida | FK_venta | FK_producto | +----------------+------------------+----------+-------------+ | DV001 | 2 | V001 | P001 | | DV002 | 1 | V002 | P002 | | DV007 | 1 | V007 | P007 | +----------------+------------------+----------+-------------+ 3 rows in set (0.001 sec) MariaDB [inventario]> update producto set Precio_venta = Precio_costo + (Precio_costo * 0.25); Query OK, 11 rows affected (0.004 sec) Rows matched: 11 Changed: 11 Warnings: 0 MariaDB [inventario]> slect * from 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 'slect * from producto' at line 1 MariaDB [inventario]> select * from producto; +-------------+----------------------+--------------+--------------+------------+ | id_producto | Nombre | Precio_costo | Precio_venta | Disponible | +-------------+----------------------+--------------+--------------+------------+ | P001 | Refrigerador | 1500000 | 1875000 | 50 | | P0011 | Refrigerador Toyota | 2000000 | 2500000 | 0 | | P002 | Lavadora | 1200000 | 1500000 | 30 | | P003 | Microondas | 300000 | 375000 | 100 | | P004 | Horno | 700000 | 875000 | 60 | | P005 | Licuadora | 150000 | 187500 | 200 | | P006 | Aspiradora | 500000 | 625000 | 80 | | P007 | Televisor | 2000000 | 2500000 | 40 | | P008 | Ventilador | 80000 | 100000 | 150 | | P009 | Cafetera | 120000 | 150000 | 120 | | P010 | Plancha | 90000 | 112500 | 70 | +-------------+----------------------+--------------+--------------+------------+ 11 rows in set (0.001 sec) MariaDB [inventario]> select venta.id_venta, venta.Fecha, cliente.nombre AS nombre_cliente, producto.Nombre AS Nombre_producto, Detalles_Venta.Cantidad_vendida from ventas inner join cliente on venta.FK_cliente = cliente.id_cliente inner join Detalles_Venta on venta.id_venta = Detalles_Venta.FK_venta inner join producto on Detalles_Venta.FK_producto = producto.id_producto; ERROR 1146 (42S02): Table 'inventario.ventas' doesn't exist MariaDB [inventario]> select venta.id_venta, venta.Fecha, cliente.nombre AS nombre_cliente, producto.Nombre AS Nombre_producto, Detalles_Venta.Cantidad_vendida from venta inner join cliente on venta.FK_cliente = cliente.id_cliente inner join Detalles_Venta on venta.id_venta = Detalles_Venta.FK_venta inner join producto on Detalles_Venta.FK_producto = producto.id_producto; +----------+------------+-----------------+-----------------+------------------+ | id_venta | Fecha | nombre_cliente | Nombre_producto | Cantidad_vendida | +----------+------------+-----------------+-----------------+------------------+ | V001 | 2024-10-15 | Juan Perez | Refrigerador | 2 | | V002 | 2024-10-16 | Ana Martinez | Lavadora | 1 | | V003 | 2024-10-17 | Carlos Gomez | Microondas | 3 | | V004 | 2024-10-18 | Laura Rodriguez | Horno | 2 | | V005 | 2024-10-19 | Luis Fernandez | Licuadora | 1 | | V006 | 2024-10-20 | Marta Suarez | Aspiradora | 2 | | V007 | 2024-10-21 | David Ramirez | Televisor | 1 | | V008 | 2024-10-22 | Gloria Ortiz | Ventilador | 4 | | V009 | 2024-10-23 | Rosa Morales | Cafetera | 2 | | V010 | 2024-10-24 | Pedro Rios | Plancha | 3 | +----------+------------+-----------------+-----------------+------------------+ 10 rows in set (0.010 sec) MariaDB [inventario]> select * from ventas; ERROR 1146 (42S02): Table 'inventario.ventas' doesn't exist MariaDB [inventario]> select * from venta; +----------+------------+------------+ | id_venta | Fecha | FK_cliente | +----------+------------+------------+ | V001 | 2024-10-15 | C001 | | V002 | 2024-10-16 | C002 | | V003 | 2024-10-17 | C003 | | V004 | 2024-10-18 | C004 | | V005 | 2024-10-19 | C005 | | V006 | 2024-10-20 | C006 | | V007 | 2024-10-21 | C007 | | V008 | 2024-10-22 | C008 | | V009 | 2024-10-23 | C009 | | V010 | 2024-10-24 | C010 | +----------+------------+------------+ 10 rows in set (0.001 sec) MariaDB [inventario]> select * from cliente; +------------+-----------------+------------+--------------+ | id_cliente | Nombre | Telefono | Ciudad | +------------+-----------------+------------+--------------+ | C001 | Juan Perez | 3111234567 | Medellin | | C002 | Ana Martinez | 3122345678 | Bogota | | C003 | Carlos Gomez | 3133456789 | Cali | | C004 | Laura Rodriguez | 3144567890 | Barranquilla | | C005 | Luis Fernandez | 3155678901 | Medellin | | C006 | Marta Suarez | 3166789012 | Medellin | | C007 | David Ramirez | 3177890123 | Bogota | | C008 | Gloria Ortiz | 3188901234 | Santa Marta | | C009 | Rosa Morales | 3199012345 | Cali | | C010 | Pedro Rios | 3100123456 | Medellin | +------------+-----------------+------------+--------------+ 10 rows in set (0.001 sec) MariaDB [inventario]> select * from producto; +-------------+----------------------+--------------+--------------+------------+ | id_producto | Nombre | Precio_costo | Precio_venta | Disponible | +-------------+----------------------+--------------+--------------+------------+ | P001 | Refrigerador | 1500000 | 1875000 | 50 | | P0011 | Refrigerador Toyota | 2000000 | 2500000 | 0 | | P002 | Lavadora | 1200000 | 1500000 | 30 | | P003 | Microondas | 300000 | 375000 | 100 | | P004 | Horno | 700000 | 875000 | 60 | | P005 | Licuadora | 150000 | 187500 | 200 | | P006 | Aspiradora | 500000 | 625000 | 80 | | P007 | Televisor | 2000000 | 2500000 | 40 | | P008 | Ventilador | 80000 | 100000 | 150 | | P009 | Cafetera | 120000 | 150000 | 120 | | P010 | Plancha | 90000 | 112500 | 70 | +-------------+----------------------+--------------+--------------+------------+ 11 rows in set (0.001 sec) MariaDB [inventario]> show tables; +----------------------+ | Tables_in_inventario | +----------------------+ | cliente | | detalles_pedido | | detalles_venta | | pedidos_proveedores | | producto | | proveedores | | venta | +----------------------+ 7 rows in set (0.001 sec) MariaDB [inventario]> create table copia like cliente; Query OK, 0 rows affected (0.012 sec) MariaDB [inventario]> select * from cliente; +------------+-----------------+------------+--------------+ | id_cliente | Nombre | Telefono | Ciudad | +------------+-----------------+------------+--------------+ | C001 | Juan Perez | 3111234567 | Medellin | | C002 | Ana Martinez | 3122345678 | Bogota | | C003 | Carlos Gomez | 3133456789 | Cali | | C004 | Laura Rodriguez | 3144567890 | Barranquilla | | C005 | Luis Fernandez | 3155678901 | Medellin | | C006 | Marta Suarez | 3166789012 | Medellin | | C007 | David Ramirez | 3177890123 | Bogota | | C008 | Gloria Ortiz | 3188901234 | Santa Marta | | C009 | Rosa Morales | 3199012345 | Cali | | C010 | Pedro Rios | 3100123456 | Medellin | +------------+-----------------+------------+--------------+ 10 rows in set (0.001 sec) MariaDB [inventario]> select * from copia; Empty set (0.005 sec) MariaDB [inventario]> describe copia; +------------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +------------+-------------+------+-----+---------+-------+ | id_cliente | varchar(20) | NO | PRI | NULL | | | Nombre | varchar(45) | NO | | NULL | | | Telefono | varchar(45) | NO | | NULL | | | Ciudad | varchar(45) | NO | | NULL | | +------------+-------------+------+-----+---------+-------+ 4 rows in set (0.022 sec) MariaDB [inventario]> show tables; +----------------------+ | Tables_in_inventario | +----------------------+ | cliente | | copia | | detalles_pedido | | detalles_venta | | pedidos_proveedores | | producto | | proveedores | | venta | +----------------------+ 8 rows in set (0.001 sec) MariaDB [inventario]> insert into copia select * from cliente where month(ciudad)="Medellin"; Query OK, 0 rows affected, 10 warnings (0.001 sec) Records: 0 Duplicates: 0 Warnings: 10 MariaDB [inventario]> select * from copia; Empty set (0.000 sec) MariaDB [inventario]> select * from copia; Empty set (0.000 sec) MariaDB [inventario]> insert into copia select * from cliente where month(Ciudad)="Medellin"; Query OK, 0 rows affected, 10 warnings (0.001 sec) Records: 0 Duplicates: 0 Warnings: 10 MariaDB [inventario]> select * from copia; Empty set (0.000 sec) MariaDB [inventario]>