Database Manipulation
Introduction
Normalisation is the process by which one breaks down the files into tables in order to create the database. There are three to four steps which are followed when normalizing a table. The first step is the First Normal Form (1NF), the second type of normalization is the Second Normal Form (2NF), the third form is Third Normal Form (3NF), lastly is the Boyce-Codd Normal Form (BCNF). There are other forms of normalization although, they are rarely used. This paper tries to analyze how one can break down the files into the table for the sake of creating a database (Churche, 2007). Database is said to be normalized if only it is in 3NF.
First Normal Form (1NF)
The following rules are followed when normalizing a table in the 1NF for an organized database. The first step involves the eliminating of the columns which are in the same table; the second step is to create a separate table for every group of the related data then identifies every row with the unique columns that is the primary key. The tables in Community library database have not met the requirement of the 1NF, 2NF, and 3 NF since different columns in the tables has been repeated. The columns of the table repeatedly include the column of the data type, length and descriptions. This table can be created as a one table as shown below;
Field Name Data Type Length/Format Description
Customer ID Number Primary Key
First Name Text 20
Last Name Text 20
SSNoText Standard length Social Security Number
Address Text 50 City Text 15 State Text 15 ZipCodeText 6 Phone Text 13 Email Text 30 DOB Date Standard Date of birth
DOA Date Standard Date of Application
Checkout ID Number Primary Key
Customer ID Number Foreign Key
ItemAcquiredText 30 Foreign Key. ID of Book/CD acquired for checkout
ItemTypeText 1 1 for book and 0 for CD
ItemTitleText 50 ItemGenreText 30 Description Text 200 Edition Text 15 YearofPubText 5 Year of publication
Second Normal Form (2NF)
This step addresses a concept of removing data which are repeated in a given table. It has rules which must be followed during normalization. The first step is making sure that the requirements in the first normal form are met. Secondly, remove the subsets of data which multiples the rows of the table then place the data in different tables. The third step is creating the relationships between the tables as well as, predecessors by use of the foreign keys (Coronel, 2011).
Field Name Data Type Length/Format Description
Customer ID Number Primary key
SSNoText Standard length Social Security Number
ZipCodeText 6 ItemTypeText 1 1 for book and 0 for CD
Customer ID Number Foreign Key
Description Text 200 YearofPubText 5 Year of publication
Third Normal Form (3NF)
This form goes more steps further. One must have to meet the requirements of the second normal form, and then remove columns which depend upon a primary key.
Apply SQL to create tables
CREATE TABLE Customers(P_Id int,LastName varchar(255),FirstName varchar(255),Address varchar(255),City varchar(255))
Conclusion
Data should always be organized properly in the database. It is done by creating tables as well as, establishing the relationships between the tables in regard to the rules designed to protect the data and to make database to be flexible by removing the redundancy as well as, inconsistent dependency. Redundant data is known to be wasting the disk space as well as, creating the maintenance problems. If the data which exists in many places must be changed, the data must be changed in precisely to the same way in all locations.
References
Churcher, C. (2007). Beginning database design. New York: Apress ;.
Coronel, C., Morris, S., & Rob, P. (2011). Database systems: design, implementation, and management (9th ed.). London: Course Technology Cengage Learning. Ling, T. W., Lee, M. L., & Dobbie, G. (2005). Semistructured database design. New York: Springer.