4 ms·
"The syntax is meant to resemble English", obviously. The link to https://www.lib.umn.edu/collections/special?id=291 https://www.lib.umn.edu/collections/specia
by lupire 3y ago
"The syntax is meant to resemble English", obviously.
The link to https://www.lib.umn.edu/collections/special?id=291 https://www.lib.umn.edu/collections/special?id=291 is dead, though?
- sverhagen 3y agoEnglish readability is only true for the simplest of queries. That goes overboard quickly as complexity increases. So I'd happily give that up for the from-select order if it means better code completion.
- doubled112 3y ago"Select green apples from the refrigerator" vs "from the refrigerator, select green apples" The first is much more naturally spoken.
- bigfudge 3y agoIn English. I think other languages would have different word orderings. German for one, and I think maybe Russian too.
- reportgunner 3y agoBut SQL is using english words, what does german and russian have to do with it ?
- snarfy 3y agoThe second version is how you would say it in Spanish.
- taeric 3y agoI'm actually assuming most of the time you would leave off the "from" entirely in spoken language. It is implied or completely obviated by lack of choices, no?
- rangerelf 3y agoWhich Spanish? "Saca las manzanas verdes del refrigerador" Seems like the first example, vs: "Del refrigerador, saca las manzanas verdes" That sounds a bit stilted to me.
- Izkata 3y agoI propose Japanese: Green apples, from the refrigerator, select.
- randomdata 3y agoUntil you encounter a more complex example. Now it is "Select green apples from the refrigerator, insert more milk into the refrigerator, and remove any expired items from the refrigerator" which is less natural. In contrast, the father of SQL, Alpha, allowed: "From the refrigerator, select the green apples, insert more milk, and remove any expired items."
- deleted 3y ago[deleted]
- em500 3y agoWhat SQL shares with English (and most other natural languages) is that the rules are sometimes confusing/inconsistent/illogical, but evolution is very slow so most of us are probably stuck with the status quo during our lifetimes (career time for SQL) due to the overwhelming network effects.
- happymellon 3y agoThe problem with English is that it isn't really a single language but a mashup of Latin/French/German/Scandinavian due to the number of invasions and each invader not really covering the whole country. A simple way to demonstrate this is how we ended up with cities that have massively different pronunciation even though the spelling is similar.
- ben7799 3y agoThis is the obvious answer assuming the designer of SQL was a native english speaker. Most of these arguments that it should work some way logical to the DB make too many assumptions about how the internals of the database work and don't think about how the query optimizer/planner might work very differently than the way a query is organized. SQL is really old now, 50+ years, assumptions about how it worked or work are probably not that relevant across its entire history. I first learned it almost 30 years ago now, it was definitely taught back in the day that SQL was one of those odd languages that was designed assuming you "wouldn't need an engineer" to write it. Laughable but would explain why engineers might not find the syntax logical.