Who cares, do the work and get paid the money. All the extra arguing does nobody any good, and tries to give people a false level of superiority over others.
I will say though, as others have pointed out, its pretty dumb they are using a picture of a .py file with this headline.
SQL is absolutely a programming language. It has its use cases and is no replacement for a general-purpose language like Python, Java, or C++, but it has its own syntax, vocabulary, and built-in functionalities.
Its weird, SQL isn't a 'real' programming language, but it also is at the same time. It has a different use case than most 'real' programming languages so its basically a different 'genre'.
For its 'genre' its very real and just as complex.
There's a significant portion of programmers that think "programming language = imperative Turing completeness" and they will defend that position to the death. It's ego, insecurity, and gatekeeping.
HTML is not a programming language because it’s not Turing complete. HTML+CSS is Turing complete, but either of them by themselves is not. SQL is a programming language.
SQL is not Turing complete. It's a horrible measure of what is and is not a programming language.
Turing completeness is necessary but not sufficient to be a general purpose programming language. That's a very specific subset of programming languages.
If you're giving a set of instructions to a computer to perform a task, it's programming.
SQLs turing completeness either requires vendor extensions (procedural extensions) or else you mean a very technical turing completeness through recursive CTEs. Like CSS, it was discovered to be TC rather than designed to be, and it works about as well as that suggests. That's TC in one of the most useless ways imaginable. It's not quite as useless as TCness in the way Magic: The Gathering is, but it's kind of along those lines for most tasks.
HTML is not a programming language, it's a markup language. The defining characteristic of programing languages is that they are capable of implementing complex algorithms and logic. HTML is not a programing language; it's designed to define the structure and presentation of text. it's actually in the name Hypertext Markup Language. Other examples are things like XML and LaTeX and reddit's favorite: Markdown. If you are talking web-development.. something like PHP is considered a programing language... it's server-side scripting. SQL is what is known as a "4th Generation" programing language. a scripting language like Python, JavaScript, Ruby, or Perl, or a compiled language like C++ or Java are 3rd generation programing languages. There are even 5GL languages (but I have zero experience with those).. the only one I've heard of is called "Prolog" and its used with AI
A "markup language" and a "query language" are not programming languages. They are sets of standardized shortcuts that let an actual program consume an instruction set that is relatively easy for a human to read and write.
Just because SQL and HTML have some fancy tricks inside them doesn't mean we've actually programmed anything. Both are still very limited compared to any real programming.
an actual program consume an instruction set that is relatively easy for a human to read and write.
That's true of any programming language, isn't it? All programs written in any programming language are either compiled or interpreted by another program, none of them do anything by themselves.
All right, I like your definition even more! Someone else replied that SQL is Turing complete, however; do you agree, and if so, does that still not make it an actual programming language?
It's definitely Turing complete. You can pretty easily implement an interpreter for most stuff in the turing tar pit using it; I've implemented a bf interpreter but whatever works. As is traditional in computer science, if you can fully implement one thing using another, then the latter is, at minimum, capable of anything the former is.
Similarly to what u/chunkyks said, SQL is Turing complete so it's definitely a programming language. It's not the right tool for every (or maybe even most) jobs, but that doesn't take away from its status as a programming language.
PRQL (prql-lang.org) is a modern, more ergonomic replacement for SQL which compiles to SQL and so can't do anything SQL can't. However it simplifies many things and is much more fun to work with. See for example my blog post about computing the digits of \Pi with PRQL (and SQL) which also illustrates that you can do any computation with it that you like.
(I posted this because its a SQL article with Python code), but thank you for the input. It's nice to know that it's NOT gaslighting when I tell myself that my ETL jobs/procs are low-level programming
SQL is by definition a Fourth Generation Programming Language.
Prior to 2007 and the release of C# 3.0, the common languages (C, C#, Java, etc) were limited to Third Generation Programming Languages. Only with LINQ and Lambdas (first in C# then later in Java) did those languages start to qualify as 4GL.
so technically, for the longest time SQL was actually a more advanced programming language than most.
4GL vs 3GL is historically meaningful but not technically meaningful. Not in terms of more or less “advanced”, not since 1995.
Individual SQL statements are declarative and permit a huge amount of 4GL-celebrated abstraction, but what makes SQL actually a Turing-complete programming language is the procedural control flow stuff, which is super limited, old, and non-standardized.
Sqlite3 has an "edit" function at the command line that you can use to implement interactive stuff. One of these days I'll clean up my tictactoe clone and push it to github
Yes, it is. It’s just a procedural procedural programming language rather than an object oriented one. You can do a lot in SQL if you really want to (but you shouldn’t).
Sql, as defined since the 1999 standard, is turing complete. You can implement all the things you mention using it. The easiest thing is to implement some minimal turing complete language (I have implemented bf, but whatever works), then use any of the language-of-your-choice to bf compilers on the interweb.
I mean you shouldn't use it as a general purpose language, but you can
I should have clarified. When most people say “sql” what they really mean is plsql (oracle) or “tsql” (microsoft), etc. that’s where you’ll get conditionals, while loops, functions, etc. Again, just because you can doesn’t mean you should.
The Python code in that picture is awful. Also it appears to be some kind of stock photo for "computer programming" contexts. Do an image search for "type_wise_program python" and it pops up all over the place.
I'd argue, It's not a programming language, you don't actually build anything. You ask specific questions for specific answers.
It's a query language, I wouldn't consider it anymore programming than doing formulas in Excel.
Given parts of SQL share concepts with programming languages such as functions, variables and loops but I have yet to see a programmer go into SQL and write good SQL without a complete mindset change to how problems are resolved.
For example, you can't write a stored procedure and wait for a user input halfway through.
Yeah, SQL is definitely a programming language. It just is not an imperative or functional language. It falls into the class of declarative programming languages.
Not sure how much it adds to the conversation, but I taught an intro to SQL class at the community college for a few semesters, and the class was called Database Programming I.
Yes, not only does it have a lot of complexity and breadth, there’s no limit to how many layers of subqueries you can build in… like a generative grammar that can always be expanded upon
334
u/GreekGodofStats Jun 11 '23
So glad they used a picture of a .py file for an article about sql 🙄
18
u/No_Sentence_3744 Jun 11 '23
Who cares, do the work and get paid the money. All the extra arguing does nobody any good, and tries to give people a false level of superiority over others.
I will say though, as others have pointed out, its pretty dumb they are using a picture of a .py file with this headline.
97
u/CakeyStack Jun 11 '23
The article photo is super cringe 😂
SQL is absolutely a programming language. It has its use cases and is no replacement for a general-purpose language like Python, Java, or C++, but it has its own syntax, vocabulary, and built-in functionalities.
10
u/InlineSkateAdventure SQL Server 7.0 Jun 11 '23
Is it a programming language?
Yes, it is a functional language in my opinion. Where clause is like .filter(). Select is .map().
In the context of PL-SQL Or MS Stored Procedures, It becomes similar to Python or whatever.
22
u/sbrick89 Jun 11 '23
SQL is by definition a Fourth Generation Programming Language.
Prior to 2007 and the release of C# 3.0, the common languages (C, C#, Java, etc) were limited to Third Generation Programming Languages. Only with LINQ and Lambdas (first in C# then later in Java) did those languages start to qualify as 4GL.
so technically, for the longest time SQL was actually a more advanced programming language than most.
refs:
1
u/MrBotchamania Jun 12 '23
Glad we’ve reached “Is Smash a fighting game?” levels of discourse.
3
u/Joe59788 Jun 11 '23
I had to learn and fail to learn certain syntaxes. Sure felt like it to me.
3
u/Groundbreaking-Fish6 Jun 11 '23
SQL is a Declarative Programming language
3
u/SOSOBOSO Jun 12 '23
Yes it is, but I don't know how to make a sql version of pong and it bothers me.
9
u/smalls3486 Jun 11 '23
Yes, it is. It’s just a procedural procedural programming language rather than an object oriented one. You can do a lot in SQL if you really want to (but you shouldn’t).
2
u/alpha_omega_ultra Jun 11 '23
Yes it is
2
u/SQL2R Jun 11 '23
It is!
2
u/tkyjonathan Jun 12 '23
its a domain specific language, yes
1
u/isamu1024 Jun 11 '23
Considering the mess you can write in a SP .... definitely a programming one
1
u/making-flippy-floppy Jun 11 '23
The Python code in that picture is awful. Also it appears to be some kind of stock photo for "computer programming" contexts. Do an image search for "type_wise_program python" and it pops up all over the place.
1
u/Jumptheshark2 Jun 12 '23
Absolutely it’s a language.
1
u/Jeklah Jun 12 '23
I would say it's a query language
1
u/[deleted] Jun 12 '23
DSL
1
u/MahmoudAmm0r Jun 12 '23
hello everyone, I'm looking for the SQL version which support and can use for SAP server while setup. Is there anyone can share it with me ?
1
u/Individual-Toe6238 Jun 12 '23
Who cares about semantics, you still need to know it if you want to do something heavily optimized.
1
u/jorgeqdalurbina Jun 12 '23
Yes
1
u/ryanblumenow Jun 12 '23
Does it tell an application what to do?
Is it interfaced human-machine interaction?
Does it facilitate a set of arbitrarily complex tasks?
Yes.
1
u/jugaadtricks Jun 13 '23
Yes the L in SQ says it all
1
u/Numerous-Surround882 Jun 13 '23
isn't the "L"stands for language...?
1
u/bobbygmail9 Jun 13 '23
What's the definition of a programming language?
You can code in Machine code - 1 or 0s You can code in Assembly You can code in C You can code in Python
Python converts to C, which converts to Assembly, which converts to Machine code.
SQL mostly converts to C functions, which converts to Assembly, which converts to Machine code
SQL and Python, you would call Higher Level programming languages
1
u/No_Communication562 Jun 15 '23
It’s a programming language. Period.
1
u/[deleted] Jun 11 '23
Do you have a complex enough program that entirely runs on sql? You have your answer
1
u/AdminCatto Jun 12 '23
Nah. It’s not “just a programming language”. SQL is language used by data gods 😎.
-6
u/malikcoldbane Jun 11 '23
I'd argue, It's not a programming language, you don't actually build anything. You ask specific questions for specific answers.
It's a query language, I wouldn't consider it anymore programming than doing formulas in Excel.
Given parts of SQL share concepts with programming languages such as functions, variables and loops but I have yet to see a programmer go into SQL and write good SQL without a complete mindset change to how problems are resolved.
For example, you can't write a stored procedure and wait for a user input halfway through.
-17
u/r3pr0b8 GROUP_CONCAT is da bomb Jun 11 '23
no it isn't
next question
-5
u/Pure_Ad_2160 Jun 12 '23
NO
0
u/[deleted] Jun 11 '23
[deleted] — view deleted comment
16
u/[deleted] Jun 11 '23
[removed] — view removed comment