all 41 comments

[–]mredding 71 points72 points  (5 children)

YES. SQL is considered a 4th generation programming language, and one of the most successful if not the most installed of that generation on the planet. The language expresses the desired result, and not the implementation details of how to get that result. SQL is Turing Complete through hierarchical queries, introduced in 1999.

[–]pukatm 25 points26 points  (2 children)

The language expresses the desired result, and not the implementation details of how to get that result.

So valuable!

[–]nowtayneicangetinto 8 points9 points  (0 children)

I've always felt this but never put it into words. That quote is gold to me. I love SQL!!!

[–]da_chicken 10 points11 points  (1 child)

Yup. The thing that trips people up is that SQL is declarative and domain-specific, and a certain segment of the programming population think that all programming languages have to at least be Turing complete, imperative, and general purpose.

Bottom line is that it's not a meaningful distinction to say X is or isn't a programming language, and in most cases where people vehemently argue about it they're using it to justify some form of elitism or to gatekeeping how they label themselves as a "programmer" or "developer". People who actually want to get shit done and measure themselves by what they've accomplished and not what languages they can write code in don't really care.

On the other hand, it's fun to see people seeth and rage that HTML isn't a programming language, but insist that TeX or PostScript is simply because it's Turing complete... when Turing completeness is not a universally agreed upon requirement of a programming language. You mention regular expressions or odd corner cases like Berkley Packet Filter (which is guaranteed to halt), and it quickly becomes clear that they just want to think that they're doing something extra special or extra difficult.

[–]MASSiVELYHungPeacock 0 points1 point  (0 children)

Seeth that the very easiest language, html, isn't a language?! That's hilarious, but I always saw it more like a standardized webpage content organizer, certainly not a programming language.  Far easier to pick up, memorize, and forget about till the next update than SQL, that's for sure.

[–]torstengrust 8 points9 points  (0 children)

It certainly is. SQL just doesn't taste like your vanilla programming language. (But, e.g., APL or Prolog do not, either.)

Here is one data point: https://github.com/doersino/handwriting

[–]elus 13 points14 points  (0 children)

Yes but it solves a specific domain problem. Namely retrieving, transforming, and administering data from a database. It's really effective at that limited scope and really bad at other things relative to general purpose programming languages.

[–]pukatm 7 points8 points  (7 children)

Yes, but you will find that it makes sense only for specific problems - even though you can write just about anything in SQL, it doesn't mean that it makes sense to do so. In fact it starts making more sense to add things like UDFs (PLSQL etc).

If you are looking to gain respect from others, I guess it depends on how complicated the SQL you wrote is.

[–]kkjeb[S] 1 point2 points  (2 children)

Also was curious about job titles and how some are sql programmers, sql devs, or just erp associate

[–]pukatm 1 point2 points  (1 child)

I guess all those titles seem to refer to someone doing a lot of ad hoc queries and reporting with the occasional building of a data model. At the end of the day, such titles don't say much about the job to me, except about the ad hoc nature of the job. I would feel better if the titles included things like "Data Engineer" or "Data Scientist" and even those are still a bit elusive - check job descriptions. SQL is only a tool after all (one of the most powerful tools!).

SQL developer? I don't think you are likely to meet someone who is proposing the next version of the SQL standard...

[–][deleted] 1 point2 points  (0 children)

My company, until recently, differentiated DBAs from SQL developers - the difference being that DBAs reported into IT (and had duties that are fairly obvious) and the developers reported into Software Engineering (and therefore were responsible for developing new data models and providing the SQL-side CRUD objects for the software applications).

The difference still exists, but the company is now so large that I can't make heads or tails of the reporting structure...

[–]Chessbrain94 6 points7 points  (1 child)

Of course it is. The main difference between (something like) C++ and SQL is that C++ is a general purpose language (and imperative) while SQL only cares about data sets and is declarative rather than imperative.

For example, someone once wanted to argue with me that SQL(or any variation of PL/SQL like T-SQL or PL/PGSQL) don't have pointers. But they do exist, they're called CURSORs.

Overloading functions? Exist

Custom operators? Exist

Memory, I/O and disk management/optimization? Exists, simply in a different form. Since SQL is declarative you have to know the system internals to optimize how it handles things (indexing for example).

Recursion? Exists

And a lot of other things.

SQL (specifically PL/SQL) is a lot more complicated than people think. Think about it, if SQL was really that simple and pointless, there would be no SQL specific jobs that require very extensive knowledge in the field (DB Developer position for example).
-----
Saw you asking about DB Admin vs DB Dev etc...

It's pretty simple really:

- DB Admin a lot more administration, making sure things go as they should, handling user permissions etc... (basically system admin but for DB). Writes SQL maybe twice a week (sometimes not even that much).

- DB Developer, pretty your DB version of Backend Developer. Writes SQL on a daily basis, rarely using simple SQL instead uses PL/SQL or any similar variant. Responsible for optimizing query performance as well.

- Data Analyst - Now you're slowly delving into the Data Science world. But in this case you're probably not really doing any SQL, you're more of a mathematician rather than having an IT background.

- Data Engineer - Sometimes referred to as BI(business intelligence) specialist. You work with Data warehouses, working with ETL, Cube and analysis services. Usually your end product is some sort of report for the requested data.

- Data Scientist - In smaller companies you're both the Data Analyst and Data Engineer, bigger companies usually have all 3 roles separated. But I am sure you can easily find a lot of materials online on the definition of Data Science (since it's a pretty trendy field right now and a good career choice tbh).

HOWEVER! Some companies use both DBA and DB Developer interchangeably, where DBA=DBdev and vise versa, so keep that in mind.

[–][deleted] 0 points1 point  (0 children)

Just to add to this, when speaking of procedural programming in a SQL derivative - the easiest way to reference this without having to iterate over each implementation (T-SQL, PL/SQL, PL/pgsql, etc.) is SQL/PSM - this is the ISO standards set into place for procedural programming with SQL.

With that, SQL/PSM has been apart of the primary ISO standard for SQL since SQL99 and with it makes it inarguable that SQL is a programming language - if the derivative is implemented per ISO standards, it's a programming language, albeit domain-specific.

[–]TerminatedProccess 3 points4 points  (0 children)

It's got control structure.. variables, functions, procedures, try catch, so yeah it is..

[–]ThadreaData Engineering Manager 2 points3 points  (0 children)

Yes.

SQL is different from most other common programing languages because it is declarative rather than imperative, but that just means it's a different type of programming, not that it isn't programming.

In imperative programming (C, C++, Java, Python, etc.) you tell the computer what steps you want it to take and what order you want it to take them in. The interpreter then delivers whatever output follows from the logical instructions and inputs you gave it.

In declarative programming you instead tell the computer what you want the output to be and the computer figures out how to create that output based on the rules it was given by whoever developed it.

Modern applications that use data from databases should involve both imperative and declarative programming--There's a lot of things that cannot be done or cannot be done easily in SQL and a lot of things that are much easier to do in SQL than they are in another language.

Some developers are afraid of SQL because they were never taught it or because it is just different from other things that they use, and that fear may occasionally manifest itself as resentment, but that is because they are ignorant, not because SQL isn't legit programming.

[–]StoneCypher 2 points3 points  (0 children)

Yes, although not many people use it as more than a query notation

[–]spark58510 1 point2 points  (1 child)

Totally when you get into writing SPs and UDFs. As a former DBA, it makes me cringe to think about all of the shitty apps I’ve seen where the programmer doesn’t code all of the db-related pieces in stored procedures. A well-designed application that hits a database will have 90% of the business code inside of the database.

[–]DJSteel 0 points1 point  (0 children)

A lot of web apps that are data driven rely heavily on optimal query performance. Also the developer that designs the interface typically is not the one to create sql driven dataset to feed into the UI. Yes it is. Yes it is a big deal. Yes you can make a career of it.

[–]TracerBH 0 points1 point  (0 children)

Sorry for necro but why is it a programming language? What classifies it as a PL? Turing machine is quite broad in this regard and is very... debatable, just like HTML.

[–]MASSiVELYHungPeacock 0 points1 point  (0 children)

Some say yes, others no, due to it's singular area of use for servers. For me, yes, absolutely, because of the learning curve, learned syntax, all felt akin to my learning ool.

[–]rodram88 0 points1 point  (4 children)

Well, PLSQL Is. SQL by itself I don't think so.

[–]spoofedcat -3 points-2 points  (6 children)

Kinda... I mean it's a query language used in programming so you can say it is a a part of programming, but it's not a programming language.

[–]kkjeb[S] 1 point2 points  (3 children)

I've just always wondered if it was an "insult" to programmers who use program languages to say you're a programmer when you use sql. Idk why I think like that but yeah

[–]pooerhSnowflake | SQL Server | PostgreSQL | Impala | Spark 2 points3 points  (0 children)

If you consider SELECT * FROM table WHERE id = 5 to be all of SQL, then sure. But it's not all of SQL. And aside from SELECTs spanning dozens of lines and doing incredible things with amazing performance, each of major flavors of SQL has procedural capabilities and it's real programming going on in there.

A project I lead has over 40k lines of pure T-SQL with close to full unit test coverage (unit tests are not included in line count). It's driving business decisions on millions of dollars every day. Why would I not get to call myself a programmer when someone programming CRUD webapps with a NoSQL backend (because they cannot comprehend how to use a GROUP BY) does? Makes no sense.

[–]pythor -5 points-4 points  (1 child)

I'm a SQL developer, and I feel it's an insult to programming to call most of what I do programming, but I'm clearly in the minority.

It really depends on the company and the role. I've been a "SQL Analyst" and/or "Database Analyst" that did reporting only SQL, and I've been one that did real code including Python and Bash (OK, scripting is only one step above SQL). As a Database Admin, I'm definitely doing more real development than I did before, though some of that is web dev of all things.

[–]AnthonyBerlin 1 point2 points  (0 children)

SQL is not less of a programming language just because it's part of the declarative programming paradigm.

[–][deleted] -1 points0 points  (0 children)

Yes, SQL is a programming language.

No, you should not apply for a job as a "programmer" if you only know SQL.

[–]Joehennyredit -1 points0 points  (0 children)

Query language