stefanwagner
Programmer
I like to know, whether it's possible to get relation-informations from a database, how a table is joined (semantically) with another.
Example (* indicating primary key):
A user (not a dba) uses a program, and needs informations from orders and product_description.
He's not a teached in databases, and the program shall find the relation between orders and product_description on it's own.
Is it possible with sql?
With jdbc?
In this special case, the naming is helpfull - order_id and product_id use the same name in the table, where they are primary key, as well as where they are foreign key.
I know how to get all table- and column-names with metadata, and of course I could try to search for the shortest connection via columnnames between two tables.
But this can be a lot of work for a huge database (reminds me of the travelling-salesman-problem).
It might lead to wrong results, when columnnames match unintentionally.
It might lead to no result, when the creator of the tables didn't use such naming-conventions.
Are such naming conventions very common in the sql-field?
(preferred: a hint for a common solution over a special oracle-solution over something else).
seeking a job as java-programmer in Berlin:
Example (* indicating primary key):
Code:
orders: order_id *, order_date, ...
order_items: order_id, line_item_id, product_id, ...
product_information: product_id*, product name, product_description, ...
He's not a teached in databases, and the program shall find the relation between orders and product_description on it's own.
Is it possible with sql?
With jdbc?
In this special case, the naming is helpfull - order_id and product_id use the same name in the table, where they are primary key, as well as where they are foreign key.
I know how to get all table- and column-names with metadata, and of course I could try to search for the shortest connection via columnnames between two tables.
But this can be a lot of work for a huge database (reminds me of the travelling-salesman-problem).
It might lead to wrong results, when columnnames match unintentionally.
It might lead to no result, when the creator of the tables didn't use such naming-conventions.
Are such naming conventions very common in the sql-field?
(preferred: a hint for a common solution over a special oracle-solution over something else).
seeking a job as java-programmer in Berlin: