On Friday 04 April 2003 15:37, Grégoire Dubois wrote:

> In the following table, I declare ID as a PRIMARY KEY.  Is it then
> necessary to add the parameters NOT NULL AUTO_INCREMENT?
>
> CREATE TABLE company (
>     ID INT NOT NULL AUTO_INCREMENT,
>
>     name VARCHAR(30),
>
>     admin_ID INT,
>
>     PRIMARY KEY ID,
>     INDEX admin_ID,
> );
>
> Or can I just declare the table like that? Does creating a primary key
> on an int immediatly involve this one to be not null, and to
> auto-incrИment?

NOT NULL - yes, but if you want to have AUTO_INCREMENT column you should 
declare it as AUTO_INCREMENT.


-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Victoria Reznichenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
       <___/   www.mysql.com





-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to