I love it when I have to scream at a computer
I love it when I have to scream at a computer
I love it when I have to scream at a computer
Speaking as a Senior Dev specialized in database access and design... you don't have to use all caps - SQL is actually case agnostic.
But... but my fucking eyes man. I'm old, if your branch doesn't have control keywords in all caps I'm going to take it out back and ol' yeller it.
There are few hills I'll die on but all caps SQL and singular table names are two of them.
I'm a sql developer, and I am completely the opposite to you. I will find it incredibly difficult to read when everything is in caps
Sorry, to clarify, not everything is in all caps. I'll append my prefered syntax below
WITH foo AS ( SELECT id, baz.binid FROM bar JOIN baz ON bar.id = baz.barid ) SELECT bin.name, bin.id AS binid FROM foo JOIN bin foo.binid = bin.id
The above is some dirt simple SQL, when you get into report construction things get very complicated and it pays off to make sure the simple stuff is expressive.
I'm at a Data Engineer and I alternative caps lock and non caps lock at random
I believe this has been proven. It's because capital letters all have the same shape whereas lower case letters do not. So your brain can take shortcuts to reading lower case but cannot with upper case.
Also most if not all editors will highlight SQL keywords so it's probably not too hard to discern SQL commands and everything else in modern day.
Singular table names? You savage…
It's an English literacy thing - we have several non-native English speakers and using only singular avoids making those folks' lives harder. Besides it's really nice to autopilot that categoryid
is a foreign key to the category
table. It also simplifies always plural words... I haven't yet written CREATE TABLE pants
but if I ever do there's zero chance of me creating a pantid
.
is syntax highlighting not sufficient to recognize the keywords?
Look at you with your color vision being all elitist. Some of us old bastards don't see them pretty rainbows so much any more.
Ditto.
My work standards are table name all caps keywords all lower case
Technically, SQL is case-insensitive.
Practically, you want to capitalise the commands anyway.
It gives your code some gravitas. Always remember that when you're writing SQL statements you're speaking Ancient Words of Power.
Does that JavaScript framework that got invented 2 weeks ago by some snot-nosed kid need Words of Power? No. Does the database that has been chugging on for decades upon decades need Words of Power? Yes. Words of Power and all the due respect.
Reminds me a bit of Skyrim. You are... the query-born.
I'm going to print this out and frame it on the wall of my office.
SeLEct uSERnaMe frOm usERs WhErE fiRStnAmE = 'John';
This sounds like something James Mickens would write.
My favourite by him: The Night Watch (PDF)
The phrase "SQL programmers" is so fucking weird. SQL isn't a programming language. It's a query language. You don't "program" things with SQL. You utilize SQL as a component of programs for data insertion and lookup, but the actual logic of execution is done in a programming language. Unless you're doing Oracle PL/SQL, in which case why are you giving money to Oracle?
Edit: Damn, this comment made people mad.
Your knowledge of data engineering may be limited. SQL is predominant in data processing nowadays. FOSS tools such as DBT allows to write efficient data processing pipelines with SQL and some YAML config without the need for a general purpose coding language.
Why would anyone want that? Because SQL has the interesting property of describing the result you want rather than describing how to compute it. So you can put inside the database, a query engine with decades of optimizations, that will make a much better job at finding the best execution plan than the average developer.
It also means it's easier to train people for data processing nowadays.
Learning DBT was pretty easy for me as a data analyst. Now I’m contributing to my company’s data warehouse instead of just pulling existing data.
T-SQL is turing complete. While the MS SQL server has limitations on OS level operations, if you allow yourself some leeway with CLR wrappers for the win32 API, there's no reason I can think of you wouldn't be able to get the database engine to be a webserver reacting to incoming requests on port 80, or drawing GUIs based off of table state.
It's be slow and terrible, but doable.
It's doable. Personal experience
This doesn't make sense to me. SPs and functions are in every major database. If I wrote a bash script that runs like a program, and sounds like a program, did I program it? Script it?
And lots of systems have nested logic in the DB, optimization often leads to that to reduce overhead. Unless you're being lazy with an ORM like prisma that can't even join properly.
Getting high performing queries is just as difficult as any other programming language, and should be treated as such. Even Lemmy's huge performance increases to .18ish came from big PG optimizations.
It seems to be about yelling at others that "you're not a real programmer!!!" mixed with being so "technically correct" my eyes can no longer roll the same way they used to.
It's mostly ignorance. People tend to underestimate or dismiss things they don't completely understand.
Admittedly, this discussion is more one of semantics than anything. It's pretty clear I'm arguing that SQL is not a "General Purpose Language," and that proficiency in that domain is what constitutes programming. Which, yeah, is arguably somewhat arbitrary. But my point is that, colloquially, someone who only works with SQL isn't a programmer. Data Engineer, sure. DBA. Also, sure. Depends on what you do. Programmer? Not really. Not unless you (as in the person, not "it's theoretically possible") can use raw SQL to read in video data from a linux system device file and then encode it to mp4 and just nobody's told me.
I'm a markdown programmer and i disagree with this statement
LaTeX being called "programming" I can see, but I've never heard someone try to justify Markdown as programming. It's just formalizing things people were already doing to format text in plain text files into approximately half of a standard.
You don't "program" things with SQL
Why not? It sounds like you haven't written any OLAP queries :)
I've written ETL data pipelines using a system similar to Apache Airflow, where most of the logic is in SQL (either Presto or Apache Spark) with small pieces of Python to glue things together. Queries that are thousands of lines long that take ~30 minutes to run and do all sorts of transformations to the data. They run once per day, overnight. I'd definitely call that programming.
Most database systems support stored procedures, which are just like functions - you give them some input and they give you some output and/or perform some side effects.
SQL is turing complete
I'm a magic the gathering programmer
So is Tex. And, yet, I still don't put it under the "programming languages I know" section on my resume. Probably because it's not a programming language.
stored procedures
MS SQL Server has this thing called Replication. It's a feature to keep tables in sync between databases, and even database servers. There's merge replication (two way), snapshot replication (one way scheduled publishing), and transaction replication (one way live-ish publishing).
And the logic is all implemented in T-SQL stored procedures.
I fucking hate it.
Me losing my mind in 3000 lines of Oracle PL/SQL processing scripts in a Bank some time ago agrees with your last statement.
This comment has a concerning amount of replies. Its just semantic BS.
Bahahahhahahahhahahahhahahaa. No.
As a senior query writer, I use caps for begin and end and some other commands, but all caps makes my head hurt. It's like the sql is screaming at me. I think it's more important to have good looking queries with proper indentation.
This.
Highlight important aspects of the worry with caps
So much this. Caps for all the things? Hell no! Been a query guy for 19 years now.
I don't even use it for Begin and End. and only shift for camelCase names.
MySQL gives you a half-hearted "Bye" when you exit the console.
My favourite MySQL error is "MySQL server has gone away", like MySQL decides "nah I don't want to run this" and runs off.
(it happens when no data is sent over the connection for a while, like if the query is taking too long to run and times out)
MongoDB does it, too. So it's not exclusively a SQL thing.
I know a Perl programmer who exclusively writes all SQL in pure lowercase with atypical indentation.
He's also a die-hard InfoWars follower, apparently his go to source, so... maybe there is a connection there.
Unlawful chaotic evil
Wait, you guys aren't just writing code and then hitting the FORMAT button?
this is the only right way
THANKS, NOW I DON'T HAVE TO HOLD DOWN THE SHIFT KEY WHEN I TYPE ANYMORE!
I love this
I never use all caps when I write SQL, not sure why people insist on it so much
I write it in lowercase but then the auto-formatter we use at work converts it to uppercase when I save the file.
I love auto formatters. Prettier (the initial version for JS) really popularized the concept. If the coding style is automated where possible (things like tabs vs spaces, tab width, line wrap at 80/100/120 characters, where to put line breaks in long statements, etc), it ensures the entire codebase is consistent, and I can jump between different code bases with different coding styles without having to think too much about it.
Was an Oracle thing. Postgresql is rather on the lowercase side of things...
I was taught it when working with Oracle SQL (their certification was not cheap and the exam also not easy)
Personally do what's easiest if it's your own database
Nobody knows (/s) but you don't have to write keywords in upper case (for most DB's default settings anyway).
You can even write them sarcastically like this:
sElEcT * fRoM dUaL
You have ruined my assumptions of SQL coders. How dare you! /s /dramatic
Yeah... But caps lock is the cruise control for cool. How else am I going to switch between Slack and my editor easily?
MAKING SQL QUERIES IN CAPITAL LETTERS MAKES DATABASE TO SENSE URGENCY AND RUN FASTER.
It's tabs vs spaces for SQL. Notice how I capped.
Yea, but did you pronounce that Essquel or Sequel?
"Squirrel"
"Squill"
Squeal
Squirtle
Honestly, when I read your comment, my internal monolog said "Huh, Esckwell? Ohhhhhh"
I always remap my tab key to ctrl. Where is your god now…
Remapping caps lock to Ctrl I can see (and have done), but Tab...? Do you just indent with the space bar
The mental gymnastics needed to understand joins 😂
It's basically just a VLOOKUP is how I explain it to my friends who might be familiar with excel but not a real database.
If you know vlookup, you should checkout xlookup. Even more similar, relatively speaking of course. No longer do I have to count my columns
I stopped doing SQL (the language/syntax) because I use ORMs now. They make the job a bit easier, especially when doing table relations.
COBOL too lol
Theres a dozen of you keeping banking around the world from falling apart lol
Yes, WHY do I write all my SQL statements In all CAPS and why isn't there a better SQL editor, and why hasn't SQL evolved more than it has?
abolish capital letters 2k24