HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

Are there any database engines which will intuit the join condition based on the existing foreign keys?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
theconditionexistingareenginesanyforeignjoindatabasekeys

Problem

It seems strange to me that, when I've defined a foreign key, the engine cannot use this information to automatically figure out the correct JOIN expressions, but instead requires me to re-type the same clauses. Are there any databases, perhaps some kind of research project, that will inspect the existing foreign keys?

Solution

I'm not aware of any that use foreign keys (and that would can be messy if you have more than one foreign key back to the same table)

But Oracle will base joins off of name of columns if you don't specify a specific join type nor a join condition, or if you use NATURAL JOIN

Context

StackExchange Database Administrators Q#396, answer score: 4

Revisions (0)

No revisions yet.