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)
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 ปริมาณ )
การแปล กรุณารอสักครู่..
