A PHP Error was encountered

Severity: 8192

Message: Methods with the same name as their class will not be constructors in a future version of PHP; Waterfall_Cache has a deprecated constructor

Filename: _common/waterfall_cache.php

Line Number: 47

A PHP Error was encountered

Severity: 8192

Message: Methods with the same name as their class will not be constructors in a future version of PHP; Cache_System has a deprecated constructor

Filename: _common/waterfall_cache.php

Line Number: 194

A PHP Error was encountered

Severity: 8192

Message: Methods with the same name as their class will not be constructors in a future version of PHP; Memcache_Cache_System has a deprecated constructor

Filename: _common/waterfall_cache.php

Line Number: 275

A PHP Error was encountered

Severity: 8192

Message: Methods with the same name as their class will not be constructors in a future version of PHP; Filesystem_Cache_System has a deprecated constructor

Filename: _common/waterfall_cache.php

Line Number: 440

A PHP Error was encountered

Severity: 8192

Message: Methods with the same name as their class will not be constructors in a future version of PHP; APC_Cache_System has a deprecated constructor

Filename: _common/waterfall_cache.php

Line Number: 628

Database Normalization Page 2

Database Normalization Page 2

By David Faour (Send Email)
Posted Feb 8, 2008


Second Normal Form requires that any non-key field be dependent upon the entire key. For example, consider the StudentCourses table below, where StudentID and CourseID form a compound primary key.

StudentID CourseID StudentName CourseLocation Grade
12345 3100 April Math Building A
12345 1300 April Science Building B

The Student Name field does not depend at all on CourseID, but only on Student ID. CourseLocation has be dependency on StudentID, but only on CourseID.

This data should be split into three tables as follows:

Students Table
StudentID Name
12345 April

Courses Table
CourseID CourseLocation
3100 Math Building
1300 Science Building

Student Courses Table
StudentID CourseID Grade
12345 3100 A
12345 1300 B

In this example, grade was the only field dependent on the combination of StudentID and CourseID.

Let's suppose that in the first table design, the first row of data was entered with a StudentName of Aprok, a simple typo. Now, suppose the following SQL is run.

Delete from StudentCourses where StudentName="April"

The erroneous "Aprok" row will not be deleted. However, in the final design, using the following SQL:

Delete From StudentCourses where StudentID=12345
will delete every course that April was in by using the ID.

Original date of publication, 02/21/2001

Page 2 of 3

Thanks for your registration, follow us on our social networks to keep up-to-date