Discussion:
Is there a way to see relationships based on data inside the tables?
(too old to reply)
c***@us.ibm.com
2007-08-26 00:03:51 UTC
Permalink
Hello everyone.

I was wondering if its possible to show relationships based on the data inside the tables.

For instance, if table A has data that relates to table B, I could get a line connecting those 2 tables.

I'm using Rational Data Architect and when I reverse engineer the database it shows all the tables, with the columns. But no relationships show up even though there are relationships.


With mySQL you could connect tables with foreign keys but in this case there are none, only data that relate to each other.


Thanks!
Mark A
2007-08-26 04:12:11 UTC
Permalink
Post by c***@us.ibm.com
Hello everyone.
I was wondering if its possible to show relationships based on the data inside the tables.
For instance, if table A has data that relates to table B, I could get a
line connecting those 2 tables.
I'm using Rational Data Architect and when I reverse engineer the database
it shows all the tables, with the columns. But no relationships show up
even though there are relationships.
With mySQL you could connect tables with foreign keys but in this case
there are none, only data that relate to each other.
Thanks!
If the column names are the same, then there a lot of tools which will
reverse engineer the foreign keys based on the schema, not the actual data.
Knut Stolze
2007-08-26 16:15:00 UTC
Permalink
Post by c***@us.ibm.com
Hello everyone.
I was wondering if its possible to show relationships based on the data inside the tables.
For instance, if table A has data that relates to table B, I could get a
line connecting those 2 tables.
I'm using Rational Data Architect and when I reverse engineer the database
it shows all the tables, with the columns. But no relationships show up
even though there are relationships.
With mySQL you could connect tables with foreign keys but in this case
there are none, only data that relate to each other.
You may want to have a look at the various Data Mining tools. Those are
tailored to find relationships based on the data with a certain likelyhood.
(But I think that's a completely different scenario.)
--
Knut Stolze
DB2 z/OS Utilities Development
IBM Germany
c***@us.ibm.com
2007-08-26 20:00:03 UTC
Permalink
Thanks for the responses guys. I thought it was weird this database had no relationships but some how the data is matching up with queries with no relationships in the table (such as foreign keys).

I did reverse engineer a different schema that also was DB2 and it did show up with nice relationships but not this one.

I'm new to DB2 and IBM (just an intern :D ) but I'm familiar with mySQL and how they related tables. Is there a way to see how tables are related in a certain schema if its not explicitly shown with foreign keys?

I never thought of data mining tools to figure that out, I'll ask my mentor for more information maybe he'll know an easy way.
Knut Stolze
2007-08-27 14:13:15 UTC
Permalink
Post by c***@us.ibm.com
Thanks for the responses guys. I thought it was weird this database had
no relationships but some how the data is matching up with queries with no
relationships in the table (such as foreign keys).
That's not so unusual. A foreign key is merely a constraint that DB2 will
enforce (and exploit during query optimization). If you application
manages such constraints, then DB2's checks would be redundant.
Post by c***@us.ibm.com
I'm new to DB2 and IBM (just an intern :D ) but I'm familiar with mySQL
and how they related tables. Is there a way to see how tables are related
in a certain schema if its not explicitly shown with foreign keys?
The catalog view SYSCAT.KEYCOLUSE shows which columns from which table
participate in a foreign key/primary key or unique constraint. But if
those constraints are not defined, you can only apply some guess-work or
application-specific knownledge.

A basic idea of SQL is that you can combine data from different tables
without having established explicit connections/relationships (as did the
network databases in the past, for example). Therefore, the real question
is what you want to do with the information about relationships...
--
Knut Stolze
DB2 z/OS Utilities Development
IBM Germany
f***@yahoo.com
2007-08-28 17:49:27 UTC
Permalink
Since those tables have matching column names, you may use microsoft Access to link these tables and quickly find out these matched columns on the screen. Even if this is not perfect viable way, but it is a easy way though.

JFeng

Continue reading on narkive:
Loading...