· 8 years ago · Mar 04, 2018, 01:58 PM
1drop table if exists products;
2
3create table products (
4 id int not null auto_increment,
5 title varchar(100) not null,
6 description text not null,
7 tracklisting text not null,
8 cd_cover_url varchar(200) not null,
9 genre_id int not null,
10 price decimal(10,2) not null,
11 date_available datetime not null,
12 constraint fk_products_genres foreign key (genre_id) references genre(id),
13 primary key (id)
14 );
15
16create table genres (
17 id int not null auto_increment,
18 name varchar(100) not null default '',
19 primary key (id)
20 )