Data Modeling:Lookup table and Main table:establishing relationshi

S

sql-oholic

I am working on creating data model from existing database using MS
Visio 2007 Profesional Edition.
Existing database is w/o PK-FKs & I am working to create relational DB
which enforces RI.
I have a lookup table which contains language codes,used by main
table. The problem ,I am running into, is that these
languagecodes(from lookup table) are used by 3 columns in main table.
So, I am wondering how can I enforce PK-FK relationship here.
As in...
language_code from lookup table is PK and it has to associated w/
column(s) existing in main table.
Something like following:
Lookup Table Main table
Column#1 Column A
column#2 Column B
Column C
Column D
I want to link Column#2 to Column A, Column B and Column C.

FYI:
I think VISIO doesn't allow relating a single column (Of lookup table)
to 3 different columns(of main table). It associates with Either ColA
or ColB or ColC.. not with all of them

Please advise

Thanks
 
B

Barb Way

It's true that Visio doesn't have a mechanism to set up such a structure,
as far as I know. But I'm trying to understand how you set it up in SQL
(for instance). What DDL code would you use to define the relationship as
you envision it? You have to basically ask SQL to parse a single column
into three columns ... which would require code of some sort. A trigger
is not a relationship.

Barb Way
Product Support - Visio
Microsoft Corporation
[This posting is provided "As Is" with no warranties, and confers no
rights.]
--------------------

I am working on creating data model from existing database using MS
Visio 2007 Profesional Edition.
Existing database is w/o PK-FKs & I am working to create relational DB
which enforces RI.
I have a lookup table which contains language codes,used by main
table. The problem ,I am running into, is that these
languagecodes(from lookup table) are used by 3 columns in main table.
So, I am wondering how can I enforce PK-FK relationship here.
As in...
language_code from lookup table is PK and it has to associated w/
column(s) existing in main table.
Something like following:
Lookup Table Main table
Column#1 Column A
column#2 Column B
Column C
Column D
I want to link Column#2 to Column A, Column B and Column C.

FYI:
I think VISIO doesn't allow relating a single column (Of lookup table)
to 3 different columns(of main table). It associates with Either ColA
or ColB or ColC.. not with all of them

Please advise

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top