473,890 Members | 1,357 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Good practice for lookup tables?

Hi all,

My application uses a lot of lookup tables.
I've splitted the frontend (forms, reports, etc) from the backend (data).
The database has around 10 different users.

The values in the lookup tables are not likely to change.

Question 1: Should I include them in the backend (with rest of data) or the
frontend?

Question 2: What's more efficient, have all the lookup values in separate
tables or combine them in _one_ table?

Thanks,

Koen

Nov 12 '05 #1
9 7039
DFS
"Koen" <no@spam.nl> wrote in message
news:Xn******** *************@1 94.109.133.20.. .
Hi all,

My application uses a lot of lookup tables.
I've splitted the frontend (forms, reports, etc) from the backend (data).
The database has around 10 different users.

The values in the lookup tables are not likely to change.

Question 1: Should I include them in the backend (with rest of data) or the frontend?
I recommend the backend, whether they're likely to change or not. If
they're in the backend, you can (and should) use them to enforce referential
integrity on the master tables.

If they're in the frontend, and even one record change is required, you have
to redistribute the app.

Question 2: What's more efficient, have all the lookup values in separate
tables or combine them in _one_ table?
Separate table for each, because of the flexibility you need due to

1) differences in relationships with other tables in the system
2) different structures
3) different field types
4) different field sizes

Not to scare you or insult you, but I inherited a system once where the
previous Access developer combined 8 lookup lists into one table with 15 to
20 columns. Columns 1 and 2 were one lookup "table" with 10 rows. Column 3
was a lookup "table" with 80 rows. Columns 4 and 5 were a lookup "table"
with 5 rows. etc.

They fired him for incompetence.

I've seen multiple lookup "tables" combined into one, using a column to
indicate the type of lookup...

LookupCategory
LookupValue

....but I recommend against it.
Thanks,

Koen

Nov 12 '05 #2
"Koen" <no@spam.nl> wrote in message
news:Xn******** *************@1 94.109.133.20.. .
Hi all,

My application uses a lot of lookup tables.
I've splitted the frontend (forms, reports, etc) from the backend (data).
The database has around 10 different users.

The values in the lookup tables are not likely to change.

Question 1: Should I include them in the backend (with rest of data) or the frontend?

Question 2: What's more efficient, have all the lookup values in separate
tables or combine them in _one_ table?

Thanks,

Koen

I would agree pretty much entirely with the post from DFS. However, I
*might consider* combining lookup tables if the structures were identical,
eg:

tblJobStatus = JstID, JstCode, JstName
tblCompanyStatu s = CstID, CstCode, CstName

Might be combined into

tblStatus=StsID , StsCode, StsType, StsName

But in general not. You don't mention the number of these lookup tables you
have, nor any variations in structure.

Fletcher
Nov 12 '05 #3
"Fletcher Arnold" <fl****@home.co m> wrote in
news:bt******** **@titan.btinte rnet.com:

I would agree pretty much entirely with the post from DFS. However, I
*might consider* combining lookup tables if the structures were
identical, eg:

tblJobStatus = JstID, JstCode, JstName
tblCompanyStatu s = CstID, CstCode, CstName

Might be combined into

tblStatus=StsID , StsCode, StsType, StsName

But in general not. You don't mention the number of these lookup
tables you have, nor any variations in structure.

Fletcher


I have around 25 lookup tables. Their structure is always the same: ID
(number), Name (text). The can tables can be combined into one table by
adding a TypeID column.

I was thinking about efficiency of table handles and performance... Let's
say you have a form with 8 lookup fields. Maybe it would be more efficient
to load the single lookup table once. Maybe I am wrong...

Kind regards,

Koen

Nov 12 '05 #4
"Koen" <no@spam.nl> wrote in message
news:Xn******** *************@1 94.109.133.20.. .
"Fletcher Arnold" <fl****@home.co m> wrote in
news:bt******** **@titan.btinte rnet.com:

I would agree pretty much entirely with the post from DFS. However, I
*might consider* combining lookup tables if the structures were
identical, eg:

tblJobStatus = JstID, JstCode, JstName
tblCompanyStatu s = CstID, CstCode, CstName

Might be combined into

tblStatus=StsID , StsCode, StsType, StsName

But in general not. You don't mention the number of these lookup
tables you have, nor any variations in structure.

Fletcher


I have around 25 lookup tables. Their structure is always the same: ID
(number), Name (text). The can tables can be combined into one table by
adding a TypeID column.

I was thinking about efficiency of table handles and performance... Let's
say you have a form with 8 lookup fields. Maybe it would be more efficient
to load the single lookup table once. Maybe I am wrong...

Kind regards,

Koen


I believe that there will not be much benefit in terms of speed to be gained
from combining the tables into one. Certainly the practice of moving these
tables from the back end to the front, as you mentioned earlier, is
generally more trouble than it's worth.

One benefit of having a single table would be the simplicity of design - if
you have to understand a database schema then 1 table is better than 25.
Also, having a single user interface to manage these lookups is very useful
but since the table structures are the same, you could create one lot of
forms, reports etc that could handle all 25 tables anyway.

The area I would consider the most important is enforcing referential
integrity - which may require special attention. If you had a table like
the status table below:

StsID StsType StsName
1 Company Small
2 Company Medium
3 Company Large
4 Job Current
5 Job Cancelled

and had a field in another table called JobStatus which was got it's value
from StsID, then although you could enforce referential integrity at
table-level, there would be nothing to stop this field having the value of
2. This obviously does not belong since the value means 'company status:
medium'. If you had 25 separate tables this would not be an issue.

Of course you don't have to enforce things at table-level since you can use
the user interface for this and some people have argued in this group that
enforcing at table-level is not necessary, however, I believe if you can,
then you should.

I could offer further ideas, where perhaps some form of field validation
rule could help, but I'd better get back to some of my own work!

Regards

Fletcher
Nov 12 '05 #5
"Fletcher Arnold" <fl****@home.co m> wrote in
news:bt******** **@titan.btinte rnet.com:


I could offer further ideas, where perhaps some form of field
validation rule could help, but I'd better get back to some of my own
work!

Regards

Fletcher

Thanks! I appreciate your feedback!!

Kind regards,

Koen
Nov 12 '05 #6
no@spam.nl (Koen) wrote in
<Xn************ *********@194.1 09.133.20>:
My application uses a lot of lookup tables.
I've splitted the frontend (forms, reports, etc) from the backend
(data). The database has around 10 different users.

The values in the lookup tables are not likely to change.

Question 1: Should I include them in the backend (with rest of
data) or the frontend?
I think this depends on whether the tables have data in them that
is specific to a release of the front end or not. I have one table
that I always include only in the front end, because it includes
lists of reports (and information about those reports that is used
to drive a unified UI for printing reports), and that list changes
with the updates to the front end. If that table were in the back
end, users who haven't yet received the update to the front end
would be presented the opportunity to print a report that might not
yet exist in their copy of the front end.

But most lookup tables, I think, belong in the back end. Few such
lookups have dependencies on UI objects.

Some folks, though, populate local copies of lookup tables from the
back end when the application launches as a way of decreasing how
many times you have to retrieve data from the server. I've never
seen a situation in which this was worth doing.
Question 2: What's more efficient, have all the lookup values in
separate tables or combine them in _one_ table?


You might want to spend some time looking at this:

http://www.bway.net/~dfassoc/downloa...okupAdmin.html

It's a unified single lookup table to replace multiple small
lookups. It makes providing administration of those lookups very
easy.

I use it in all my applications and find it very easy.

But others fundamentally disagree with the approach as it makes RI
enforcement difficult (though not impossible if you're willing to
have it be imperfect).

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 12 '05 #7
no****@nospam.c om (DFS) wrote in
<vv************ @corp.supernews .com>:
I've seen multiple lookup "tables" combined into one, using a
column to indicate the type of lookup...

LookupCatego ry
LookupValue

...but I recommend against it.


Have you ever looked at my implementation of this?

http://www.bway.net/~dfassoc/downloa...okupAdmin.html

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 12 '05 #8
DFS
"David W. Fenton" <dX********@bwa y.net.invalid> wrote in message
news:94******** *************** ****@24.168.128 .86...
no****@nospam.c om (DFS) wrote in
<vv************ @corp.supernews .com>:
I've seen multiple lookup "tables" combined into one, using a
column to indicate the type of lookup...

LookupCatego ry
LookupValue

...but I recommend against it.
Have you ever looked at my implementation of this?

http://www.bway.net/~dfassoc/downloa...okupAdmin.html

As slick as your Lookup Admin system is, I fundamentally disagree with
combining different data types in one text field, and would never do it in
reference tables.

Something you're missing is a status bar description of each lookup field -
you could add it as a column in your master lookup table 'tblLookup'

One nice thing I did notice: you use one subform to show all the different
lookup sets, and set the column widths and captions manually. I usually
create a subform for each lookup table, so my Access systems typically end
up with a blizzard of file-bloating forms in them.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc

Nov 12 '05 #9
no****@nospam.c om (DFS) wrote in
<vv************ @corp.supernews .com>:
"David W. Fenton" <dX********@bwa y.net.invalid> wrote in message
news:94******* *************** *****@24.168.12 8.86...
no****@nospam.c om (DFS) wrote in
<vv************ @corp.supernews .com>:
>I've seen multiple lookup "tables" combined into one, using a
>column to indicate the type of lookup...
>
>LookupCatego ry
>LookupValue
>
>...but I recommend against it.


Have you ever looked at my implementation of this?

http://www.bway.net/~dfassoc/downloa...okupAdmin.html

As slick as your Lookup Admin system is, I fundamentally disagree
with combining different data types in one text field, and would
never do it in reference tables.

Something you're missing is a status bar description of each
lookup field - you could add it as a column in your master lookup
table 'tblLookup'

One nice thing I did notice: you use one subform to show all the
different lookup sets, and set the column widths and captions
manually. I usually create a subform for each lookup table, so my
Access systems typically end up with a blizzard of file-bloating
forms in them.


You could definitely get the benefit of the single UI by simply
applying that one principle to a structure in which you had
multiple lookup tables and used a single subform, reformatted like
that. You would, though, need a lookup table somewhere that
provided you with a list of the lookup types, unless you did
something like giving the lookup tables a custom property and using
that to populate the list.

I packaged it not so much to try to convince people to use it
wholesale, but so people could look at it and maybe get some ideas
of their own. I wouldn't expect others to do things exactly the
same way I would, but I've never had any issues with this.

An earlier version of it had a data type field, but it just became
too much work to deal with. Another earlier version had separate
fields for different kind of data, and that was a disaster. I
eventually settled on mixing datatypes as I do when I realized that
it was just a kludge on top of what was already something of a
kludge.

For me, giving up some data validation and integrity enforcement is
worth the easy of implementation it gives me, dropping the whole
thing into a new app and populating the lookup table. For me, it
vastly speeds up the basic development process as well as allowing
the addition of lookups and configuration data without having to
change the data schema. For large, live app, this can be a pretty
significant benefit.

But I understand why others would not want to use it.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 12 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
19044
by: John Collyer | last post by:
Hi, In assembly language you can use a lookup table to call functions. 1. Lookup function address in table 2. Call the function Like: CALL FUNCTION
2
1436
by: Jack | last post by:
Hi, If you have lookup tables which are used by multiple tables (e.g. 'City' lookup table might be used by the 'Employee' and the 'Company' tables) do we need to link it to both tables? Or can it sit by itself and just referenced? Cheers, Jack
2
1603
by: DKode | last post by:
Ok, My staff has determined that we will be using custom business objects for a new app we are creating. we have an object that is called Employee. The employee object has about 8 lookup tables with a FK in the employee table and two other tables that will be custom objects themselves.
2
5628
by: CoreyWhite | last post by:
The future of computer architecture will use lookup tables. Currently computer processor speed outweighs the benefits of using computer memory for lookup tables, except in some cases. As computer memory increases, new ROM chips will be built with lookup tables hardcoded into them. Here is an example of what using a lookup table can do for you. The following program divides to integers from 0 to 4 using lookup tables and times itself...
1
3110
by: Mark Lees | last post by:
Do I need to create a relationship between fields in a table I created for a lookup(combo box) and the actual table that contains the combo box? Or do these lookup tables exist independently of the main tables?
10
3826
by: junky_fellow | last post by:
what are lookup tables ? How can they be used to optimise the code ?
0
2225
by: mjsterz | last post by:
I've been working with VB .NET for less than a year and this is the first time I've posted on one of these groups, so let me apologize beforehand if I'm being unclear, not posting my issue correctly, posting to the wrong forum, or committing some other sort of faux pas. My team is developing a Windows Forms application using VS 2005 with SQL Server 2005 on the back end and we're having a problem using ComboBoxes data bound to lookup...
2
3594
by: Ronald Verbeek | last post by:
I have to deal with several lookup tables like for example: Quality SpecificWeight Hardness TearStrength So I would create a Quality Class to store the values for a single record. I know it would be possible to use a HashMap<String, Qualityand fill it with the appropriate data. All examples I find use the main method for this.
0
1142
by: larry | last post by:
I'm wondering if there is something already out there for parsing lookup tables, You know, like tax tables, the columns are marital status, and the lookup is income within the rane and marital status. Example (sorry for the lousy column spacing): income single married widower 0 0 0 0 5000 35 8 0
0
9825
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10828
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10925
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10467
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9638
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8018
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7171
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4682
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4276
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.