Bridge Table

What is the use of bridge table. Can give a simple example?

Questions by sharuvijay   answers by sharuvijay

Editorial / Best Answer

Sirini  

  • Member Since Jun-2009 | Jun 14th, 2009


An example of a Bridge table would be relationship table between student_master and courses_master. A Student may participate in multiple courses and obviously in a course there will be multiple students. In this scenario to maintain relationships between student_master and courses_master we need another table, which may be called, Student_courses. This table will have all relationships between Students and Courses.A bridge table is a table that only contains the keys between the two tables in a many-to-many relationship. These tables typically consist of mostly key fields, the primary keys of the two tables needing the many to many relationships. Sometimes there are more data elements, but often there are only two columns, both foreign keys.

Showing Answers 1 - 12 of 12 Answers

siva.3aug

  • Feb 8th, 2009
 

Bridge table is also known as helper table or reference table.
If there is a many to many relationship between fact table and dimension table then we use bridge table to resolve this relationship (this bridge table is anology to associative entity between two entities having many to many relation ships).

Bridge table is also used to flatten out the hierarchy in the dimension table.
Thanks
Siva

Sirini

  • Jun 14th, 2009
 

An example of a Bridge table would be relationship table between student_master and courses_master. A Student may participate in multiple courses and obviously in a course there will be multiple students. In this scenario to maintain relationships between student_master and courses_master we need another table, which may be called, Student_courses. This table will have all relationships between Students and Courses.A bridge table is a table that only contains the keys between the two tables in a many-to-many relationship. These tables typically consist of mostly key fields, the primary keys of the two tables needing the many to many relationships. Sometimes there are more data elements, but often there are only two columns, both foreign keys.

tisha24

  • Oct 7th, 2009
 

A table which maintained to define the relationship between two different tables is known as bridge tables.
For example, say there are two tables one table with employee information (an employee table), and other with deparment details.
Now a bridge table coming to picture to maintain the relationship between an employee with his/her department. which contains informations like which employee belongs to which department.

Here is a example to understand More precisely,

Employee table
 --------------------
EMP_CD      EMP_name     DOJ
1001             MR.X             12-06-2006
1002             Ms.Y              24-11-2004
1003             MS.K              25-02-2004

Department table
-----------------------
DEPT_CD    DEPT_NAME               SECTOR_CD    MANAGER_NM
IT_DEV         S/W Developer           SDV                    MR.XL
MNGNT       HR Management            HRD                   MS.DS

EMP_DEPT (Bridge Table)
---------------------------------
 EMP_CD         DEPT_CD
   1001              MNGNT 
   1002              IT_DEV 
   1003              IT_DEV

vijsarav11

  • Oct 19th, 2009
 

Hi all... This is my view on bridge tables:

Bridge table in simple can be called as reference tables. As the name indicates, this table can be used to link two tables with 1 reference id.

It can be explained in detailed with the below example.

Say, 2 customer have taken two mortgage loans in a bank  in such a way that in one loan with 2 borrowers and another with only one.
In order to link Customers with the Account, the table structure can be designed as:

Accounts - Table:
----------------------
AccountId Account_Open_Date
10123 05-02-1975
14535 06-08-2000

Customer - Table:
-----------------------
CustomerId Customer_Name Customer_Status
25366 Jon Burvill Primary
25367 Mariola Secondary

Customer Bridge Table:
------------------------------
Customer_Bridge_Id Account_Id Customer_Id
7894654 10123  25366
7894655 10123  25367
9656456 14535 25366 

When Customer & Customer Bridge Id are called, then the data with account details will be retreived.

Regards
Viji

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions