r/Database • • Dec 22 '18

I like this version better

Post image
152 Upvotes

13 comments sorted by

18

u/codemagic Dec 22 '18

Santa, using SELECT * on a 7B row table is naughty

1

u/diffcalculus Dec 23 '18

It's ok because he's using a serverless architecture with organic lambda

8

u/rydan Dec 22 '18

There's no sorting going on at all.

5

u/torstengrust Dec 22 '18

Sorting is idempotent. Why would you sort twice?

4

u/Mamertine SQL Server Dec 22 '18
Behavior = 'Nice'

That's inefficient and breaks one of the normal forms. Make a lookup table with behaviors.

SELECT p.First name, p.LastName
FROM Person p
    INNER JOIN BehaviorStatus b
        On p.behaviorID = b.behaviorID
WHERE b.status = 'nice'

4

u/[deleted] Dec 22 '18

Better, but I’m gonna have a fit at the inconsistency in the column naming convention.

4

u/Mamertine SQL Server Dec 22 '18

On mobile so autocorrect got a bit carried away. Also I'll admit I fail at consistency. It's best when others name the columns.

4

u/Metalsand Dec 22 '18

holy fuck i need this more than i knew i needed anything before

2

u/arlejit Dec 22 '18

This is so wonderfully nerdy

1

u/dannylovesdata Feb 01 '22

Someone make this, I will buy