SYSTEM DESIGN

38 422 0
SYSTEM DESIGN

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

CHAPTER 4 SYSTEM DESIGN 4.1 DATABASE DESIGN 4.1.1 Database Normalization Before starting normalization, we should gather all data items into a table called Data items List Table. This table includes all data items to be present at four mentioned forms. Data items List STT Data Items Forms 1 UserID User Information Form 2 MCode User Information Form 3 FullName User Information Form 4 Gender User Information Form 5 DateOfBirth User Information Form 6 Address User Information Form 7 Telephone User Information Form 8 Email User Information Form 9 Website User Information Form 10 Occupation User Information Form 11 PersonalInfo User Information Form 12 Username User Information Form 13 RegDate User Information Form 14 Password User Information Form 15 Role User Information Form 16 CatID Category Information Form 17 CatName Category Information Form 18 CatDescription Category Information Form 19 ReadPermission Category Information Form 20 WritePermission Category Information Form 21 EditPermission Category Information Form 22 DelelePermission Category Information Form 23 ArticleTypeID ArticleType Information Form 24 ArticleTypeName ArticleType Information Form 25 ArticleTypeDesc ArticleType Information Form 26 ReplyPermission ArticleType Information Form 27 ArticleID Article Information Form 28 ArticleName Article Information Form 29 CatID Article Information Form 30 ArticleTypeID Article Information Form 31 ArticleKeyword Article Information Form 32 AuthorID Article Information Form 33 PostDate Article Information Form 34 OriginalPostID Article Information Form 35 AttachmentID Article Information Form 36 AttachmentName Article Information Form 37 AttachmentDesc Article Information Form 38 AttachmentPath Article Information Form 39 AttchmentDownload Article Information Form 40 ArticleRatePoint Article Information Form 41 ArticleRateCount Article Information Form 42 ArticleViews Article Information Form 43 ArticleLastUpdated Article Information Form 44 ArticleContent Article Information Form 45 CommentID Article Information Form 46 CommentText Article Information Form 47 CommentUserID Article Information Form 4.1.2 Normalize User Information Form User Information Form at Figure 3.1.3 can be normalized according to following steps Un_normalized User Information Form STT Data Items 1 UserID 2 MCode 3 FullName 4 Gender 5 DateOfBirth 6 Address 7 Telephone 8 Email 9 Website 10 Occupation 11 PersonalInfo 12 Username 13 RegDate 14 Password 15 Role User Table in 1NF First normal form (1NF) sets the very basic rules for an organized database  Eliminate duplicative columns from the same table.  Create separate tables for each group of related data and identify each row with a unique column or set of columns (the primary key). Based on these rules, we can see clearly User Table is in 1NF. User Table only has one unique primary key (UserID) and without repeating group. User Table in 2NF A relation is in 2NF if and only if it is in 1NF and every non-key attribute is fully dependent on the primary key. First, we need understand Functional Dependence, an attribute is considered to be fully dependent on the primary key if  This attribute is dependent on the primary key  This attribute is not dependent on any subsets of the primary key (For example, given a relation R, a set of attributes B is functionally dependent on another set of attributes, A, if at each instance of time each A value is associated with only one B value) Second normal form (2NF) further addresses the concept of removing duplicative data  Remove subsets of data that apply to multiple rows of a table and place them in separate tables.  Create relationships between these new tables and their predecessors through the use of foreign keys. As you seen, User Table is automatically promoted to 2NF because it has a single primary key, that means all non-key fields is fully depend on primary key User Table in 3NF A relation is in 3NF if it is in 2NF and if no non-key field is dependent on another non-key field. According to this principle, User Tables has already satisfied 3NF (Note: the field is underlined denotes foreign key and pertain to * symbol denotes Primary Key (PK)) No Data Items 1 UserID* 2 MCode 3 FullName 4 Gender 5 DateOfBirth 6 Address 7 Telephone 8 Email 9 Website 10 Occupation 11 PersonalInfo 12 Username 13 RegDate 14 Password 15 Role 4.1.3 Normalize Category Information Form Category Information Form at figure 3.1.4 can be normalized based on three mentioned principles above Un-normalized Category Form No Data Items 1 CatID 2 CatName 3 CatDescription 4 ReadPermission 5 WritePermission 6 EditPermission 7 DeletePermission Comments Based on the principles in 1NF, 2NF and 3NF above, it is simple enough to see that Category Table is in 1NF and it has automatically been 2NF. Because of all non-key fields do not depend on another so the table is fully in 3NF. Category Table in 3NF (Note: the field is underlined denotes foreign key and pertain to * symbol denotes PK) No Data items 1 CatID* 2 CatName 3 CatDescription 4 ReadPermission 5 WritePermission 6 EditPermission 7 DeletePermission 4.1.4 Normalize ArticleType Information Form Category Information Form at figure 3.1.5 can be normalized based on three mentioned principles above Un-normalized ArticleType Form No Data Items 1 ArticleTypeID 2 ArticleTypeName 3 ArticleTypeDesc 4 ReplyPermission Comments As Category Table, it is easy to see that ArticleType Table is in 1NF; it has no repeating groups and only has a single primary key. The table has automatically been in 2NF. Because of non-key attributes do not depend on another so this table is fully in 3NF. ArticleType Table in 3NF (Note: the field is underlined denotes foreign key and pertain to * symbol denotes Primary Key) No Data Items 1 ArticleTypeID* 2 ArticleTypeName 3 ArticleTypeDesc 4 ReplyPermission . relationship between entities in the Knowledge Base System 4.2 PROGRAM DESIGN 4.2.1 System menu design System Menu Design System menu Front-end menu Control Panel. CHAPTER 4 SYSTEM DESIGN 4.1 DATABASE DESIGN 4.1.1 Database Normalization Before starting normalization,

Ngày đăng: 05/10/2013, 13:20

Từ khóa liên quan

Tài liệu cùng người dùng

Tài liệu liên quan