Thank you for that great explaination. I do have a few more questions in order to clear up all of my confusion.
1.)
Looking at the syntax to create a table, I see that you can reference to a table without necessarily saying that the column should be a foreign key.
Here are the 2 methods of referencing an external table using your telephone example:
create table phone_types (
phone_type_id int not null auto_increment,
...
);
---Method 1---
create table phone_numbers (
...
phone_type_id int not null references phone_types (phone_type_id)...,
...
);
---Method 2:---
create table phone_numbers (
...
phone_type_id int not null,
index (phone_type_id),
foreign key (phone_type_id) references phone_types(phone_type_id)...,
...
);
I suppose both of these are valid statements, so my question is what is the real advantage to using the foreign key syntax as opposed to the other. I am guessing the difference is that with a foreign key, the column must first be indexed.
2.)
what does [CONSTRAINT [symbol]]? I see that it is optional, but can be used in several places, including a foreign key definition.
3.)
do foreign keys have any affect on using the SELECT statement, specifically in using different types of table joins?
4.)
One last question, this has nothing to do with foreign keys. I have always wondered whether you could do a join between 2 tables that are in 2 separate databases. Is this possible?
-- Once Again, I appreciate all your help