Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a lookup table?

I just gave a database diagram for a DB I created to our head database person, and she put a bunch of notes on it suggesting that I rename certain tables so it is clear they are lookup tables (add "lu" to the beginning of the table name).

My problem is that these don't fit the definition of what I consider a lookup table to be. I have always considered a lookup table to basically be a set of options that don't define any relationships. Example:

luCarMake ----------- id    Make --    --------- 1     Audi 2     Chevy 3     Ford 

The database person at my work is suggesting that I rename several tables that are just IDs mapping one table to another as lookup tables. Example (Location_QuadMap below):

Location ---------- LocationId name description  Location_QuadMap <-- suggesting I rename this to luLocationQuad ---------------- QuadMapId LocationId  luQuadMap --------- QuadMapId QuadMapName 

Is it safe to assume that she misread the diagram, or is there another definition that I am not aware of?

like image 583
Abe Miessler Avatar asked Aug 05 '10 23:08

Abe Miessler


People also ask

What is lookup table with example?

In data analysis applications, such as image processing, a lookup table (LUT) is used to transform the input data into a more desirable output format. For example, a grayscale picture of the planet Saturn will be transformed into a color image to emphasize the differences in its rings.

What is lookup table in database?

Lookups are an intuitive table linking syntax provided to simplify data integration and SQL queries. They represent foreign key relationships between tables, and once established, can be used to "expose" columns from the "target" of the lookup in the source table or query.

Why do we use lookup tables?

Lookup tables provide the essential function of helping you maintain data integrity in your database environment. For example, if you have users entering their gender into a data item, the table that contains the Gender item can reference a lookup table to verify that only the value M or F is used.

What is a lookup table in Excel?

LOOKUP tables in Excel are named tables used with the VLOOKUP function to find any data. When we have a large amount of data and do not know where to look, we can select the table and name it.


2 Answers

What you have there is called a junction table. It is also known as:

  • cross-reference table
  • bridge table
  • join table
  • map table
  • intersection table
  • linking table
  • link table

But I've never seen the term "lookup table" used for this purpose.

like image 191
Mark Byers Avatar answered Oct 06 '22 04:10

Mark Byers


Pick your battles, but I'd ask for the person to clarify the naming convention seeing that they've suggested using the same convention for one-to-many and many-to-many relationships. Looks like any foreign key relationship means there's a "lookup" table involved.

If that's the naming convention for other databases, then I wouldn't push my luck.

like image 30
OMG Ponies Avatar answered Oct 06 '22 04:10

OMG Ponies