https://www.codechef.com/ide create table Ventas( id_prod int, cantidad int, fecha timestamp ); insert into Ventas values (1, 2, '2020/12/01 8:01:00'), (2, 5, '2020/12/01 10:15:00'), (2, 4, '2020/12/01 13:34:00'), (1, 3, '2020/12/01 21:56:00'); select * from Ventas; create table Productos( id_prod int, descripcion text, precio float(9,2), precioVenta float(9,2) ); insert into Productos values (1, 'Cigarros', 25.5, 30.0), (2, 'Refresco', 4.5, 6.0); select * from Productos; select Ventas.fecha, Ventas.cantidad, Productos.descripcion, Productos.precioVenta, (Ventas.cantidad * Productos.precioVenta) from Ventas INNER JOIN Productos ON Ventas.id_prod=Productos.id_prod;