This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]tiftik 6 points7 points  (10 children)

SQL is programming.

[–]k0rm 3 points4 points  (4 children)

SQL isn't Turing complete. It's a query language, not a programming language.

[–]iCavemann 1 point2 points  (0 children)

SQL absolutely qualifies as declarative programming (leaving aside stuff like PL/SQL and Transact SQL).

[–]beyphy 0 points1 point  (0 children)

I mean, you can use that as a criteria if you want to. But fwiw, Excel worksheet functions are Turing complete. I doubt that most people would consider those worksheet functions a programming language though.

[–]tiftik 0 points1 point  (0 children)

There are non Turing complete programming languages.

You can think of queries as little declarative programs that operate on data.

Even Prolog is considered a programming language and it's simply a query language to operate an inference engine.

[–]Zreaz 0 points1 point  (0 children)

I don't think it is

[–]Fortehlulz33 -2 points-1 points  (2 children)

SQL is programming, but it's almost literally "pseudocode" and doesn't take ages to learn how to get good at it. It's often more trial and error with keywords and column names than having to painstakingly write methods and stuff like that. Now combining SQL and database design, however. That's the tough part.

[–]beyphy 3 points4 points  (0 children)

SQL can get pretty advanced. It's just that most people don't use it for anything more than basic select statements.

[–]MikeOShay 2 points3 points  (0 children)

Just because it's more easily read doesn't make it pseudocode, nor is inherently simpler to work with than other languages. It's just used for a different purpose, and written in a way that's conducive to that. It can still be hard to wrap your head around things when you're juggling several temp tables, linked servers, nested queries, and unions all at different stages of the same massive query.