-
I'm very much a newbie to MySQL and haven't been able to successfully install it on my W2K machine yet so I have now way of testing this syntax. At any rate, I am helping a friend who has very little database experiance, but is working in MySQL. Am I on the right track?
create table churches (
church_ID int not null auto_increment,
primary key(church_ID),
index(index_church_ID),
church_name varchar(23) not null,
church_address varchar(18) not null,
church_city varchar(13) not null,
church_state varchar(2) not null,
church_zip varchar(5) not null,
church_phone varchar(12) not null,
church_fax varchar(12),
church_email varchar(13),
church_contact varchar(13)
);
create table users (
user_ID int not null auto_increment,
primary key(user_ID),
index(index_user_ID),
church_ID foreign key(index_church_ID),
more data....
);
-
Looks fine except for when defining an index, just use "index(column_name)", without "index_" in front of the column name. I tested it (by creating one of your tables on my machine), and, as long as I leave out the "index_", it creates a new table just fine.
-