Friday, January 19, 2007

Entity Relationship Diagram (ERD)



Mapping ERD

The information below shows the mapping of the Entity Relationship Diagram.

Customer(AccountNo, Username, Password, HoueseNo, Street, Postcode , DOB, Email, Forename, Surname, TelNo)

Purchase(AccountNo, GameID)

Product(GameID, Name, Price, description)

Type(GameID, Type)

Age(GameID, Age)

Basket(BasketID, Name, Price, GameID)

Order(OrderID, SubTotal, VAT, MainTotal, AccountNo, ExpireDate)

Saturday, January 13, 2007

Normalisation

Normalisation is a process to reduce complexity of the database into simple structure by breaking down the tables to remove redundancies of attributes, keys, etc.

Customer(AccountNo, Username, Password, HoueseNo, Street, Poscode , DOB, Email, Forename, Surname, TelNo, GameID, Name, Price, Description, Type, Age, BasketID, Name, Price, , SubTotal, VAT, MainTotal, , ExpireDate)

First Normal Form

Customer(AccountNo, Username, Password, HoueseNo, Street, Postcode , DOB, Email, Forename, Surname, TelNo, GameID, Name, Price, Description, Type, Age, BasketID, Name, Price, , SubTotal, VAT, MainTotal, AccountNo, ExpireDate)

Purchase(AccountNo, GameID)

Second Normal Form

Customer(AccountNo, Username, Password, HoueseNo, Street, Postcode , DOB, Email, Forename, Surname, TelNo, BasketID, Name, Price, SubTotal, VAT, MainTotal, AccountNo, ExpireDate)

Purchase(AccountNo, GameID)

Product(GameID, Name, Price, Description)

Type(GameID, Type)

Age(GameID, Age)

Third Normal Form

Customer(AccountNo, Username, Password, HoueseNo, Street, Postcode , DOB, Email, Forename, Surname, TelNo)

Purchase(AccountNo, GameID)

Product(GameID, Name, Price, Description)

Type(GameID, Type)

Age(GameID, Age)

Basket(BasketID, Name, Price, GameID)

Order(OrderID, SubTotal, VAT, MainTotal, AccountNo, ExpireDate)

Description of each steps

First Normal Form

The first Normal Form is the basic relational model to eliminate multi-valued attributes, repeating groups etc. Also each attribute are atomic to remove repeating data.

Second Normal Form

This step consists that the data contains no partial key dependencies and that the attributes are functionally dependant on the primary key of the table.

Third Normal Form

In this step, there are no functional (transitive) dependencies between more non primary key attributes and that the relation contains only keys.