-
Normalized
I have an item, any item has type, any type has several attibutes, any attribute not common with other type of item,,,
How can I normalize this item?
Example:
Item(Item#, Item_Type, Item_Type1_Attribute1, Item_Type1_Attribute2, Item_Type1_Attribute3, Item_Type2_Attribute1, Item_Type2_Attribute2,
Item_Type3_Attribute1)
Item(1,A,A1,A2,A3,null,null,null)
Item(1,B,null,null,null,B1,B2,null)
Item(1,C,null,null,null,null,null,C1)
-
3NF
If the type attributes are dependent on the item type and not the item, then there should be an ITEM_TYPE entity. The relationship would be an ITEM has zero or many ITEM_TYPEs.
3NF ~ the key, the whole key, and nothing but the key, so help me Codd.
David Knight
OCP DBA 8i, 9i, 10g
-
Thank you dknight,,,
But, what are the attributes of ITEM_TYPE entity?
Last edited by abcd; 12-20-2002 at 12:35 AM.
-
In general, the attributes that are dependent upon the ITEM key belong in the ITEM entity.
The attribute that are dependent on the ITEM_TYPE key should go in the ITEM_TYPE entity.
David Knight
OCP DBA 8i, 9i, 10g
-
You're mean:
Item(Item#, Item_Type, Item_Type1_Attribute1, Item_Type1_Attribute2, Item_Type1_Attribute3, Item_Type2_Attribute1, Item_Type2_Attribute2,
Item_Type3_Attribute1)
Item(1,A,A1,A2,A3,null,null,null)
Item(1,B,null,null,null,B1,B2,null)
Item(1,C,null,null,null,null,null,C1)
ITEM_TYPE_A(Item_Type,Item_Type_A_Attribute1, Item_Type_A_Attribute2, Item_Type_A_Attribute3)
ITEM_TYPE_B(Item_Type,Item_Type_B_Attribute1, Item_Type_B_Attribute2)
ITEM_TYPE_C(Item_Type,Item_Type_C_Attribute1)
Beacase every attribute has a different data type,,,
Is it right or No ?
-
Are the item_type attributes based on the item or on the item_type?
David Knight
OCP DBA 8i, 9i, 10g
-
Oops, Sorry,,,
The item_type attributes based on the item,,,
Item(Item#, Item_Type, Item_Type1_Attribute1, Item_Type1_Attribute2, Item_Type1_Attribute3, Item_Type2_Attribute1, Item_Type2_Attribute2,
Item_Type3_Attribute1)
Item(1,A,A1,A2,A3,null,null,null)
Item(1,B,null,null,null,B1,B2,null)
Item(1,C,null,null,null,null,null,C1)
ITEM_TYPE_A(Item#,Item_Type_A_Attribute1, Item_Type_A_Attribute2, Item_Type_A_Attribute3)
ITEM_TYPE_B(Item#,Item_Type_B_Attribute1, Item_Type_B_Attribute2)
ITEM_TYPE_C(Item#,Item_Type_C_Attribute1)
-
And every attribute reference to another table.
By other words, every attribute is the foriegn key reference to the primary key on other table.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|