Changes between Version 3 and Version 4 of Normalization
- Timestamp:
- 08/29/25 15:56:05 (2 days ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Normalization
v3 v4 1 1 = Нормализација и подобрување на дизајн 2 2 3 [[PageOutline ]]3 [[PageOutline(2-4, Содржина, inline)]] 4 4 5 5 == Определување функционални зависности 6 6 7 R = {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} 7 `R = {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}` 8 8 9 9 === Функционални зависности 10 10 11 ==== Users and related entities 12 13 user_id → user_name, user_surname, user_pass, user_salt, user_email, user_mobile, user_active, user_image, clazz_, user_role, city_id 14 15 ==== Customer extends User 16 17 user_id → cust_EDB, cust_company_name, cust_adr, cust_representative_img (where clazz_ = 'customer') 18 19 ==== Manager extends User 20 21 user_id → wh_id (where clazz_ = 'manager') 22 23 ==== Driver extends User 24 25 user_id → veh_id (where clazz_ = 'driver') 26 27 ==== Location data 28 29 city_id → city_name, region_id 30 31 region_id → region_name 11 ==== Users 12 13 `user_id → user_name, user_surname, user_pass, user_salt, user_email, user_mobile, user_active, user_image, clazz_, user_role, city_id` 14 15 ==== Customer го проширува User 16 17 `user_id → cust_EDB, cust_company_name, cust_adr, cust_representative_img (каде што clazz_ = 'customer')` 18 19 ==== Manager го проширува User 20 21 `user_id → wh_id (каде што clazz_ = 'manager')` 22 23 ==== Driver го проширува User 24 25 `user_id → veh_id (каде што clazz_ = 'driver')` 26 27 ==== City 28 29 `city_id → city_name, region_id` 30 31 ==== Region 32 33 `region_id → region_name` 32 34 33 35 ==== Warehouse 34 36 35 wh_id → wh_adr, city_id 37 `wh_id → wh_adr, city_id` 36 38 37 39 ==== Vehicle 38 40 39 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 41 `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` 40 42 41 43 ==== Categories 42 44 43 ctg_id → ctg_name 45 `ctg_id → ctg_name` 44 46 45 47 ==== Manufacturer 46 48 47 man_id → man_name, man_adr, man_mobile, man_email 49 `man_id → man_name, man_adr, man_mobile, man_email` 48 50 49 51 ==== Article 50 52 51 art_id → art_name, art_image, art_weight, ctg_id, man_id 53 `art_id → art_name, art_image, art_weight, ctg_id, man_id` 52 54 53 55 ==== Price 54 56 55 price_id → price, price_eff_date, art_id 57 `price_id → price, price_eff_date, art_id` 56 58 57 59 ==== Pro forma 58 60 59 pf_id → pf_deadline, pf_date_created, pf_status_id 60 61 pf_status_id → pf_status_name, pf_status_desc 61 `pf_id → pf_deadline, pf_date_created, pf_status_id` 62 63 ==== Pro Forma Status 64 65 `pf_status_id → pf_status_name, pf_status_desc` 62 66 63 67 ==== Delivery 64 68 65 del_id → del_date_created, del_date, del_start_km, del_end_km, del_start_time, del_end_time, d_status_id, veh_id 66 67 d_status_id → d_status_name, d_status_desc 69 `del_id → del_date_created, del_date, del_start_km, del_end_km, del_start_time, del_end_time, d_status_id, veh_id` 70 71 ==== Delivery Status 72 73 `d_status_id → d_status_name, d_status_desc` 68 74 69 75 ==== Order 70 76 71 ord_id → ord_date, ord_sum, ord_fulfillment_date, ord_comment, o_status_id, cust_id, del_id, pf_id 72 73 o_status_id → o_status_name, o_status_desc 77 `ord_id → ord_date, ord_sum, ord_fulfillment_date, ord_comment, o_status_id, cust_id, del_id, pf_id` 78 79 ==== Delivery Status 80 81 `o_status_id → o_status_name, o_status_desc` 74 82 75 83 ==== Article unit 76 84 77 unit_id → unit_expiration_date, unit_serial_number, unit_batch_number, unit_manufacture_date, unit_cost_price, wh_id, ord_id 85 `unit_id → unit_expiration_date, unit_serial_number, unit_batch_number, unit_manufacture_date, unit_cost_price, wh_id, ord_id` 78 86 79 87 ==== Weekday 80 88 81 day_id → day_name 89 `day_id → day_name` 82 90 83 91 ==== Customer weekday 84 92 85 cust_day_id → cust_id, day_id, start_time, end_time 93 `cust_day_id → cust_id, day_id, start_time, end_time` 86 94 87 95 ==== Token 88 96 89 t_id → t_value, t_date, t_type, t_expiry, t_validated_at, t_user 97 `t_id → t_value, t_date, t_type, t_expiry, t_validated_at, t_user` 90 98 91 99 ==== Image store 92 100 93 img_id → img_path, img_ent_type, img_ent_id 101 `img_id → img_path, img_ent_type, img_ent_id` 94 102 95 103 === Класификација на атрибути … … 97 105 ==== Лево - атрибути кои одредуваат други 98 106 99 cust_day_id, price_id, pf_id, del_id, ord_id, unit_id, t_id, img_id 107 `cust_day_id, price_id, pf_id, del_id, ord_id, unit_id, t_id, img_id` 100 108 101 109 ==== Лево и десно - атрибути кои одредуваат други и се одредени од други 102 110 103 user_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 111 `user_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 112 105 113 ==== Десно - атрибути кои се одредени од други 106 114 107 user_name, user_surname, user_pass, user_salt, user_email, user_mobile, user_active, user_image, 108 clazz_, 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, 109 veh_last_service, veh_last_service_km, veh_plate, veh_vin, veh_reg_date, ctg_name, man_name, 110 man_adr, man_mobile, man_email, art_name, art_image, art_weight, price, price_eff_date, 111 pf_deadline, pf_date_created, pf_status_name, pf_status_desc, del_date_created, del_date, 112 del_start_km, del_end_km, del_start_time, del_end_time, d_status_name, d_status_desc, ord_date, 113 ord_sum, ord_fulfillment_date, ord_comment, o_status_name, o_status_desc, unit_expiration_date, 114 unit_serial_number, unit_batch_number, unit_manufacture_date, unit_cost_price, day_name, 115 start_time, end_time, t_value, t_date, t_type, t_expiry, t_validated_at, t_user, img_path, 116 img_ent_type, img_ent_id 115 `user_name, user_surname, user_pass, user_salt, user_email, user_mobile, user_active, user_image, clazz_, 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, veh_last_service, veh_last_service_km, veh_plate, veh_vin, veh_reg_date, ctg_name, man_name, man_adr, man_mobile, man_email, art_name, art_image, art_weight, price, price_eff_date, pf_deadline, pf_date_created, pf_status_name, pf_status_desc, del_date_created, del_date, del_start_km, del_end_km, del_start_time, del_end_time, d_status_name, d_status_desc, ord_date, ord_sum, ord_fulfillment_date, ord_comment, o_status_name, o_status_desc, unit_expiration_date, unit_serial_number, unit_batch_number, unit_manufacture_date, unit_cost_price, day_name, start_time, end_time, t_value, t_date, t_type, t_expiry, t_validated_at, t_user, img_path, img_ent_type, img_ent_id` 117 116 118 117 === Покривачи на примарните клучеви … … 120 119 ==== Vehicle 121 120 122 veh_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} 121 `veh_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 122 124 123 ==== User 125 124 126 user_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} 125 `user_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 126 128 127 * Ако тип на корисник е 'customer': 129 128 130 *user_id+** += {cust_EDB, cust_company_name, cust_adr, cust_representative_img} 129 `user_id+ += {cust_EDB, cust_company_name, cust_adr, cust_representative_img}` 131 130 132 131 * Ако тип на корисник е 'manager': 133 132 134 **user_id+** += {wh_id, wh_adr} 133 `user_id+ += {wh_id, wh_adr}` 135 134 136 135 * Ако тип на корисник е 'driver': 137 136 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} 137 `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 138 140 139 ==== Manufacturer 141 140 142 man_id+ = {man_id, man_name, man_adr, man_mobile, man_email} 141 `man_id+ = {man_id, man_name, man_adr, man_mobile, man_email}` 143 142 144 143 ==== Article 145 144 146 art_id+ = {art_id, art_name, art_image, art_weight, ctg_id, ctg_name, man_id, man_name, man_adr, man_mobile, man_email} 145 `art_id+ = {art_id, art_name, art_image, art_weight, ctg_id, ctg_name, man_id, man_name, man_adr, man_mobile, man_email}` 147 146 148 147 ==== Price 149 148 150 price_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} 149 `price_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 150 152 151 ==== Pro-forma 153 152 154 pf_id+ = {pf_id, pf_deadline, pf_date_created, pf_status_id, pf_status_name, pf_status_desc} 153 `pf_id+ = {pf_id, pf_deadline, pf_date_created, pf_status_id, pf_status_name, pf_status_desc}` 155 154 156 155 ==== Delivery 157 156 158 del_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} 157 `del_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 158 160 159 ==== Order 161 160 162 ord_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} 161 `ord_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 162 164 163 ==== Article Unit 165 164 166 unit_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} 165 `unit_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 166 168 167 * Ако ord_id не е null, исто така ги вклучува и: 169 unit_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,168 `unit_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 169 171 170 ''и сите атрибути одредени од ord_id'' 172 171 173 } 172 `}` 174 173 175 174 ==== Композитен клуч - Article Unit и Price 176 175 177 (unit_id, price_id)+ = {unit_id, price_id,176 `(unit_id, price_id)+ = {unit_id, price_id,` 178 177 179 178 ''Сите атрибути определни од unit_id'' 180 179 181 unit_expiration_date, unit_serial_number, unit_batch_number, unit_manufacture_date, unit_cost_price, wh_id, ord_id,180 `unit_expiration_date, unit_serial_number, unit_batch_number, unit_manufacture_date, unit_cost_price, wh_id, ord_id,` 182 181 183 182 ''Сите атрибути определни од price_id'' 184 183 185 price, price_eff_date, art_id, 184 `price, price_eff_date, art_id,` 186 185 187 186 ''Сите транзитивни атрибути'' 188 187 189 wh_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} 188 `wh_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 189 191 190 ==== Weekday 192 191 193 cust_day_id+ = {cust_day_id, cust_id, day_id, start_time, end_time, 192 `cust_day_id+ = {cust_day_id, cust_id, day_id, start_time, end_time,` 194 193 195 194 ''Од day_id:'' 196 195 197 day_name, 196 `day_name,` 198 197 199 198 ''Од cust_id:'' 200 199 201 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, 200 `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,` 202 201 203 202 ''Од city_id:'' 204 203 205 city_name, region_id, region_name} 204 `city_name, region_id, region_name}` 206 205 207 206 ==== Token 208 207 209 t_id+ = {t_id, t_value, t_date, t_type, t_expiry, t_validated_at, t_user, 208 `t_id+ = {t_id, t_value, t_date, t_type, t_expiry, t_validated_at, t_user,` 210 209 211 210 ''Од t_user (кое е user_id):'' 212 211 213 user_name, user_surname, user_pass, user_salt, user_email, user_mobile, user_active, user_image, clazz_, user_role, city_id, 212 `user_name, user_surname, user_pass, user_salt, user_email, user_mobile, user_active, user_image, clazz_, user_role, city_id,` 214 213 215 214 ''Од city_id:'' 216 215 217 city_name, region_id, region_name} 216 `city_name, region_id, region_name}` 218 217 219 218 ==== Image Store 220 219 221 img_id+ = {img_id, img_path, img_ent_type, img_ent_id} 220 `img_id+ = {img_id, img_path, img_ent_type, img_ent_id}` 222 221 223 222 === Анализа според покривачи … … 229 228 * Историја на цени и вредност - `unit_id → unit_cost_price` 230 229 * Поврзување на слики: `img_id → img_ent_type, img_ent_id` 230 231 == Проблеми и подобрување на дизајн 232