SQL

how do you do your select statements?

how SHOULD you do your select statements?

Attached: sqlstuff.png (234x216, 4K)

who the fuck does B you autistic retarded fuck

What kind of troglodyte would use B?

not a sql expert but A looks a lot better

Keywords in SQL must be uppercase
SELECT
UserName,
FirstName,
LastName,
eMail
FROM users

if you write the second you probably align your variable types and names, too.

Attached: file.png (713x240, 19K)

A crusty traditional database dev will do B. Because:

You can simply comment out by adding — during testing / troubleshooting.

The rest of the world does A.

have you tried asking a random SQL client about this theory of yours

They all accept uppercase. Lowercase is not standard.

from user in users
select user

SELECT * FROM users;

Discuss

what if users had 150 columns and you only needed 4

You can always put back the ones you don't need.

based

this
get better tools if yours don't have syntax highlighting

>Who cares about time complexity when computers are so powerful nowadays

All in the same line because fuck whoever gets to review my code.

Sql isn't case sensitive unless you specifically make the input case sensitive

db.users.find({}, {
"UserName": 1,
"FirstName": 1,
"LastName": 1,
"eMail": 1
});

getUsers :: SQL [User]
getUsers = do
u

This. For your run of the mill shitty SME app that needs some database behind it it won’t matter. But if you’re dealing complex sql and pl/sql Monoliths that you share with 40+ other crusty traditional databases devs, B is the way to go.

t.former_crusty_db_dev

Whats the point of the 1s?

Are you the Prius/Windows98 desktop with F-35 wallpaper guy?

The only correct answer is; consistently the same way.

SQL is not case sensitive so please leave

I do B.
easier to add more columns later if needed.

The standard specify that keyword must be uppercase.

Behold the glory of my Enterprise wizardry.
SELECT FROM

Numales are not allowed here.

Anyone who actually worked on the field.

Easier to add more columns, easier to comment.

B is the old easy-diff/merge conflict free syntax, as it generates only a change on one line when adding/removing an argument.
I sometimes see it in old code or programming languages that don't support the trailing comma on the last argument.
Everyone will use A though, regardless if its supported or not.
Lets hope the remaining languages will adopt the trailing comma.

The one which is consistent with the codebase in which you are working. If you're totally in control the codebase, whichever one you prefer.

so why don't you leave?

Makes sense

Neither, I do:
SELECT UserName, FirstName, LastName, eMail
FROM users

Should look like this:
SELECT
UserName,
FirstName,
LastName,
eMail
FROM users;

Neither of these things is true. OP is a massive fucking faggot.

These people haven't worked in "the field". From working in a data warehouse I have never seen SQL expressed like the second one. Maybe once but it's never used like that.

User::find([
‘columns’ => [
‘user_name’,
‘first_name’,
‘last_name’,
‘email’,
]
]);

You're fucking stupid. No one in their right mind puts commas first. It saves almost no time and leaves you with an abomination.

this, it's hideous but easier

>syntax that doesn't allow for trailing commas

cancer; pure cancer.

Fuck the standard

>The standard specify that keyword must be uppercase.

>programmer
>respecting standard over what JUST WERKS
>ever

Attached: gabi-horse.jpg (157x127, 10K)

>Inline comments
Get bent seriously.

sELECT
UserName,
FirstName
,LastName,eMail
froM
users

Genius.

Our company uses an inline style that looks better than either:

SELECT UserName,
FirstName,
LastName,
eMail
FROM users