> Actually there was no problem. I just saw the terms "primary key" and > "foreign key" and wasn't clear on what they meant. I have seen table > layouts where people have a table just containing keys and couldn't figure > out why.
A primary key is just a unique identifer for a table record. A foreign key is the primary key of one table included as a field in another table to establish a relationship between the two tables. Sometimes it's necessary to create what's known as an intersection table if the relationship between two tables is many-to-many. That type of table could well include only the keys from the other two tables. > So you are saying that my query is actually an INNER JOIN?? That was the > next thing I had to come to grips with - Inner and outer joins. I've read > the part in the SQL book I have where it explains what inner and outer joins > are and its been double-dutch to me the first 5 times through. Yes, you are doing an inner join using Transact-SQL syntax. An inner join will only return records from the joined tables that have matching primary/foreign keys. An outer join will return *all* records from the starting table regardless of whether or not there are matching primary/foreign keys. ______________________________________________________________________ Get the mailserver that powers this list at http://www.coolfusion.com Archives: http://www.mail-archive.com/[email protected]/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
