3 ms·
> Why doesn't it infer them from the structure of the database (the relations between tables)? That's because the structure doesn't always has the feature whic
by avmich 8y ago
> Why doesn't it infer them from the structure of the database (the relations between tables)?
That's because the structure doesn't always has the feature which you need this specific time to rely upon. And that's a feature, not a bug, which allows having flexibility between data structure and data queries.
If you have a relation, DB engine maintains that, ensuring integrity defined as such. However, you are free to query non-integral (in this sense) references, which you're able to describe in queries. If you won't be able to specify joins, you'd have to always express relations in the structure. Since queries in SQL can be arbitrary, to reach parity with flexibility you'd have to have all possible relations. Then you have the problem of choosing what you need for this moment. In other words, some relations are not known before query time.