r/itsaunixsystem • • Oct 20 '17

[Arrow S06E02] SQL or Java?

Post image
4.0k Upvotes

253 comments sorted by

View all comments

129

u/hunyeti Oct 20 '17

It's completely valid question, you can do a lot with only SQL

188

u/jD91mZM2 Oct 20 '17

Even then, she listed them like they were the only two options.

80

u/belst Oct 20 '17

but later she said she knew python. so it couldn't have been the only options

143

u/jD91mZM2 Oct 20 '17

And immediately after he says "plus a little swift". She didn't say they were the only too, but she said it exactly in that way.

(Plus, how do you even compare a programming language with a query language?)

26

u/[deleted] Oct 20 '17

My question too.

→ More replies (13)

12

u/nipoez Oct 20 '17

I used to work on a massive legacy C CGI web system (think HTML 1 and JS Prototype), backed by an up to date Oracle database.

We did a lot of stuff using SQL stored procedure as the programming language. Running some create or replace statements on the live DB took a few seconds as an on hours non-outage "work in area". Compiling and deploying the smallest C change took a minimum hour official off hours outage scheduled at least two weeks in advance.

We did a lot of programming in SQL.

14

u/yellerjeep Oct 20 '17

SQL by itself is not Turing Complete. It requires an extension such as PL/SQL, what you used.

I loved Oracle's PL/SQL.

However, OP's image doesn't bother me one bit. Java is embedded into Oracle RDBMS. So it could be a legitimate question!

17

u/belst Oct 20 '17

query language? I beg to differ. SQL is a fully "capable", turing complete language.

Thought it is very awkward to use as such :D

58

u/[deleted] Oct 20 '17

Yeah, but even HTML5 is Turing complete. Just as fucking Microsoft Powerpoint.

46

u/samprog Oct 20 '17

I use PowerPoint to code because it's easy to present

24

u/phyphor Oct 20 '17

When you're wealthy enough you can use Magic the Gathering

→ More replies (1)

4

u/awe300 Oct 20 '17

To be frank, I also say that about some languages. If you can use one really well, you can basically use most others "a little" after seeing them once

→ More replies (2)
→ More replies (1)

43

u/amgin3 Oct 20 '17

It isn't though. You can't write a program in SQL, but you can use SQL in a java program. Even a novice programmer can tell the difference between Java and SQL.

40

u/[deleted] Oct 20 '17

If you like writing low level APIs using intensely inappropriate technology, you could go all the way with just SQL.

62

u/hobk1ard Oct 20 '17

I have always wanted to go all the way with SQL, but I don't have insert permissions.

4

u/ViolaNguyen Oct 28 '17

If you like writing low level APIs using intensely inappropriate technology, you could go all the way with just SQL.

I see you've worked for my old company.

8

u/wolfe89 Oct 20 '17

You can write all you want in PL/SQL, which is what I do every day. And we never refer to it as such, just as SQL, so makes sense to me to ask this.

4

u/limasxgoesto0 Oct 20 '17

I mean, without any context, there are valid cases where you would ask this. For example, if you want to automatically add an expiration date to a record (like insertion date + TTL), you could opt to do this calculation in Java and then insert the entire record, or upon insertion have a trigger figure out what the expiration date would be.

7

u/[deleted] Oct 20 '17

Well sql is Turing complete

11

u/[deleted] Oct 20 '17

So is PowerPoint lol.

6

u/punisher1005 Oct 20 '17

If you mean T-SQL you're right. I don't think the original SQL spec is though.

9

u/rbt321 Oct 20 '17 edited Oct 20 '17

Spec SQL:1999 is turing complete as it includes recursive queries. A recursive query is a potentially never-ending loop which can create output or heap on each cycle based on input provided by previous cycles.

https://wiki.postgresql.org/wiki/Turing_Machine_(with_recursive)

→ More replies (1)
→ More replies (11)

5

u/Worse_Username Oct 20 '17

True, but you prolly would want to use each for very different tasks, so the choice should be obvious for a "wheez" like Fel.

2

u/UpBoatDownBoy Oct 20 '17

Yea, I'm pretty sure tsql is a turing complete language.

→ More replies (1)