一寸大海 劫長之井

데이타 베이스 정규화. 본문

조각글

데이타 베이스 정규화.

하느바람 2016.09.15 14:37

Rules for normalized tables:

노말라이제이션 규칙.

1. Every row has the same number of columns.

1. 모든 열은 같은 숫자의 행을 가지고 있어야 한다. 
In practice, the database system won't let us literally have different numbers of columns in different rows. But if we have columns that are sometimes empty (null) and sometimes not, or if we stuff multiple values into a single field, we're bending this rule.
실제로, 데이터베이스 시스템은 각각의 행이 각기 다른 갯수의 열을 가지고 있을 수 없으며, 

The example to keep in mind here is the diet table from the zoo database. Instead of trying to stuff multiple foods for a species into a single row about that species, we separate them out. This makes it much easier to do aggregations and comparisons.

2. There is a unique key and everything in a row says something about the key.
2. 유니크 키와 모든 행은 연관 된 값을 가지고 있어야 한다. 

The key may be one column or more than one. It may even be the whole row, as in the diet table. But we don't have duplicate rows in a table.

More importantly, if we are storing non-unique facts — such as people's names — we distinguish them using a unique identifier such as a serial number. This makes sure that we don't combine two people's grades or parking tickets just because they have the same name.

3. Facts that don't relate to the key belong in different tables.
3. 키와 연관이 없는 사실은 다른 테이블에 위치해야 한다. 
The example here was the items table, which had items, their locations, and the location's street addresses in it. The address isn't a fact about the item; it's a fact about the location. Moving it to a separate table saves space and reduces ambiguity, and we can always reconstitute the original table using a join.

4. Tables shouldn't imply relationships that don't exist.
4. 테이블에 존재하지 않는 관계를 암시해서는 안된다. 
The example here was the job_skills table, where a single row listed one of a person's technology skills (like 'Linux') and one of their language skills (like 'French'). This made it look like their Linux knowledge was specific to French, or vice versa ... when that isn't the case in the real world. Normalizing this involved splitting the tech skills and job skills into separate tables.


출처 : Udatacity what's Nomalized. &  http://www.bkent.net/Doc/simple5.htm  // 요약,번역 할 것. // 영어공부 부터 할 것.

저작자 표시
신고

'조각글' 카테고리의 다른 글

데이타 베이스 정규화.  (0) 2016.09.15
0 Comments
댓글쓰기 폼
Prev 1 2 3 4 5 6 7 Next