195 | | export_id -> session_id, export_format, file_name, filter_summary, export_date |
196 | | |
197 | | punishment_id -> report_id, value_unit, punishment_type, fine_to_pay, release_date |
198 | | |
199 | | log_id -> profile_id, change_description, changed_at |
200 | | |
201 | | r_d_id -> diagnosis_id, report_id, added_on |
202 | | |
203 | | report_id -> report_type, report_created_at, summary, person_id, location, resolved, crime_type_id, descriptive_punishment, academic_field, institution_id, description_of_report, start_date, end_date, job_role, income_per_month, next_control_date, doctor_id |
| 193 | R1: export_id PK, session_id , export_format, file_name, filter_summary, export_date |
| 194 | |
| 195 | R2: log_id PK, profile_id, change_description, changed_at |
| 196 | |
| 197 | R3: punishment_id PK, report_id, value_unit, punishment_type, fine_to_pay, release_date |
| 198 | |
| 199 | R4: r_d_id PK, diagnosis_id, report_id, added_on |
| 200 | |
| 201 | R5: report_id PK, report_type, report_created_at, summary, person_id, location, resolved, crime_type_id, descriptive_punishment, academic_field, institution_id, description_of_report, start_date, end_date, job_role, income_per_month, next_control_date, doctor_id – е во BCNF, но ќе резултира со многу null полиња во еден запис, по што може да употребиме „''Supertype-Subtype Specialization''“ |
| 202 | |
| 203 | Бидејќи report_id е клуч кај сите, и тие би биле соодветно диференцирани по тип земајќи го во предвид report_type, ќе може да се издвои еден Supertype и од него да произлегуваат соодветно неколку Subtypes. За правилно да го направиме ова, ќе ги гледаме функционалните зависности: |
| 204 | |
| 205 | * R5.1: report_id PK, report_type, report_created_at, summary, person_id |
| 206 | * R5.1.1: report_id PK, location, resolved, crime_type_id, descriptive_punishment |
| 207 | * R5.1.2: report_id PK, academic_field, institution_id, description_of_report |
| 208 | * R5.1.3: report_id PK, start_date, end_date, job_role, income_per_month |
| 209 | * R5.1.4: report_id PK, next_control_date, doctor_id |
207 | | R1: export_id PK, session_id , export_format, file_name, filter_summary, export_date – во BCNF |
208 | | |
209 | | R2: log_id PK, profile_id, change_description, changed_at – во BCNF |
210 | | |
211 | | R3: punishment_id PK, report_id, value_unit, punishment_type, fine_to_pay, release_date – во BCNF |
212 | | |
213 | | R4: r_d_id PK, diagnosis_id, report_id, added_on – во BCNF |
214 | | |
215 | | R5: report_id PK, report_type, report_created_at, summary, person_id, location, resolved, crime_type_id, descriptive_punishment, academic_field, institution_id, description_of_report, start_date, end_date, job_role, income_per_month, next_control_date, doctor_id – е во BCNF, но ќе резултира со многу null полиња во еден запис, по што може да употребиме „''Supertype-Subtype Specialization''“ |
216 | | |
217 | | Бидејќи report_id е клуч кај сите, и тие би биле соодветно диференцирани по тип земајќи го во предвид report_type, ќе може да се издвои еден Supertype и од него да произлегуваат соодветно неколку Subtypes. За правилно да го направиме ова, ќе ги гледаме функционалните зависности: |
218 | | |
219 | | * R5.1: report_id PK, report_type, report_created_at, summary, person_id – во BCNF |
220 | | * R5.1.1: report_id PK, location, resolved, crime_type_id, descriptive_punishment – во BCNF |
221 | | * R5.1.2: report_id PK, academic_field, institution_id, description_of_report – во BCNF |
222 | | * R5.1.3: report_id PK, start_date, end_date, job_role, income_per_month – во BCNF |
223 | | * R5.1.4: report_id PK, next_control_date, doctor_id – во BCNF |
224 | | |
225 | | Атрибутите од подтип се условни од report_type својството, затоа ги логички подобро би фигурирале во погрануларни релации. Секоја од овие продолжува поединечно да го задоволува својството за BCNF, а со тоа и 3NF. |
226 | | |
227 | | R6: остатокот од атрибути = { report_id, export_id, log_id, punishment_id, r_d_id, user_id, user_name, user_surname, email, password_hash, is_user_active, user_created_at, role_id, username, profile_created_at, role_name, role_descrioption, filter_description, searched_at, embg, name, surname, gender, date_of_birth, is_alive, date_of_death, address_of_living, contact_phone, institution_name, institution_address, city, type, year_established, label, severity_level, doctor_name, doctor_surname, specialization, years_of_experience, is_active, short_description, therapy, is_chronic, severity } – во ниту еден случај не е во BCNF |
| 213 | Пред да продолжиме со било што друго, потребно е соодветно да разгледаме што е добиено во претходните нормализирани форми. |
| 214 | Се добиваат R1, R2, R3, R4, R5 ---> R5.1, R5.1.1, R5.1.2, R5.1.3, R5.1.4. Според условите кои ги поставува BCNF, овие релации ја задоволуваат бојс-кодовата нормална форма, а тоа би значело дека исто времено ја задоволуваат и 3NF. |
| 215 | |
| 216 | Останѕува уште: |
| 217 | R6: rest_of_the_attributes_relation = { report_id, export_id, log_id, punishment_id, r_d_id, user_id, user_name, user_surname, email, password_hash, is_user_active, user_created_at, role_id, username, profile_created_at, role_name, role_descrioption, filter_description, searched_at, embg, name, surname, gender, date_of_birth, is_alive, date_of_death, address_of_living, contact_phone, institution_name, institution_address, city, type, year_established, label, severity_level, doctor_name, doctor_surname, specialization, years_of_experience, is_active, short_description, therapy, is_chronic, severity } – во ниту еден случај не е во BCNF |