6 ms·
Don’t these exist for a reason?
by Koshkin 4y ago
Don’t these exist for a reason?
- andy81 4y agoOf course. You've got a list of countries and are pulling each country's national flower, national bird, largest port city etc. Without outer joins, Liechtenstein with no ports doesn't show in the list at all. Sad news for people who want to know all countries, or Liechtenstein's national bird (eagle).
- vbezhenar 4y agoYou’re not obliged to pull everything in one request. You can issue several requests.
- tremon 4y agoSure. You're also not obligated to include a WHERE-clause in the query you send to your database. You can do the filtering in the application.
- vbezhenar 4y agoWhat's your point? You can live without nulls, they're not required and you don't need to avoid WHERE-clause for that. It's a theoretical concept, nobody in sane mind would do that, but nulls are not required for relational algebra.
- tremon 4y agoYou started this subthread by asserting that one shouldn't use outer joins, and when other people pointed out valid use cases for outer joins, you advocated to use application logic to work around your refusal to use them. My response was just to point out the absurdity of your premise.
- ErwinSmout 4y agoYes. The reason is lazy people expect to be able to ask five questions in one go and expect one single answer to answer all five of them. The key is to realize that submitting a query is to ask a question. So how many queries to you think you have to issue if the number of questions you have is five ? It is technically perfectly possible to "ask five questions at the same time" to any given truly relational DBMS. Said DBMS will give five answers at the same time (and not leave you to guess which answer corresponds to which question). That SQL doesn't do it, does not mean it's impossible.