Changes between Version 17 and Version 18 of Normalization


Ignore:
Timestamp:
09/24/26 10:07:24 (5 days ago)
Author:
201165
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Normalization

    v17 v18  
    4747
    4848{{{
    49 Чекор 0:  K+ = {comment_id, ingredient_id, nutrient_id, restriction_id, list_id, planner_id, bio_id}
    50 
    51 Чекор 1:  секој идентификатор го определува својот ентитет, па K+ ги добива атрибутите на COMMENT, INGREDIENT, NUTRIENT, RESTRICTION, GROCERY_LIST, INTAKE_PLANNER и BIOMETRICS, а со нив post_id и user_id (од comment_id) плус nutrient_amount и buy_quantity (од паровите што веќе се во K+).
    52 
    53 Чекор 2:  post_id сега е во K+, па ги додава атрибутите на POST и recipe_id; user_id додава email, username, password, role.
    54 
    55 Чекор 3:  recipe_id сега е во K+, па додава recipe_name, guide, kcal_sum, servings, а со {recipe_id, ingredient_id} и ingredient_quantity.
    56 
    57 Чекор 4:  едно цело поминување не додава ништо ново. K+ = R.
     49K = { comment_id, ingredient_id, nutrient_id, restriction_id, list_id, planner_id, bio_id }
     50}}}
     51
     52{{{
     53Чекор 0 - K+ = K:  comment_id, ingredient_id, nutrient_id, restriction_id, list_id, planner_id, bio_id
     54
     55Чекор 1 - секој идентификатор ја активира сопствената зависност:
     56comment_id → comment_text, comment_created_at, post_id, user_id;
     57ingredient_id → ingredient_name, ingr_description, energy, kcal, ingr_type;
     58nutrient_id → nutr_description, rdi_quantity, unit, nutr_type;
     59restriction_id → restr_description, restr_type;
     60list_id → list_date_time, list_notes, is_bought, list_kcal;
     61planner_id → planner_date_time, planner_notes, planner_kcal, is_consumed;
     62bio_id → bio_date, weight, height, age, muscle_fat_ratio;
     63{ingredient_id, nutrient_id} → nutrient_amount;
     64{list_id, ingredient_id} → buy_quantity
     65
     66Чекор 2 - post_id и user_id влегоа во K+ во чекор 1, па сега се активираат:
     67post_id → media, media_type, media_name, is_private, is_favourite, status, post_created_at, recipe_id;
     68user_id → email, username, password, role
     69
     70Чекор 3 - recipe_id влезе во K+ во чекор 2:
     71recipe_id → recipe_name, guide, kcal_sum, servings;
     72{recipe_id, ingredient_id} → ingredient_quantity
     73
     74Чекор 4 - цело поминување низ зависностите не додава ништо -> К+ = R
     75
    5876}}}
    5977Од тоа следи:
    … …  
    8098
    8199
    82 
    83 {{{
    84 K = { comment_id, ingredient_id, nutrient_id, restriction_id, list_id, planner_id, bio_id }
    85 }}}
    86 
    87100Атрибут што не се појавува на десната страна на ниедна функционална зависност никогаш не може да биде изведен, па мора да припаѓа на секој клуч. Пресметка на затворањето на K:
    88101* comment_id → post_id, user_id;  post_id → recipe_id;  recipe_id → атрибути на рецептот;  user_id → атрибути на корисникот
    … …  
    135148{user_id} → {email, username, password, role}
    136149}}}
     150Остаточна релација:
     151{{{
     152R′1 ( user_id, ingredient_id, ingredient_name, ingr_description, energy, kcal, ingr_type, nutrient_id, nutr_description, rdi_quantity, unit, nutr_type, restriction_id, restr_description, restr_type, recipe_id, recipe_name, guide, kcal_sum, servings, post_id, media, media_type, media_name, is_private, is_favourite, status, post_created_at, comment_id, comment_text, comment_created_at, list_id, list_date_time, list_notes, is_bought, list_kcal, planner_id, planner_date_time, planner_notes, planner_kcal, is_consumed, bio_id, bio_date, weight, height, age, muscle_fat_ratio, ingredient_quantity, nutrient_amount, buy_quantity )
     153}}}
     154
     155* lossless тест: R1 ∩ R′1 = {user_id}; {user_id} → R1
    137156
    138157||= user_id =||= email =||= username =||= password =||= role =||
    … …  
    147166{ingredient_id} → {ingredient_name, ingr_description, energy, kcal, ingr_type}
    148167}}}
     168Остаточна релација:
     169{{{
     170R′2 ( user_id, ingredient_id, nutrient_id, nutr_description, rdi_quantity, unit, nutr_type, restriction_id, restr_description, restr_type, recipe_id, recipe_name, guide, kcal_sum, servings, post_id, media, media_type, media_name, is_private, is_favourite, status, post_created_at, comment_id, comment_text, comment_created_at, list_id, list_date_time, list_notes, is_bought, list_kcal, planner_id, planner_date_time, planner_notes, planner_kcal, is_consumed, bio_id, bio_date, weight, height, age, muscle_fat_ratio, ingredient_quantity, nutrient_amount, buy_quantity )
     171}}}
     172* lossless тест: R2 ∩ R′2 = {ingredient_id}; {ingredient_id} → R2
     173
    149174
    150175||= ingredient_id =||= name =||= description =||= energy =||= kcal =||= type =||
    … …  
    158183{nutrient_id} → {nutr_description, rdi_quantity, unit, nutr_type}
    159184}}}
     185Остаточна релација:
     186
     187{{{
     188R′3 ( user_id, ingredient_id, nutrient_id, restriction_id, restr_description, restr_type, recipe_id, recipe_name, guide, kcal_sum, servings, post_id, media, media_type, media_name, is_private, is_favourite, status, post_created_at, comment_id, comment_text, comment_created_at, list_id, list_date_time, list_notes, is_bought, list_kcal, planner_id, planner_date_time, planner_notes, planner_kcal, is_consumed, bio_id, bio_date, weight, height, age, muscle_fat_ratio, ingredient_quantity, nutrient_amount, buy_quantity )
     189}}}
     190
     191
     192* lossless тест: R3 ∩ R′3 = {nutrient_id}; {nutrient_id} → R3
     193
    160194||= nutrient_id =||= description =||= quantity =||= unit=||= type =||
    161195|| 1 || Protein || 50 || gram || macro ||