How can I create a small relational database in MySQL?

Posted by Sergio Tapia on Stack Overflow See other posts from Stack Overflow or by Sergio Tapia
Published on 2010-06-01T20:41:41Z Indexed on 2010/06/01 20:43 UTC
Read the original article Hit count: 264

Filed under:
|

I need to make a small database in MySQL that has two tables.

Clothes and ClotheType

Clothes has: ID, Name, Color, Brand, Price, ClotheTypeID ClotheType has: ID, Description

In Microsoft SQL it would be:

create table Clothes(
id int,
primary key(id),
name varchar(200),
color varchar(200),
brand varchar(200),
price varchar(200),
clothetypeid int,
foreign key clothetypeid references ClotheType(id)
)

I need this in MySQL.

© Stack Overflow or respective owner

Related posts about mysql

Related posts about foreign-keys