List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:December 20 2002 8:03pm
Subject:Re: CREATE TABLE issue?
View as plain text  
At 17:13 +0000 12/20/02, Jeff Snoxell wrote:
>Hi again :)
>
>I found the following mysql stuff in the MySQL manual in a section 
>explaining how to do relationships.
>
>CREATE TABLE persons (
>     id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT,
>     name CHAR(60) NOT NULL,
>     PRIMARY KEY (id)
>);
>
>CREATE TABLE shirts (
>     id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT,
>     style ENUM('t-shirt', 'polo', 'dress') NOT NULL,
>     color ENUM('red', 'blue', 'orange', 'white', 'black') NOT NULL,
>     owner SMALLINT UNSIGNED NOT NULL REFERENCES persons,
>     PRIMARY KEY (id)
>);
>
>What's the point of the "REFERENCES persons" bit at the end of the 
>definition of table "Shirts"? It doesn't seem to do anything.

Right, you can leave it out.

Thread
CREATE TABLE issue?Jeff Snoxell20 Dec
  • Re: CREATE TABLE issue?Paul DuBois20 Dec
  • RE: CREATE TABLE issue?Adolfo Bello20 Dec