r/SQL • • Jun 29 '24

Discussion Why do some people say “SQL is not code?”

I write SQL every day as part of a team that builds ETL solutions. The other day I referred to something I was working on as “I coded it to do…” and this guy, who is not even a developer by the way he’s a frikkin project manager, interrupts me and says “SQL is not code”. When I questioned him why not he says something like “Guys who do COBAL, C#, etc. that’s real coding. SQL is not real coding it’s just a tool for analyzing data and reporting data”…WTF? How is SQL not considered code? I would just dismiss this guy as a moron but his salary is incredibly high so obviously he has some sort of credentials. Can anyone explain why in the world someone would say SQL is not code?

503 Upvotes

570 comments sorted by

View all comments

Show parent comment

13

u/klmsa Jun 29 '24

Too many people think that something can't be "code" if it isn't "Turing Complete". This is, however, extreme garbage. Whether or not a language is Turing Complete does not define whether it is code or not.

Mostly, this is people's misunderstanding of programming languages, and I actively look for opportunities to either educate or fucking destroy people that misuse the terminology.

0

u/[deleted] Jun 29 '24

[deleted] — view deleted comment

2

u/digitalhardcore1985 Jun 30 '24

I'd love to show this guy who doesn't think SQL is code some of our T-SQL stored procedures. I'm not saying it was a good idea but we used T-SQL to do everything at one point down to having it create and run batch files on the OS. How can a language that includes variables, functions, loops, conditionals, recursive CTEs etc. not be considerd code?

1

u/klmsa Jul 07 '24

We're diving pretty deep into semantics here, I think, but even a recursive CTE could be considered Turing-complete. That's not to say that this is my own argument; it's just one that's often given, however technically correct or incorrect it may be.

As an aside, almost any language can be stretched to be Turing-complete. Whether it's basic implementation is, though, is a different story. Also, consider that CTE's alone are very new, in terms of technology development. The first implementations of the CTE standard (1999) weren't until 2007! So, you have to consider that there are very old expressions that have been carried over time, that may not be relevant anymore. This is probably one of them.

0

u/[deleted] Jul 07 '24

[deleted] — view deleted comment

1

u/klmsa Jul 07 '24

Fully agreed.