'Database/Database 기초'에 해당되는 글 1건

Database Key 정의

Database/Database 기초

▶ Key

개체에서 유일하게 식별토록하는 하나이상의 속성

A key is one or more data attributes that uniquely identify an entity


▶ Composite key

두개 이상의 속성으로 구성된 키

A key that is composed of two or more attributes. 


▶ Natural key

실제 비즈니스상에서 사용되어지는 속성으로 구성된 키

ex) 주민번호

A key that is formed of attributes that already exist in the real world.  

For example, U.S. citizens are issued a Social Security Number (SSN)  that is unique to them (this isn't guaranteed to be true, but it's pretty darn close in practice).  

SSN could be used as a natural key, assuming privacy laws allow it, for a Person entity (assuming the scope of your organization is limited to the U.S.). 


▶ Surrogate key

비즈니스상에서는 의미를 지니고 있지 않는 키

A key with no business meaning.


▶ Candidate key

논리적 데이터 모형에서의 개체타입은 0개 이상의 후보키를 가지고 있지만, 한편으로는 유일 식별자를 가질 수 있다.

An entity type in a logical data model will have zero or more candidate keys, 

also referred to simply as unique identifiers (note: some people don't believe in identifying candidate keys in LDMs, so there's no hard and fast rules). 

For example, if we only interact with American citizens then SSN is one candidate key for the Person entity type 

and the combination of name and phone number (assuming the combination is unique) is potentially a second candidate key. 

Both of these keys are called candidate keys because they are candidates to be chosen as the primary key, 

an alternate key or perhaps not even a key at all within a physical data model. 


▶ Primary key

개체타입에서 참조되는 키

The preferred key for an entity type.


▶ Alternate key

잘 알려진 부차적 키로서, 테이블 내 행에서 또다른 유일 식별자 

Also known as a secondary key, is another unique identifier of a row within a table. 


▶ Foreign key

개체타입내에서 하나이상의 속성으로, 다른 개체타입 내에서 우선적 또는 부차적으로 대표되는 키

One or more attributes in an entity type that represents a key, either primary or secondary, in another entity type.


▶ 출처

http://www.agiledata.org/essays/keys.html