Changes between Version 2 and Version 3 of Normalization


Ignore:
Timestamp:
08/29/25 15:16:50 (2 days ago)
Author:
185022
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Normalization

    v2 v3  
    11= Нормализација и подобрување на дизајн
    22
     3[[PageOutline]]
     4
    35== Определување функционални зависности
     6
    47R = {user_id, user_name, user_surname, user_pass, user_salt, user_email, user_mobile, user_active, user_image, clazz_, user_role, city_id, city_name, region_id, region_name, cust_EDB, cust_company_name, cust_adr, cust_representative_img, wh_id, wh_adr, veh_id, veh_carry_weight, veh_service_interval, veh_kilometers, veh_last_service, veh_last_service_km, veh_plate, veh_vin,veh_reg_date, ctg_id, ctg_name, man_id, man_name, man_adr, man_mobile, man_email, art_id, art_name, art_image, art_weight, price_id, price, price_eff_date, pf_id, pf_deadline, pf_date_created, pf_status_id, pf_status_name, pf_status_desc, del_id, del_date_created, del_date, del_start_km, del_end_km, del_start_time, del_end_time, d_status_id, d_status_name, d_status_desc, ord_id, ord_date, ord_sum, ord_fulfillment_date, ord_comment, o_status_id, o_status_name, o_status_desc, unit_id, unit_expiration_date, unit_serial_number, unit_batch_number, unit_manufacture_date, unit_cost_price, day_id, day_name, cust_day_id, start_time, end_time, t_id, t_value, t_date, t_type, t_expiry, t_validated_at, t_user, img_id, img_path, img_ent_type, img_ent_id}
    58
    69=== Функционални зависности
     10
    711==== Users and related entities
    812
     
    6468
    6569==== Order
     70
    6671ord_id → ord_date, ord_sum, ord_fulfillment_date, ord_comment, o_status_id, cust_id, del_id, pf_id
    6772
     
    6974
    7075==== Article unit
     76
    7177unit_id → unit_expiration_date, unit_serial_number, unit_batch_number, unit_manufacture_date, unit_cost_price, wh_id, ord_id
    7278
    7379==== Weekday
     80
    7481day_id → day_name
    7582
    7683==== Customer weekday
     84
    7785cust_day_id → cust_id, day_id, start_time, end_time
    7886
    7987==== Token
     88
    8089t_id → t_value, t_date, t_type, t_expiry, t_validated_at, t_user
    8190
    8291==== Image store
     92
    8393img_id → img_path, img_ent_type, img_ent_id
    8494
    8595=== Класификација на атрибути
     96
    8697==== Лево - атрибути кои одредуваат други
     98
    8799cust_day_id, price_id, pf_id, del_id, ord_id, unit_id, t_id, img_id
     100
    88101==== Лево и десно - атрибути кои одредуваат други и се одредени од други
     102
    89103user_id, city_id, region_id, wh_id, veh_id, ctg_id, man_id, art_id, d_status_id, o_status_id, pf_status_id, day_id
     104
    90105==== Десно - атрибути кои се одредени од други
     106
    91107user_name, user_surname, user_pass, user_salt, user_email, user_mobile, user_active, user_image,
    92108clazz_, user_role, city_name, region_name, cust_EDB, cust_company_name, cust_adr, cust_representative_img, wh_adr, veh_carry_weight, veh_service_interval, veh_kilometers,
     
    99115start_time, end_time, t_value, t_date, t_type, t_expiry, t_validated_at, t_user, img_path,
    100116img_ent_type, img_ent_id
     117
     118=== Покривачи на примарните клучеви
     119
     120==== Vehicle
     121
     122veh_id+ = {veh_id, veh_carry_weight, veh_service_interval, veh_kilometers, veh_last_service, veh_last_service_km, veh_plate, veh_vin, veh_reg_date, wh_id, wh_adr, city_id, city_name, region_id, region_name}
     123
     124==== User
     125
     126user_id+ = {user_id, user_name, user_surname, user_pass, user_salt, user_email, user_mobile, user_active, user_image, clazz_, user_role, city_id, city_name, region_id, region_name}
     127
     128* Ако тип на корисник е 'customer':
     129
     130*user_id+** += {cust_EDB, cust_company_name, cust_adr, cust_representative_img}
     131
     132* Ако тип на корисник е 'manager':
     133
     134**user_id+** += {wh_id, wh_adr}
     135
     136* Ако тип на корисник е 'driver':
     137
     138**user_id+** += {veh_id, veh_carry_weight, veh_service_interval, veh_kilometers, veh_last_service, veh_last_service_km, veh_plate, veh_vin, veh_reg_date, wh_id, wh_adr}
     139
     140==== Manufacturer
     141
     142man_id+ = {man_id, man_name, man_adr, man_mobile, man_email}
     143
     144==== Article
     145
     146art_id+ = {art_id, art_name, art_image, art_weight, ctg_id, ctg_name, man_id, man_name, man_adr, man_mobile, man_email}
     147
     148==== Price
     149
     150price_id+ = {price_id, price, price_eff_date, art_id, art_name, art_image, art_weight, ctg_id, ctg_name, man_id, man_name, man_adr, man_mobile, man_email}
     151
     152==== Pro-forma
     153
     154pf_id+ = {pf_id, pf_deadline, pf_date_created, pf_status_id, pf_status_name, pf_status_desc}
     155
     156==== Delivery
     157
     158del_id+ = {del_id, del_date_created, del_date, del_start_km, del_end_km, del_start_time, del_end_time, d_status_id, d_status_name, d_status_desc, veh_id, veh_carry_weight, veh_service_interval, veh_kilometers, veh_last_service, veh_last_service_km, veh_plate, veh_vin, veh_reg_date, wh_id, wh_adr, city_id, city_name, region_id, region_name}
     159
     160==== Order
     161
     162ord_id+ = {ord_id, ord_date, ord_sum, ord_fulfillment_date, ord_comment, o_status_id, o_status_name, o_status_desc, cust_id, del_id, pf_id, user_name, user_surname, user_pass, user_salt, user_email, user_mobile, user_active, user_image, clazz_, user_role, city_id, cust_EDB, cust_company_name, cust_adr, cust_representative_img, city_name, region_id, region_name, del_date_created, del_date, del_start_km, del_end_km, del_start_time, del_end_time, d_status_id, veh_id, d_status_name, d_status_desc, veh_carry_weight, veh_service_interval, veh_kilometers, veh_last_service, veh_last_service_km, veh_plate, veh_vin, veh_reg_date, wh_id, wh_adr,pf_deadline, pf_date_created, pf_status_id, pf_status_name, pf_status_desc}
     163
     164==== Article Unit
     165
     166unit_id+ = {unit_id, unit_expiration_date, unit_serial_number, unit_batch_number, unit_manufacture_date, unit_cost_price, wh_id, wh_adr, city_id, city_name, region_id, region_name, ord_id}
     167
     168* Ако ord_id не е null, исто така ги вклучува и:
     169unit_id+ += {ord_date, ord_sum, ord_fulfillment_date, ord_comment, o_status_id, o_status_name, o_status_desc, cust_id, del_id, pf_id,
     170
     171''и сите атрибути одредени од ord_id''
     172
     173}
     174
     175==== Композитен клуч - Article Unit и Price
     176
     177(unit_id, price_id)+ = {unit_id, price_id,
     178
     179''Сите атрибути определни од unit_id''
     180
     181unit_expiration_date, unit_serial_number, unit_batch_number, unit_manufacture_date, unit_cost_price, wh_id, ord_id,
     182
     183''Сите атрибути определни од price_id''
     184
     185price, price_eff_date, art_id,
     186
     187''Сите транзитивни атрибути''
     188
     189wh_adr, city_id, city_name, region_id, region_name, art_name, art_image, art_weight, ctg_id, man_id, ctg_name, man_name, man_adr, man_mobile, man_email}
     190
     191==== Weekday
     192
     193cust_day_id+ = {cust_day_id, cust_id, day_id, start_time, end_time,
     194
     195''Од day_id:''
     196
     197day_name,
     198
     199''Од cust_id:''
     200
     201user_name, user_surname, user_pass, user_salt, user_email, user_mobile, user_active, user_image, clazz_, user_role, city_id, cust_EDB, cust_company_name, cust_adr, cust_representative_img,
     202
     203''Од city_id:''
     204
     205city_name, region_id, region_name}
     206
     207==== Token
     208
     209t_id+ = {t_id, t_value, t_date, t_type, t_expiry, t_validated_at, t_user,
     210
     211''Од t_user (кое е user_id):''
     212
     213user_name, user_surname, user_pass, user_salt, user_email, user_mobile, user_active, user_image, clazz_, user_role, city_id,
     214
     215''Од city_id:''
     216
     217city_name, region_id, region_name}
     218
     219==== Image Store
     220
     221img_id+ = {img_id, img_path, img_ent_type, img_ent_id}
     222
     223=== Анализа според покривачи
     224
     225Од анализирање на покривачите може да ги забележиме следните проблеми во нормализацијата на базата:
     226
     227* Транзитивни зависности во податоците за возила: `veh_id → veh_last_service, veh_last_service_km`
     228* Недостига зависноста `(ord_id, art_id) → quantity, price`
     229* Историја на цени и вредност - `unit_id → unit_cost_price`
     230* Поврзување на слики: `img_id → img_ent_type, img_ent_id`