how to include in a table (orders) several records of another table (products)

0

Hello is my first question on this site, first of all I am new in the world of programming and others, my problem is that I have a table orders and another table products, the problem is that I do not know how they have to be related tables among them (in the orders table there is a column that is product_id which is the station table of the product table (idproduct) and this column product_id in the orders table is the FK of idproduct in product table) for when in java I make a query to the basis of data and I need to fill some objects with these attributes:

public class Pedidos{
int idPedido;  
ArrayList <Producto> productos;
}

What I do not understand is the form of the database and tables, who can give me a hand I thank you in advance, greetings.

    
asked by cesar 23.10.2018 в 18:59
source

0 answers