Normal Form Definitions & ExamplesFrom Codd & Date____________________ การแปล - Normal Form Definitions & ExamplesFrom Codd & Date____________________ ไทย วิธีการพูด

Normal Form Definitions & ExamplesF

Normal Form Definitions & Examples
From Codd & Date
________________________________________
1NF A relation R is in first normal form (1NF) if and only if all underlying domains contain atomic values only
Example: 1NF but not 2NF
FIRST (supplier_no, status, city, part_no, quantity)
Functional Dependencies:
(supplier_no, part_no)  quantity
(supplier_no)  status
(supplier_no)  city
city  status (Supplier's status is determined by location)
Comments:
Non-key attributes are not mutually independent (city  status).
Non-key attributes are not fully functionally dependent on the primary key (i.e., status and city are dependent on just part of the key, namely supplier_no).
Anomalies:
INSERT: We cannot enter the fact that a given supplier is located in a given city until that supplier supplies at least one part (otherwise, we would have to enter a null value for a column participating in the primary key C a violation of the definition of a relation).
DELETE: If we delete the last (only) row for a given supplier, we lose the information that the supplier is located in a particular city.
UPDATE: The city value appears many times for the same supplier. This can lead to inconsistency or the need to change many values of city if a supplier moves.
Decomposition (into 2NF):
SECOND (supplier_no, status, city)
SUPPLIER_PART (supplier_no, part_no, quantity)
________________________________________
2NF A relation R is in second normal form (2NF) if and only if it is in 1NF and every non-key attribute is fully dependent on the primary key
Example (2NF but not 3NF):
SECOND (supplier_no, status, city)
Functional Dependencies:
supplier_no  status
supplier_no  city
city  status
Comments:
Lacks mutual independence among non-key attributes.
Mutual dependence is reflected in the transitive dependencies: supplier_no  city, city  status.
Anomalies:
INSERT: We cannot record that a particular city has a particular status until we have a supplier in that city.
DELETE: If we delete a supplier which happens to be the last row for a given city value, we lose the fact that the city has the given status.
UPDATE: The status for a given city occurs many times, therefore leading to multiple updates and possible loss of consistency.
Decomposition (into 3NF):
SUPPLIER_CITY (supplier_no, city)
CITY_STATUS (city, status)
________________________________________
3NF A relation R is in third normal form (3NF) if and only if it is in 2NF and every non-key attribute is non-transitively dependent on the primary key. An attribute C is transitively dependent on attribute A if there exists an attribute B such that: A  B and B  C. Note that 3NF is concerned with transitive dependencies which do not involve candidate keys. A 3NF relation with more than one candidate key will clearly have transitive dependencies of the form: primary_key other_candidate_key  any_non-key_column
An alternative (and equivalent) definition for relations with just one candidate key is:
A relation R having just one candidate key is in third normal form (3NF) if and only if the non-key attributes of R (if any) are: 1) mutually independent, and 2) fully dependent on the primary key of R. A non-key attribute is any column which is not part of the primary key. Two or more attributes are mutually independent if none of the attributes is functionally dependent on any of the others. Attribute Y is fully functionally dependent on attribute X if X  Y, but Y is not functionally dependent on any proper subset of the (possibly composite) attribute X
For relations with just one candidate key, this is equivalent to the simpler:
A relation R having just one candidate key is in third normal form (3NF) if and only if no non-key column (or group of columns) determines another non-key column (or group of columns)
Example (3NF but not BCNF):
SUPPLIER_PART (supplier_no, supplier_name, part_no, quantity)
Functional Dependencies:
We assume that supplier_name's are always unique to each supplier. Thus we have two candidate keys:
(supplier_no, part_no) and (supplier_name, part_no)
Thus we have the following dependencies:
(supplier_no, part_no)  quantity
(supplier_no, part_no)  supplier_name
(supplier_name, part_no)  quantity
(supplier_name, part_no)  supplier_no
supplier_name  supplier_no
supplier_no  supplier_name
Comments:
Although supplier_name  supplier_no (and vice versa), supplier_no is not a non-key column — it is part of the primary key! Hence this relation technically satisfies the definition(s) of 3NF (and likewise 2NF, again because supplier_no is not a non-key column).
Anomalies:
INSERT: We cannot record the name of a supplier until that supplier supplies at least one part.
DELETE: If a supplier temporarily stops supplying and we delete the last row for that supplier, we lose the supplier's name.
UPDATE: If a supplier changes name, that change will have to be made to multiple rows (wasting resources and risking loss of consistency).
Decomposition (into BCNF):
SUPPLIER_ID (supplier_no, supplier_name)
SUPPLIER_PARTS (supplier_no, part_no, quantity)
________________________________________
BCNF A relation R is in Boyce-Codd normal form (BCNF) if and only if every determinant is a candidate key
The definition of BCNF addresses certain (rather unlikely) situations which 3NF does not handle. The characteristics of a relation which distinguish 3NF from BCNF are given below. Since it is so unlikely that a relation would have these characteristics, in practical real-life design it is usually the case that relations in 3NF are also in BCNF. Thus many authors make a "fuzzy" distinction between 3NF and BCNF when it comes to giving advice on "how far" to normalize a design. Since relations in 3NF but not in BCNF are slightly unusual, it is a bit more difficult to come up with meaningful examples. To be precise, the definition of 3NF does not deal with a relation that:
1. has multiple candidate keys, where
2. those candidate keys are composite, and
3. the candidate keys overlap (i.e., have at least one common attribute)
Example:
An example of a relation in 3NF but not in BCNF (and exhibiting the three properties listed) was given above in the discussion of 3NF. The following relation is in BCNF (and also in 3NF):
SUPPLIERS (supplier_no, supplier_name, city, zip)
We assume that each supplier has a unique supplier_name, so that supplier_no and supplier_name are both candidate keys.
Functional Dependencies:
supplier_no  city
supplier_no  zip
supplier_no  supplier_name
supplier_name  city
supplier_name  zip
supplier_name  supplier_no
Comments:
The relation is in BCNF since both determinants (supplier_no and supplier_name) are unique (i.e., are candidate keys).
The relation is also in 3NF since even though the non-primary-key column supplier_name determines the non-key columns city and zip, supplier_name is a candidate key. Transitive dependencies involving a second (or third, fourth, etc.) candidate key in addition to the primary key do not violate 3NF.
Note that even relations in BCNF can have anomalies.
Anomalies:
INSERT: We cannot record the city for a supplier_no without also knowing the supplier_name
DELETE: If we delete the row for a given supplier_name, we lose the information that the supplier_no is associated with a given city.
UPDATE: Since supplier_name is a candidate key (unique), there are none.
Decomposition:
SUPPLIER_INFO (supplier_no, city, zip)
SUPPLIER_NAME (supplier_no, supplier_name)

Written by Larry Newcomer (Updated January 06, 2000 )
0/5000
จาก: -
เป็น: -
ผลลัพธ์ (ไทย) 1: [สำเนา]
คัดลอก!
Normal Form Definitions & Examples
From Codd & Date
________________________________________
1NF A relation R is in first normal form (1NF) if and only if all underlying domains contain atomic values only
Example: 1NF but not 2NF
FIRST (supplier_no, status, city, part_no, quantity)
Functional Dependencies:
(supplier_no, part_no)  quantity
(supplier_no)  status
(supplier_no)  city
city  status (Supplier's status is determined by location)
Comments:
Non-key attributes are not mutually independent (city  status).
Non-key attributes are not fully functionally dependent on the primary key (i.e., status and city are dependent on just part of the key, namely supplier_no).
Anomalies:
INSERT: We cannot enter the fact that a given supplier is located in a given city until that supplier supplies at least one part (otherwise, we would have to enter a null value for a column participating in the primary key C a violation of the definition of a relation).
DELETE: If we delete the last (only) row for a given supplier, we lose the information that the supplier is located in a particular city.
UPDATE: The city value appears many times for the same supplier. This can lead to inconsistency or the need to change many values of city if a supplier moves.
Decomposition (into 2NF):
SECOND (supplier_no, status, city)
SUPPLIER_PART (supplier_no, part_no, quantity)
________________________________________
2NF A relation R is in second normal form (2NF) if and only if it is in 1NF and every non-key attribute is fully dependent on the primary key
Example (2NF but not 3NF):
SECOND (supplier_no, status, city)
Functional Dependencies:
supplier_no  status
supplier_no  city
city  status
Comments:
Lacks mutual independence among non-key attributes.
Mutual dependence is reflected in the transitive dependencies: supplier_no  city, city  status.
Anomalies:
INSERT: We cannot record that a particular city has a particular status until we have a supplier in that city.
DELETE: If we delete a supplier which happens to be the last row for a given city value, we lose the fact that the city has the given status.
UPDATE: The status for a given city occurs many times, therefore leading to multiple updates and possible loss of consistency.
Decomposition (into 3NF):
SUPPLIER_CITY (supplier_no, city)
CITY_STATUS (city, status)
________________________________________
3NF A relation R is in third normal form (3NF) if and only if it is in 2NF and every non-key attribute is non-transitively dependent on the primary key. An attribute C is transitively dependent on attribute A if there exists an attribute B such that: A  B and B  C. Note that 3NF is concerned with transitive dependencies which do not involve candidate keys. A 3NF relation with more than one candidate key will clearly have transitive dependencies of the form: primary_key other_candidate_key  any_non-key_column
An alternative (and equivalent) definition for relations with just one candidate key is:
A relation R having just one candidate key is in third normal form (3NF) if and only if the non-key attributes of R (if any) are: 1) mutually independent, and 2) fully dependent on the primary key of R. A non-key attribute is any column which is not part of the primary key. Two or more attributes are mutually independent if none of the attributes is functionally dependent on any of the others. Attribute Y is fully functionally dependent on attribute X if X  Y, but Y is not functionally dependent on any proper subset of the (possibly composite) attribute X
For relations with just one candidate key, this is equivalent to the simpler:
A relation R having just one candidate key is in third normal form (3NF) if and only if no non-key column (or group of columns) determines another non-key column (or group of columns)
Example (3NF but not BCNF):
SUPPLIER_PART (supplier_no, supplier_name, part_no, quantity)
Functional Dependencies:
We assume that supplier_name's are always unique to each supplier. Thus we have two candidate keys:
(supplier_no, part_no) and (supplier_name, part_no)
Thus we have the following dependencies:
(supplier_no, part_no)  quantity
(supplier_no, part_no)  supplier_name
(supplier_name, part_no)  quantity
(supplier_name, part_no)  supplier_no
supplier_name  supplier_no
supplier_no  supplier_name
Comments:
Although supplier_name  supplier_no (and vice versa), supplier_no is not a non-key column — it is part of the primary key! Hence this relation technically satisfies the definition(s) of 3NF (and likewise 2NF, again because supplier_no is not a non-key column).
Anomalies:
INSERT: We cannot record the name of a supplier until that supplier supplies at least one part.
DELETE: If a supplier temporarily stops supplying and we delete the last row for that supplier, we lose the supplier's name.
UPDATE: If a supplier changes name, that change will have to be made to multiple rows (wasting resources and risking loss of consistency).
Decomposition (into BCNF):
SUPPLIER_ID (supplier_no, supplier_name)
SUPPLIER_PARTS (supplier_no, part_no, quantity)
________________________________________
BCNF A relation R is in Boyce-Codd normal form (BCNF) if and only if every determinant is a candidate key
The definition of BCNF addresses certain (rather unlikely) situations which 3NF does not handle. The characteristics of a relation which distinguish 3NF from BCNF are given below. Since it is so unlikely that a relation would have these characteristics, in practical real-life design it is usually the case that relations in 3NF are also in BCNF. Thus many authors make a "fuzzy" distinction between 3NF and BCNF when it comes to giving advice on "how far" to normalize a design. Since relations in 3NF but not in BCNF are slightly unusual, it is a bit more difficult to come up with meaningful examples. To be precise, the definition of 3NF does not deal with a relation that:
1. has multiple candidate keys, where
2. those candidate keys are composite, and
3. the candidate keys overlap (i.e., have at least one common attribute)
Example:
An example of a relation in 3NF but not in BCNF (and exhibiting the three properties listed) was given above in the discussion of 3NF. The following relation is in BCNF (and also in 3NF):
SUPPLIERS (supplier_no, supplier_name, city, zip)
We assume that each supplier has a unique supplier_name, so that supplier_no and supplier_name are both candidate keys.
Functional Dependencies:
supplier_no  city
supplier_no  zip
supplier_no  supplier_name
supplier_name  city
supplier_name  zip
supplier_name  supplier_no
Comments:
The relation is in BCNF since both determinants (supplier_no and supplier_name) are unique (i.e., are candidate keys).
The relation is also in 3NF since even though the non-primary-key column supplier_name determines the non-key columns city and zip, supplier_name is a candidate key. Transitive dependencies involving a second (or third, fourth, etc.) candidate key in addition to the primary key do not violate 3NF.
Note that even relations in BCNF can have anomalies.
Anomalies:
INSERT: We cannot record the city for a supplier_no without also knowing the supplier_name
DELETE: If we delete the row for a given supplier_name, we lose the information that the supplier_no is associated with a given city.
UPDATE: Since supplier_name is a candidate key (unique), there are none.
Decomposition:
SUPPLIER_INFO (supplier_no, city, zip)
SUPPLIER_NAME (supplier_no, supplier_name)

Written by Larry Newcomer (Updated January 06, 2000 )
การแปล กรุณารอสักครู่..
ผลลัพธ์ (ไทย) 2:[สำเนา]
คัดลอก!
นิยามแบบปกติและตัวอย่าง
จาก Codd & วัน
________________________________________
1NF สัมพันธ์ R อยู่ในรูปแบบปกติแรก (1NF) และถ้าหากโดเมนพื้นฐานประกอบด้วยค่าอะตอมเพียง
ตัวอย่าง: 1NF แต่ไม่ 2NF
แรก (supplier_no สถานะเมือง part_no ปริมาณ )
การพึ่งพาการทำงาน:
(supplier_no, part_no) ปริมาณ
(supplier_no) สถานะ
(supplier_no) เมือง
เมืองสถานะ (สถานะของผู้ผลิตจะถูกกำหนดโดยสถานที่)
ความคิดเห็น:
คุณลักษณะไม่ที่สำคัญคือไม่ได้เป็นอิสระร่วมกัน (สถานะเมือง).
Non- คุณลักษณะที่สำคัญไม่ได้อย่างเต็มที่ทำงานขึ้นอยู่กับคีย์หลัก (เช่นสถานะและเมืองจะขึ้นอยู่กับเพียงส่วนหนึ่งของที่สำคัญคือ supplier_no).
ผิดปกติ:
INSERT: เราไม่สามารถเข้าสู่ความจริงที่ว่าผู้จัดจำหน่ายที่ได้รับการตั้งอยู่ในเมืองที่ได้รับจน ที่ให้ผู้จัดจำหน่ายอย่างน้อยส่วนหนึ่ง (มิฉะนั้นเราจะต้องป้อนค่า null สำหรับคอลัมน์ที่เข้าร่วมในคีย์หลัก C ละเมิดของคำนิยามของความสัมพันธ์).
ลบ: ถ้าเราลบสุดท้าย (เท่านั้น) แถว ผู้จัดจำหน่ายให้เราสูญเสียข้อมูลที่ผู้ผลิตตั้งอยู่ในเมืองโดยเฉพาะอย่างยิ่ง.
UPDATE: ค่าเมืองที่ปรากฏหลายครั้งสำหรับผู้ผลิตเดียวกัน นี้สามารถนำไปสู่ความไม่สอดคล้องหรือความต้องการที่จะเปลี่ยนค่าจำนวนมากของเมืองถ้าย้ายผู้จัดจำหน่าย.
สลายตัว (เป็น 2NF):
สอง (supplier_no สถานะเมือง)
SUPPLIER_PART (supplier_no, part_no ปริมาณ)
________________________________________
2NF สัมพันธ์ R คือปกติที่สอง รูปแบบ (2NF) และถ้าหากมันอยู่ใน 1NF และทุกแอตทริบิวต์ที่ไม่สำคัญเป็นอย่างขึ้นอยู่กับคีย์หลัก
ตัวอย่าง (2NF แต่ไม่ 3NF):
สอง (supplier_no สถานะเมือง)
พึ่งพาการทำงาน:
supplier_no สถานะ
supplier_no เมือง
เมืองสถานะ
ความคิดเห็น:
ขาดความเป็นอิสระซึ่งกันและกันในหมู่คุณลักษณะที่ไม่สำคัญ.
การพึ่งพาอาศัยซึ่งกันและกันสะท้อนให้เห็นในการอ้างอิงสกรรมกริยา. supplier_no เมืองเมืองสถานะ
ผิดปกติ:
INSERT: เราไม่สามารถบันทึกที่เมืองโดยเฉพาะอย่างยิ่งมีสถานะโดยเฉพาะอย่างยิ่งจนกว่าเราจะได้ ผู้จัดจำหน่ายในเมืองนั้น.
ลบ: ถ้าเราลบซัพพลายเออร์ซึ่งเกิดขึ้นเป็นแถวสุดท้ายสำหรับค่าเมืองให้เราสูญเสียความเป็นจริงว่าเป็นเมืองที่มีสถานะที่กำหนด.
UPDATE: สถานะสำหรับเมืองที่ได้รับเกิดขึ้นหลายครั้งจึง ที่นำไปสู่การปรับปรุงหลายและการสูญเสียที่เป็นไปได้ของความมั่นคง.
สลายตัว (เป็น 3NF):
SUPPLIER_CITY (supplier_no เมือง)
CITY_STATUS (เมืองสถานะ)
________________________________________
3NF R คือความสัมพันธ์ในรูปแบบปกติที่สาม (3NF) และถ้าหากมันอยู่ใน 2NF และ ทุกแอตทริบิวต์ที่ไม่สำคัญไม่เป็นสกรรมกริยาขึ้นอยู่กับคีย์หลัก แอตทริบิวต์ซีเป็นสกรรมกริยาขึ้นอยู่กับแอตทริบิวต์ถ้ามีแอตทริบิวต์ B ดังกล่าวว่า: B และ B  C. ทราบว่า 3NF ที่เกี่ยวข้องกับการอ้างอิงสกรรมกริยาซึ่งไม่เกี่ยวข้องกับผู้สมัครที่ปุ่ม ความสัมพันธ์ 3NF มีมากกว่าหนึ่งที่สำคัญผู้สมัครที่ชัดเจนจะมีการอ้างอิงสกรรมกริยาของรูปแบบ: primary_key other_candidate_key any_non-key_column
ทางเลือก (และเทียบเท่า) คำนิยามสำหรับความสัมพันธ์กับผู้สมัครที่สำคัญเพียงหนึ่งคือ
ความสัมพันธ์ R มีเพียงหนึ่งที่สำคัญของผู้สมัครคือ ในรูปแบบปกติที่สาม (3NF) และถ้าหากคุณลักษณะที่ไม่สำคัญการวิจัย (ถ้ามี): 1) ที่เป็นอิสระร่วมกันและ 2) ได้อย่างเต็มที่ขึ้นอยู่กับคีย์หลักของอาร์แอตทริบิวต์ที่ไม่สำคัญเป็นคอลัมน์ใด ๆ ที่ ไม่เป็นส่วนหนึ่งของคีย์หลัก คุณลักษณะที่สองหรือมากกว่ามีความเป็นอิสระร่วมกันถ้าไม่มีแอตทริบิวต์เป็นหน้าที่ขึ้นอยู่กับคนอื่น ๆ Attribute Y เป็นอย่างขึ้นอยู่กับหน้าที่แอตทริบิวต์ X ถ้า X  Y, Y แต่ไม่ได้ขึ้นอยู่กับหน้าที่เซตย่อยที่เหมาะสมใด ๆ (อาจจะประกอบ) แอตทริบิวต์ X
สำหรับความสัมพันธ์ที่มีเพียงหนึ่งที่สำคัญผู้สมัครนี้จะเทียบเท่ากับที่เรียบง่าย:
ความสัมพันธ์ R มีเพียงหนึ่งที่สำคัญผู้สมัครที่อยู่ในรูปแบบปกติที่สาม (3NF) และถ้าหากไม่มีคอลัมน์ที่ไม่สำคัญ (หรือกลุ่มของคอลัมน์) กำหนดคอลัมน์อื่นที่ไม่สำคัญ (หรือกลุ่มของคอลัมน์)
ตัวอย่าง (3NF แต่ไม่ BCNF):
SUPPLIER_PART ( supplier_no, supplier_name, part_no ปริมาณ)
การพึ่งพาการทำงาน:
เราคิดว่าของ supplier_name มักจะไม่ซ้ำกันในแต่ละผู้จัดจำหน่าย ดังนั้นเราจึงมีสองปุ่มผู้สมัคร:
(supplier_no, part_no) และ (supplier_name, part_no)
ดังนั้นเราจึงมีการอ้างอิงต่อไปนี้:
(supplier_no, part_no) ปริมาณ
(supplier_no, part_no)  supplier_name
(supplier_name, part_no) ปริมาณ
(supplier_name, part_no )  supplier_no
supplier_name  supplier_no
supplier_no  supplier_name
ความคิดเห็น:
แม้ว่า supplier_name  supplier_no (และในทางกลับกัน) supplier_no ไม่ได้เป็นคอลัมน์ที่ไม่สำคัญ - มันเป็นส่วนหนึ่งของคีย์หลัก! ดังนั้นความสัมพันธ์นี้ในทางเทคนิคตรงตามความหมาย (s) ของ 3NF (และเช่นเดียวกัน 2NF อีกครั้งเพราะ supplier_no ไม่ได้เป็นคอลัมน์ที่ไม่สำคัญ).
ผิดปกติ:
INSERT: เราไม่สามารถบันทึกชื่อของผู้ผลิตจนถึงผู้จัดจำหน่ายอุปกรณ์ว่าอย่างน้อยส่วนหนึ่ง
ลบ: ถ้าผู้จัดจำหน่ายชั่วคราวหยุดการจัดหาและการที่เราลบแถวสุดท้ายหาผู้จัดจำหน่ายที่เราสูญเสียชื่อของซัพพลายเออร์.
UPDATE: หากมีการเปลี่ยนแปลงผู้จัดจำหน่ายชื่อการเปลี่ยนแปลงที่จะต้องมีการทำกับหลายแถว (การสูญเสียทรัพยากรและเสี่ยงต่อการสูญเสียของความมั่นคง .)
การสลายตัว (เป็น BCNF):
supplier_id (supplier_no, supplier_name)
SUPPLIER_PARTS (supplier_no, part_no ปริมาณ)
________________________________________
BCNF สัมพันธ์ R คือใน Boyce-Codd รูปแบบปกติ (BCNF) และถ้าหากทุกปัจจัยที่เป็นผู้สมัครที่สำคัญ
ความหมายของ BCNF อยู่บางอย่าง (ค่อนข้างน่า) สถานการณ์ที่ 3NF ไม่ได้จัดการ ลักษณะของความสัมพันธ์ที่แตกต่างจาก 3NF BCNF จะได้รับดังนี้ ตั้งแต่มันจึงไม่น่าที่จะมีความสัมพันธ์กับลักษณะเหล่านี้ในการออกแบบการปฏิบัติในชีวิตจริงมันมักจะเป็นกรณีที่ความสัมพันธ์ใน 3NF ยังอยู่ใน BCNF ดังนั้นหลายคนเขียนทำให้ "เลือน" ความแตกต่างระหว่าง 3NF และ BCNF เมื่อมันมาถึงการให้คำแนะนำเกี่ยวกับ "วิธีการห่างไกล" ที่จะปรับการออกแบบ เนื่องจากความสัมพันธ์ใน 3NF แต่ไม่ได้อยู่ใน BCNF ผิดปกติเล็กน้อยมันเป็นบิตยากที่จะเกิดขึ้นกับตัวอย่างที่มีความหมาย จะแม่นยำนิยามของ 3NF ไม่ได้จัดการกับความสัมพันธ์ที่:
1 มีคีย์ผู้สมัครหลายที่
2 คีย์ผู้สมัครเหล่านั้นเป็นคอมโพสิตและ
3 คีย์ผู้สมัครทับซ้อนกัน (เช่นมีอย่างน้อยหนึ่งแอตทริบิวต์ร่วมกัน)
ตัวอย่าง:
ตัวอย่างของความสัมพันธ์ใน 3NF แต่ไม่ได้อยู่ใน BCNF (และการแสดงสามคุณสมบัติที่ระบุไว้) ได้รับข้างต้นในการอภิปรายของ 3NF ต่อไปนี้เป็นความสัมพันธ์ใน BCNF (และยังอยู่ใน 3NF):
ผู้จำหน่าย (supplier_no, supplier_name เมือง zip)
เราคิดว่าผู้ผลิตแต่ละคนมี supplier_name ไม่ซ้ำกันเพื่อให้ supplier_no และ supplier_name มีทั้งคีย์ผู้สมัคร.
พึ่งพาการทำงาน:
supplier_no เมือง
supplier_no ซิป
supplier_no  supplier_name
supplier_name เมือง
supplier_name ซิป
supplier_name  supplier_no
ความคิดเห็น:
ความสัมพันธ์อยู่ใน BCNF เนื่องจากทั้งสองปัจจัย (supplier_no และ supplier_name) จะไม่ซ้ำกัน (เช่นเป็นกุญแจผู้สมัคร).
ความสัมพันธ์ยังอยู่ใน 3NF ตั้งแต่แม้ว่าไม่ supplier_name คอลัมน์ -primary คีย์กำหนดคอลัมน์ที่ไม่สำคัญในเมืองและซิป supplier_name เป็นผู้สมัครที่สำคัญ สกรรมกริยาที่เกี่ยวข้องกับการอ้างอิงที่สอง (หรือสามสี่ ฯลฯ ) ที่สำคัญผู้สมัครที่นอกเหนือไปจากคีย์หลักไม่ละเมิด 3NF.
โปรดสังเกตว่าแม้ความสัมพันธ์ใน BCNF จะมีความผิดปกติ.
ผิดปกติ:
INSERT: เราไม่สามารถบันทึกเมืองสำหรับ supplier_no โดยไม่ต้อง นอกจากนี้ยังทราบว่า supplier_name
ลบ: ถ้าเราลบแถวสำหรับ supplier_name ให้เราสูญเสียข้อมูลที่ supplier_no มีความเกี่ยวข้องกับเมืองที่กำหนด.
UPDATE: ตั้งแต่ supplier_name เป็นกุญแจสำคัญของผู้สมัคร (ไม่ซ้ำกัน) ไม่มีใคร.
การสลายตัว:
SUPPLIER_INFO ( supplier_no เมือง zip)
supplier_name (supplier_no, supplier_name) เขียนโดยแลร์รี่ใหม่ (ปรับปรุง 6 มกราคม 2000)


การแปล กรุณารอสักครู่..
ผลลัพธ์ (ไทย) 3:[สำเนา]
คัดลอก!
รูปแบบปกติคำนิยาม&ตัวอย่าง


จากคอด&วันที่ ________________________________________ 1NF ความสัมพันธ์ R ในรูปแบบปกติ ( 1NF ) หากโดเมนที่ประกอบด้วยอะตอมเพียงตัวอย่างเท่านั้นค่า (
: 1NF แต่ไม่ใช่ประเทศ :
( supplier_no , สถานะ , เมือง , ปริมาณ part_no )
:
( supplier_no การอ้างอิงการทำงาน , part_no ) ปริมาณ
( supplier_no ) สถานะ ( supplier_no เมือง

)สถานะเมือง ( ซัพพลายเออร์ของสถานะจะถูกกำหนดโดยตำแหน่ง )

ไม่ใช่ความคิดเห็น : คุณลักษณะของคีย์จะไม่เป็นอิสระแก่กัน ( เมืองสถานะ ) .
ไม่ใช่คุณลักษณะของคีย์ได้ไม่เต็มที่ functionally ขึ้นอยู่กับคีย์หลัก ( เช่น สถานะ และเมืองจะขึ้นอยู่กับส่วนแค่ของคีย์คือ supplier_no
ความผิดปกติ : )
แทรก :เราไม่สามารถระบุว่าให้ผู้ผลิตตั้งอยู่ในเมืองจนซัพพลายเออร์วัสดุที่ได้รับอย่างน้อยหนึ่งส่วน ( มิฉะนั้นเราจะต้องระบุค่า null สำหรับคอลัมน์ที่เข้าร่วมในคีย์หลัก c การละเมิดของคำนิยามของความสัมพันธ์ ) .
ลบ : ถ้าเราลบสุดท้าย ( เท่านั้น ) แถวเพื่อให้ซัพพลายเออร์เราสูญเสียข้อมูลที่ผู้ผลิตตั้งอยู่ในเมืองโดยเฉพาะ
ปรับปรุง : ค่าเมืองปรากฏหลายครั้งสำหรับผู้ผลิตเดียวกัน นี้สามารถนำไปสู่ความไม่สอดคล้องกันหรือต้องเปลี่ยนค่านิยมหลายเมืองถ้าซัพพลายเออร์ย้าย การย่อยสลายในประเทศ : )
:
2 ( supplier_no , สถานะ , เมือง supplier_part ( supplier_no part_no )
, ,

________________________________________ ปริมาณ )ประเทศ : ความสัมพันธ์ R สองในรูปแบบปกติ ( ประเทศ : ) ถ้าและเพียงถ้ามันอยู่ใน 1NF และทุกแอตทริบิวต์ที่ไม่ใช่คีย์เป็นอย่างขึ้นอยู่กับตัวอย่างคีย์
หลัก ( ประเทศ : แต่ไม่ 3nf ) :
2 ( supplier_no , สถานะ , เมือง )
:
supplier_no การอ้างอิงการทำงานเมืองสถานะ

supplier_no เมือง ความคิดเห็นที่ : สถานะ

ขาดความเป็นอิสระซึ่งกันและกันระหว่างไม่สําคัญ
แอตทริบิวต์การพึ่งพาซึ่งกันและกัน สะท้อนออกมาในการพึ่งพาการ : supplier_no เมือง สถานะเมือง .
ความผิดปกติ :
แทรก : เราไม่สามารถบันทึกว่าเมืองใดมีฐานะโดยเฉพาะจนกระทั่งเรามีซัพพลายเออร์ในเมืองนั่น
ลบ : ถ้าเราลบ ซัพพลายเออร์ ซึ่งเกิดขึ้นเป็น แถวสุดท้ายเป็นค่าที่ให้เมือง เราแพ้ที่เมืองที่มีฐานะ .
ปรับปรุง :สถานะสำหรับการเมืองเกิดขึ้นหลายครั้ง จึงนำการปรับปรุงหลายและการสูญเสียที่เป็นไปได้ของความสอดคล้อง .
สลาย ( เป็น 3nf ) :
supplier_city ( supplier_no , เมือง )
city_status ( เมือง ) )

________________________________________3nf R สัมพันธ์อยู่ในฟอร์มปกติที่สาม ( 3nf ) ถ้าและเพียงถ้ามันอยู่ในประเทศ : และทุกแอตทริบิวต์ที่ไม่ใช่คีย์ไม่เกี่ยวกับการเปลี่ยนแปลงขึ้นอยู่กับคีย์หลัก แอตทริบิวต์ C เป็นสกรรมกริยาขึ้นอยู่กับคุณลักษณะ หากไม่มีแอตทริบิวต์ B เช่นที่ :  B และ B ซีทราบว่า 3nf เกี่ยวข้องกับการพึ่งพาซึ่งไม่เกี่ยวข้องกับกุญแจครับความสัมพันธ์ 3nf ที่มีมากกว่าหนึ่งคีย์ผู้สมัครจะชัดเจนมีการพึ่งพาของรูปแบบ : primary_key  other_candidate_key  any_non-key_column
ทางเลือก ( เทียบเท่า ) กุญแจเพียงหนึ่งผู้สมัครคำนิยามของความสัมพันธ์กับ :
R สัมพันธ์จะมีกุญแจเพียงหนึ่งในผู้สมัครเป็น 3 รูปแบบปกติ ( 3nf ) ถ้าและเพียงถ้าไม่ใช่คีย์ คุณลักษณะของ R ( ถ้ามี ) :1 ) เป็นอิสระแก่กันและกัน และ 2 ) อย่างเต็มที่ขึ้นอยู่กับคีย์หลักของ แอตทริบิวต์ที่ไม่ใช่คีย์ คอลัมน์ใด ๆที่ไม่ได้เป็นส่วนหนึ่งของคีย์หลัก สองคนหรือมากกว่าคุณสมบัติเป็นอิสระแก่กันและกัน ถ้าไม่มีคุณสมบัติจะขึ้นอยู่กับหน้าที่ใด ๆของผู้อื่น แอตทริบิวต์ Y เป็นอย่างขึ้นอยู่กับหน้าที่แอตทริบิวต์ x ถ้า x  Y ,แต่ Y ไม่ได้ขึ้นอยู่กับหน้าที่ใด ๆของชุดย่อยที่เหมาะสม ( อาจจะประกอบ ) แอตทริบิวต์ x
สำหรับความสัมพันธ์กับกุญแจเพียงหนึ่งตัวเลือกนี้จะเทียบเท่ากับที่เรียบง่าย :
R สัมพันธ์จะมีกุญแจเพียงหนึ่งในผู้สมัครเป็น 3 รูปแบบปกติ ( 3nf ) ถ้าและเพียงถ้าไม่มีคอลัมน์คีย์ ( หรือกลุ่มของคอลัมน์ ) เป็นตัวอื่นไม่ใช่คอลัมน์คีย์ ( หรือกลุ่มของคอลัมน์ )
ตัวอย่าง ( 3nf แต่ไม่ bcnf ) :
supplier_part ( supplier_no supplier_name part_no , ปริมาณ , การพึ่งพาการทำงาน : )

เราคิดว่า supplier_name ก็มักจะไม่ซ้ำกับผู้ผลิตแต่ละ ดังนั้นเราจึงมีคีย์ผู้สมัครสอง :
( supplier_no part_no ( supplier_name , และ , ดังนั้นเรา part_no )

( supplier_no การอ้างอิงต่อไปนี้ : ,  part_no ) ปริมาณ ( supplier_no
,
( supplier_name part_no )  supplier_name , 
part_no ) ปริมาณ( supplier_name part_no , )  supplier_no
supplier_name  supplier_no
supplier_no  supplier_name

แม้ว่าความคิดเห็น : supplier_name  supplier_no ( และในทางกลับกัน ) supplier_no ไม่ใช่ไม่ใช่คอลัมน์คีย์ - มันเป็นส่วนหนึ่งของคีย์หลัก ! ดังนั้นความสัมพันธ์นี้ในทางเทคนิคใดตรงกับคำนิยาม ( s ) ของ 3nf ( และประเทศ : เช่นเดียวกันอีกครั้ง เพราะ supplier_no ไม่ใช่ไม่ใช่คอลัมน์คีย์ )

ปกติ : แทรก :เราไม่สามารถบันทึกชื่อของซัพพลายเออร์ จนผู้ผลิตอุปกรณ์อย่างน้อยหนึ่งส่วน
ลบ : ถ้าซัพพลายเออร์ชั่วคราวหยุดขายและเราลบแถวสุดท้ายที่ซัพพลายเออร์ เราสูญเสียชื่อของซัพพลายเออร์
ปรับปรุง : ถ้าซัพพลายเออร์เปลี่ยนชื่อที่เปลี่ยนจะต้องเป็นหลายแถว ( เปลือง ทรัพยากรและเสี่ยงสูญเสียความสอดคล้อง )
(
bcnf ) : การย่อยสลายsupplier_id ( supplier_no supplier_name , )
supplier_parts ( supplier_no part_no , ปริมาณ )

________________________________________ bcnf R สัมพันธ์อยู่ใน Boyce Codd รูปแบบปกติ ( bcnf ) ถ้าและเพียงถ้าทุกปัจจัยเป็นคีย์คู่แข่ง
นิยามของ bcnf ที่อยู่แน่นอน ( ค่อนข้างยาก ) สถานการณ์ซึ่ง 3nf ไม่จัดการลักษณะของความสัมพันธ์ซึ่งแตกต่างจาก bcnf 3nf ได้รับด้านล่าง เนื่องจากมันเป็นดังนั้นยากที่ความสัมพันธ์จะมีลักษณะเหล่านี้ในการออกแบบจริงในทางปฏิบัติมันมักจะเป็นกรณีที่ความสัมพันธ์ใน 3nf ยังอยู่ใน bcnf . ดังนั้น ผู้เขียนหลายคนสร้าง " ความแตกต่างระหว่าง 3nf bcnf คลุมเครือ " และเมื่อมันมาเพื่อให้คำแนะนำเกี่ยวกับ " ว่า " ปกติแบบตั้งแต่ความสัมพันธ์ใน 3nf แต่ไม่ bcnf จะผิดปกติเพียงเล็กน้อย มันเป็นบิตยากขึ้นอย่างมีความหมาย พูดตรงๆคือนิยามของ 3nf ไม่ได้จัดการกับความสัมพันธ์ที่ :
1 มีแป้นผู้สมัครหลายที่
2 บรรดาผู้สมัครคีย์คอมโพสิตและ
3 ผู้สมัครคีย์ซ้อน ( เช่น มีอย่างน้อยหนึ่งที่พบแอตทริบิวต์ )

ตัวอย่าง :ตัวอย่างของความสัมพันธ์ใน 3nf แต่ไม่ bcnf ( และจัดแสดงสามคุณสมบัติที่ระบุไว้ข้างต้น ) ได้รับในการอภิปรายของ 3nf . ต่อไปนี้คือในความสัมพันธ์ bcnf ( และใน 3nf ) :
ซัพพลายเออร์ ( supplier_no supplier_name , , เมือง , รหัสไปรษณีย์ )
เราคิดว่าแต่ละซัพพลายเออร์มี supplier_name ที่เป็นเอกลักษณ์ เพื่อให้ supplier_no supplier_name ทั้งผู้สมัครและการอ้างอิงการทำงาน :

คีย์supplier_no เมือง

supplier_no ซิป supplier_no  supplier_name
supplier_name เมือง
supplier_name ซิป
supplier_name  supplier_no

ความคิดเห็น : ความสัมพันธ์ใน bcnf เนื่องจากทั้งสองปัจจัย ( supplier_no และ supplier_name ) ที่เป็นเอกลักษณ์ เช่น มีคีย์
ผู้สมัคร )ความสัมพันธ์อยู่ใน 3nf ตั้งแต่แม้ว่าไม่ใช่คีย์หลักจะไม่สําคัญ supplier_name คอลัมน์คอลัมน์เมืองและรหัสไปรษณีย์ supplier_name เป็นผู้สมัครหลัก ที่เกี่ยวข้องกับการพึ่งพาสอง ( สาม สี่ ฯลฯ ) ผู้สมัครที่สำคัญนอกเหนือไปจากคีย์หลักที่ไม่ละเมิด 3nf .
ทราบว่าแม้ความสัมพันธ์ใน bcnf จะมีความผิดปกติ ความผิดปกติ :

ใส่ :เราไม่สามารถบันทึกเมืองสำหรับ supplier_no โดยยังไม่ทราบ supplier_name
ลบ : ถ้าเราลบแถวให้ supplier_name เราสูญเสียข้อมูลที่ supplier_no เกี่ยวข้องกับให้เมือง .
ปรับปรุง : ตั้งแต่ supplier_name เป็นคีย์คู่แข่ง ( พิเศษ ) , ไม่มีการสลายตัว :
.
supplier_info ( supplier_no , เมือง , รหัสไปรษณีย์ supplier_name ( supplier_no )
,
supplier_name )เขียนโดย Larry ใหม่ ( อัพเดท 06 มกราคม , 2000 )
การแปล กรุณารอสักครู่..
 
ภาษาอื่น ๆ
การสนับสนุนเครื่องมือแปลภาษา: กรีก, กันนาดา, กาลิเชียน, คลิงออน, คอร์สิกา, คาซัค, คาตาลัน, คินยารวันดา, คีร์กิซ, คุชราต, จอร์เจีย, จีน, จีนดั้งเดิม, ชวา, ชิเชวา, ซามัว, ซีบัวโน, ซุนดา, ซูลู, ญี่ปุ่น, ดัตช์, ตรวจหาภาษา, ตุรกี, ทมิฬ, ทาจิก, ทาทาร์, นอร์เวย์, บอสเนีย, บัลแกเรีย, บาสก์, ปัญจาป, ฝรั่งเศส, พาชตู, ฟริเชียน, ฟินแลนด์, ฟิลิปปินส์, ภาษาอินโดนีเซี, มองโกเลีย, มัลทีส, มาซีโดเนีย, มาราฐี, มาลากาซี, มาลายาลัม, มาเลย์, ม้ง, ยิดดิช, ยูเครน, รัสเซีย, ละติน, ลักเซมเบิร์ก, ลัตเวีย, ลาว, ลิทัวเนีย, สวาฮิลี, สวีเดน, สิงหล, สินธี, สเปน, สโลวัก, สโลวีเนีย, อังกฤษ, อัมฮาริก, อาร์เซอร์ไบจัน, อาร์เมเนีย, อาหรับ, อิกโบ, อิตาลี, อุยกูร์, อุสเบกิสถาน, อูรดู, ฮังการี, ฮัวซา, ฮาวาย, ฮินดี, ฮีบรู, เกลิกสกอต, เกาหลี, เขมร, เคิร์ด, เช็ก, เซอร์เบียน, เซโซโท, เดนมาร์ก, เตลูกู, เติร์กเมน, เนปาล, เบงกอล, เบลารุส, เปอร์เซีย, เมารี, เมียนมา (พม่า), เยอรมัน, เวลส์, เวียดนาม, เอสเปอแรนโต, เอสโทเนีย, เฮติครีโอล, แอฟริกา, แอลเบเนีย, โคซา, โครเอเชีย, โชนา, โซมาลี, โปรตุเกส, โปแลนด์, โยรูบา, โรมาเนีย, โอเดีย (โอริยา), ไทย, ไอซ์แลนด์, ไอร์แลนด์, การแปลภาษา.

Copyright ©2024 I Love Translation. All reserved.

E-mail: