Adobe ColdFusion 8 Web Application Construction Kit, Volume 1: Getting Started
by Ben Forta, Raymond Camden, Charlie Arehart
Primary and Foreign Keys
Primary key is the database term for the column(s) that contains values that uniquely identify each row. A primary key is usually a single column, but doesn’t have to be.
There are only two requirements for primary keys:
Every row must have a value in the primary key. Empty fields, sometimes called null fields, are not allowed.
Primary key values can never be duplicated. If two movies were to have the same ID, all relationships would fail. In fact, most database applications prevent you from entering duplicate values in primary key fields.
When you are asked for a list of all expenses sorted by movie, you can instruct the database to build the relationship and retrieve the required data. The movie table is scanned in ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access