Tuesday, August 18, 2009

a alternative loop-up table

In the above case, we had a special column for Key. Instead we could also have a code for the course like this:

 

Student Table

 

 

Id

Name

Course

1

Abc

Comp

2

Xyz

Art

 

Course table

 

Id

Name

Comp

Computers

Art

Arts

 

This way the code is more readable. The downside is its pretty difficult to change the i.d. If in the future its required to change the id of “computers” course from “comp” to “it”, then that is not a easy deal.

No comments: