| ▲ | TomasBM 7 hours ago | ||||||||||||||||||||||
Somewhat tangential to the article, but why is SQL considered a programming language? I understand that's the convention according to the IEEE and Wikipedia [1], but the name itself - Structured Query Language - reveals that its purpose is limited by design. It's a computer language [2] for sure, but why programming? [1] https://en.wikipedia.org/wiki/List_of_programming_languages | |||||||||||||||||||||||
| ▲ | derriz 7 hours ago | parent | next [-] | ||||||||||||||||||||||
With support for Common Table Expressions (CTE), SQL becomes a Turing complete language. To be honest, it makes me somewhat uncomfortable that a query sent to a DB server could be non-terminating and cause a server thread to enter an infinite loop. On the other hand, the practical difference between a query that contains an infinite loop and one that runs for days is probably negligible. | |||||||||||||||||||||||
| ▲ | Imustaskforhelp 7 hours ago | parent | prev | next [-] | ||||||||||||||||||||||
To be honest, I'd like to chip in that it is technically possible to write brainf*ck, an esoteric programming language but nonetheless, its a programming language https://www.reddit.com/r/SQL/comments/81barp/i_implemented_a... Btw this runs in sqlite, you can try it yourself if you are interested. Source: I was thinking of creating a programming language paradigm like sqlite/smalltalk once where resumed execution/criu like possibilities were built in. Let me know if someone knows something like this too. I kinda gave up on the project but I knew that there was this one language which supported this paradigm but it was very complicated to understand and had a lot of other first time paradigm like the code itself / the ast tree is sort of like a database itself but so the tangential goes. | |||||||||||||||||||||||
| ▲ | pjmlp 7 hours ago | parent | prev | next [-] | ||||||||||||||||||||||
Because stored procedures do exist, and there isn't a single production quality RDMS that doesn't go beyond DDL and DML, adding structured programming extensions. Also, even within the standard itself, it allows for declarative programming. | |||||||||||||||||||||||
| ▲ | yawaramin 7 hours ago | parent | prev | next [-] | ||||||||||||||||||||||
What is your definition of 'programming language'? | |||||||||||||||||||||||
| |||||||||||||||||||||||
| ▲ | rawgabbit 7 hours ago | parent | prev | next [-] | ||||||||||||||||||||||
Because "programming language" is an adjective or a descriptive term. Whatever looks like a programming language, can be called a programming language. | |||||||||||||||||||||||
| ▲ | randomNumber7 6 hours ago | parent | prev [-] | ||||||||||||||||||||||
Also SQL is not turing complete. I see it more as a descriptive language like e.g. html is a language but not a programming language. | |||||||||||||||||||||||
| |||||||||||||||||||||||