Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
CHAPTER 7 Keys More than one John Doe Which is the right Customer? Recall by the key There is a lot of data out there, but how do you sift through it all to find what you're looking for? That's where keys come in. Keys allow us to efficiently retrieve data, as well as navigate from one physical table to another. This chapter defines keys and distinguishes between the terms candidate, primary, and alternate keys. Surrogate keys and foreign keys and their importance are also explained. Examples of how to leverage keys in CA ERwin Data Modeler are included. Key Explanation Data elements identify, describe, or measure the entity instances in which they reside. There is often a need to find specific entity instances using one or more data elements. Those data element(s) that allow us to find specific entity instances are known as keys. The Library of Congress assigns an ISBN (International Standard Book Number) to every book. When the ISBN for this book, 9781935504092, is entered into many search engines and database systems, the book entity instance Data Modeling Made Simple with CA ERwin Data Modeler r8 will be returned (try it!). A particular Tax Identifier can help us find an organization. The key Account Code can help us find a particular account. Candidate Key A candidate key is one or more data elements that uniquely identify an entity instance. Sometimes a single data element identifies an entity instance, such as ISBN for a book, or Account Code for an account. Sometimes it takes more than one data element to uniquely identify an entity instance. For example, both a Promotion Code and Promotion Start Date are necessary to identify a promotion. When more than one data element makes up a key, we use the term `composite key'. So Promotion Code and Promotion Start Date together are a composite candidate key for a promotion. A candidate key has three main characteristics: · Unique. There cannot be duplicate values in the data in a candidate key and it cannot be empty (also known as `nullable'). Therefore, the number of distinct values of a candidate key must be equal to the number of distinct entity 117