Steve Ngai (危 志 荣) KuaLa Lumpur, Malaysia

One Resource Table

One Resource Table
Using one resource table method is similar to many lookup tables. The difference is this one resource table actually combines all lookup tables by adding just one more field. Of course, this one resource table will be much larger because it combines all lookup tables.

Using back the same lookup tables at previous blog, let’s create one resource table to replace all lookup tables.

Type Code Desc
State JH Johor
State KH Kedah
State KT Kelantan
State MK Melaka
State NS Negeri Sembilan
State PH Pahang
State PG Pulau Pinang
State PK Perak
State PS Perlis
State SB Sabah
State SW Sarawak
State SL Selangor
State TG Terengganu
State KL W.P. Kuala Lumpur
State LB W.P. Labuan
State PJ W.P. Putrajaya
Country CN China
Country HK Hong Kong
Country IN India
Country MY Malaysia
Country SG Singapore

That’s it. Use both type and code field to make the primary/unique key.