How to create tables with N:M relationship in MySQL?

Viewed 15809

Let's say I have this two tables: Store and Product. I want my store to have a list of products. How can I do that?

create table store(
id int unsigned not null auto_increment,
store_name varchar(30) not null,
product_list_FK int unsigned not null,
primary key(id)
);

create table product(
id int unsigned not null auto_increment,
product_name varchar(30) not null,
price float not null,
primary key(id)
);

I started something like that, but I don't know how to finish, can you guys help me?

2 Answers
Related