Changes between Initial Version and Version 1 of Version2


Ignore:
Timestamp:
06/14/24 18:18:30 (6 months ago)
Author:
212012
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Version2

    v1 v1  
     1= Верзија 2
     2
     3== Определување функциски зависности и да нема нешто со исто име на атрибут
     4
     5*s_id = statement_id
     6
     7R={pe_id, first_name, last_name, gender, address, picture, contact, embg, date_of_birth,
     8country, nationality, o_badge_no, o_password, o_date_of_employment, p_id, p_address,
     9s_id, city, p_date_of_employment, badge_no, rank, p_password, statement_id,
     10statement_date, description, incident_timestamp, incident_place, e_id, e_name, e_type,
     11is_found, e_picture, c_id, c_name, opening_date, c_status, date_of_closing, sc_description,
     12final_document, t_id, t_name
     13}
     14
     15pe_id -> first_name, last_name, gender, address, picture, contact, embg, date_of_birth,
     16                                country, nationality \\
     17o_badge_no -> pe_id, o_password, o_date_of_employment \\
     18p_id -> p_address, o_badge_no, s_id \\
     19s_id -> city \\
     20badge_no -> pe_id, p_date_of_employment, rank, p_password \\
     21statement_id -> statement_date, description, incident_timestamp, incident_place,
     22                                                                badge_no \\
     23e_id -> e_name, e_type, is_found, e_picture \\
     24c_id -> c_name, opening_date, c_status, statement_id, e_id, t_id, p_id, date_of_closing \\
     25date_of_closing ->  sc_description, final_document \\
     26t_id -> t_name \\
     27
     28Лево \\
     29c_id
     30
     31Лево и десно \\
     32pe_id, t_id, o_badge_no, p_id, s_id, badge_no, statement_id, e_id, date_of_closing, t_id
     33
     34Десно \\
     35first_name, last_name, gender, address, picture, contact, embg, date_of_birth, country, nationality, o_password, o_date_of_employment, p_address, city, p_date_of_employment, rank, p_password,statement_date, description, incident_timestamp, incident_place, e_name, e_type,
     36is_found, e_picture,c_name, opening_date, c_status, sc_description,
     37final_document, t_name
     38
     39
     40c_id+={c_id, c_name, opening_date, c_status, statement_id, e_id, t_id, p_id, date_of_closing, statement_date, description, incident_timestamp, incident_place,
     41                        badge_no, e_name, e_type, is_found, e_picture, t_name, p_address, o_badge_no, s_id, sc_description, final_document, city, pe_id, o_password, o_date_of_employment,
     42                        p_date_of_employment, rank, p_password, first_name, last_name, gender, address, picture, contact, embg, date_of_birth, country, nationality }
     43Следува дека е единствен кандидат клуч и го прогласуваме за примарен клуч.
     44
     45
     46Во ваква дефинирана релација нема повеќекратни зависности, па со тоа следува дека задоволува **1НФ**.
     47
     48Клучот на релацијата е составен само од еден атрибут c_id, што значи дека парцијална зависност не постои, и со тоа заклучуваме дека е задоволена **2НФ**.
     49
     50Не е во 3НФ бидејќи има транзитивни зависности, пример s_id -> city
     51
     52Декомпозиција:
     53
     54**R1{s_id, city} е во BCNF**
     55
     56R2{c_id, c_name, opening_date, c_status, statement_id, e_id, t_id, p_id, date_of_closing, statement_date, description, incident_timestamp, incident_place,
     57                        badge_no, e_name, e_type, is_found, e_picture, t_name, p_address, o_badge_no, s_id, sc_description, final_document, pe_id, o_password, o_date_of_employment,
     58                        p_date_of_employment, rank, p_password, first_name, last_name, gender, address, picture, contact, embg, date_of_birth, country, nationality}
     59
     60R2 не е во 3НФ поради e_id -> e_name, e_type, is_found, e_picture
     61
     62**R21{e_id, e_name, e_type, is_found, e_picture} е во BCNF**
     63R22{c_id, c_name, opening_date, c_status, statement_id, e_id, t_id, p_id, date_of_closing, statement_date, description, incident_timestamp, incident_place,
     64                        badge_no, t_name, p_address, o_badge_no, s_id, sc_description, final_document, pe_id, o_password, o_date_of_employment,
     65                        p_date_of_employment, rank, p_password, first_name, last_name, gender, address, picture, contact, embg, date_of_birth, country, nationality}
     66R22 не е во 3НФ поради t_id -> t_name
     67
     68**R221{t_id, t_name} е во BCNF**
     69R222{c_id, c_name, opening_date, c_status, statement_id, e_id, t_id, p_id, date_of_closing, statement_date, description, incident_timestamp, incident_place,
     70                        badge_no, p_address, o_badge_no, s_id, sc_description, final_document, pe_id, o_password, o_date_of_employment,
     71                        p_date_of_employment, rank, p_password, first_name, last_name, gender, address, picture, contact, embg, date_of_birth, country, nationality}
     72R222 не е во BCNF поради pe_id -> first_name, last_name, gender, address, picture, contact, embg, date_of_birth,country, nationality}
     73
     74**R2221{pe_id, first_name, last_name, gender, address, picture, contact, embg, date_of_birth,country, nationality}е во BCNF**
     75R2222{c_id, c_name, opening_date, c_status, statement_id, e_id, t_id, p_id, date_of_closing, statement_date, description, incident_timestamp, incident_place,
     76                        badge_no, p_address, o_badge_no, s_id, sc_description, final_document, pe_id, o_password, o_date_of_employment, p_date_of_employment, rank, p_password}
     77
     78R2222 не е во BCNF поради date_of_closing ->  sc_description, final_document
     79**R22221{date_of_closing, sc_description, final_document}е во BCNF**
     80R22222{c_id, c_name, opening_date, c_status, statement_id, e_id, t_id, p_id, date_of_closing, statement_date, description, incident_timestamp, incident_place,
     81                        badge_no, p_address, o_badge_no, s_id, pe_id, o_password, o_date_of_employment, p_date_of_employment, rank, p_password}
     82
     83R22222 не е во 3НФ поради o_badge_no -> pe_id, o_password, o_date_of_employment
     84
     85**R222221{o_badge_no, pe_id, o_password, o_date_of_employment}е во BCNF**
     86
     87R222222{c_id, c_name, opening_date, c_status, statement_id, e_id, t_id, p_id, date_of_closing, statement_date, description, incident_timestamp, incident_place,
     88                        badge_no, p_address, o_badge_no, s_id, p_date_of_employment, rank, p_password}
     89
     90R222222 не е во 3НФ поради badge_no -> pe_id, p_date_of_employment, rank, p_password
     91**R2222221{badge_no, pe_id, p_date_of_employment, rank, p_password} е во BCNF**
     92
     93R2222222{c_id, c_name, opening_date, c_status, statement_id, e_id, t_id, p_id, date_of_closing, statement_date, description, incident_timestamp, incident_place,
     94                        badge_no, p_address, o_badge_no, s_id}
     95
     96R2222222 не е во BCNF поради statement_id -> statement_date, description, incident_timestamp, incident_place, badge_no
     97**R22222221{statement_id, statement_date, description, incident_timestamp, incident_place, badge_no} е во BCNF**
     98
     99R22222222{c_id, c_name, opening_date, c_status, statement_id, t_id, p_id, date_of_closing, p_address, o_badge_no, s_id}
     100
     101R22222222 не е во BCNF поради p_id -> p_address, o_badge_no, s_id
     102**R222222221{p_id, p_address, o_badge_no, s_id} е во BCNF**
     103
     104**R222222222{c_id, c_name, opening_date, c_status, statement_id, t_id, date_of_closing} тука завршуваме бидејќи е во BCNF.**
     105
     106
     107== Релации
     108**R1=Statement{s_id, city}**
     109
     110**R21=Evidence{e_id, e_name, e_type, is_found, e_picture} е во BCNF**
     111
     112**R221=Type_of_crime{t_id, t_name} е во BCNF**
     113
     114**R2221=People{pe_id, first_name, last_name, gender, address, picture, contact, embg, date_of_birth,country, nationality}е во BCNF**
     115
     116**R22221=Solved_case{date_of_closing, sc_description, final_document}е во BCNF**
     117
     118**R222221=Officer{o_badge_no, pe_id, o_password, o_date_of_employment}е во BCNF**
     119
     120**R2222221=Policeman{badge_no, pe_id, p_date_of_employment, rank, p_password} е во BCNF**
     121
     122**R22222221=Statement{statement_id, statement_date, description, incident_timestamp, incident_place, badge_no} е во BCNF**
     123
     124**R222222221=Police_Station{p_id, p_address, o_badge_no, s_id} е во BCNF**
     125
     126**R222222222=Crime_case{c_id, c_name, opening_date, c_status, statement_id, t_id, date_of_closing} тука завршуваме бидејќи е во BCNF.**