A relational database has three types of keys -- primary key, alternate key, and foreign key.

The primary key contains a value that is unique across all the rows in that table. If you know the primary-key value, you can single out one row in a table, no matter how many rows the table has. A single column that contains an ID number is the best kind of primary key to retrieve data quickly.

Sometimes there is a second way to identify a unique row in a table called an alternate key. This is a column or set of columns, just like the primary key.

A foreign key resides in one table, but is the key to a different table. The primary key of the connected table is kept in the foreign-key column in the other table. Got it? No? Ask the pooch for the details.

Want to know about foreign keys? A foreign key is in a table for only one reason: to connect the table to another table. Think of a foreign key like a foreign diplomat that represents an entire country. The foreign key represents the entire table. When you put a foreign key in a table, you make a link to all the information stored in the other table.

You should name the foreign-key column and the corresponding primary-key columns the same names. This clearly defines the relationship between the two. There are many software tools that generate SQL match tables reports by looking for identical column names.

Oh no! Are you confusing a key block with a primary key? The key block on most types of Banner forms is the first block and it contains key information about the form. Validation forms and some list forms do not have a key block, but for most Banner forms, this key block determines what is entered or displayed on the rest of the form. A primary key, on the other rabbit's foot, is a column or a set of columns in one table that uniquely identifies each row in the table.

so there!

Hey, I got a tip for you about primary keys: KISS! Keep It Small and Stupid.

Primary keys are carried in multiple tables -- people copy primary keys into other tables as alternate keys. Obviously, if the primary key column holds a four-digit number, that will take up a lot less space than a column that holds thirty-six digits.

Now, what do I mean about keeping your primary keys stupid? I mean this: intelligent keys store meaningful data in addition to being the primary key. A nonintelligent (or stupid) key has only one purpose: being the primary key for the table. Why is it smart to use a stupid key? Because if you have meaningful data in the primary key column, when that data changes, you have to change all the foreign keys that uses that primary key as a match.

Would you like to learn more about blocks?

Or maybe the key block?