top | item 40580420

(no title)

bagol | 1 year ago

The only problem I have with SQL is that `SELECT` comes first instead of last. It prevents the development of good tooling.

discuss

order

systems|1 year ago

well its trade off , its easier to read, maybe a bit harder to write

also remember that sql is a query language not a programming language, so the main target are not programmers

also think of it this way, it might help, you start with that you really want

  select firstname, lastname, hobby 
so you start by saying you want a table (a relation, a relvar) that have first name , last name etc ... this is what you want then you tell me where to get it from

  from users 
so the order is not bad , it like saying, get me a a drink from the box you wont say, from the box get me a drink

select first resembles more natural language, and is more declarative

from first, is more procedural

what i want first, then how --> declarative

how to find what i want, then what i really want --> procedural

wodenokoto|1 year ago

If I start deciding on my with the table, my query editor can tell me what I can select. I've never seen a query editor that looks at the select table and suggests tables based on that.

a_aitch|1 year ago

Could you elaborate? I'm curious why that makes a difference.

cyberax|1 year ago

For auto complete, for example.

pmoleri|1 year ago

Select Na..

vs

From Users Select Na...