Santa's Database!

Dec 17, 2022 2:10 AM

Let's hope your list has a "nice" next to your name!

awesome

funny

database

sql

EXPLAIN INSERT INTO contacts VALUES (1, 'christian nationalism', 2, 'intolerance', 3, 'self-victimizing') WHERE behavior = 'nice';

2 years ago | Likes 2 Dislikes 0

Im pretty sure you should join on a behavior_table on behaviorid = behaviorid and then behavior.behavior = 'nice'

2 years ago | Likes 2 Dislikes 0

Wouldn’t behaviour be a Boolean field? And wouldn’t it be in a separate table accessed with a foreign key?

2 years ago | Likes 1 Dislikes 0

SELECT id, full_name, nice_score, naughty_score FROM contacts WHERE nice_score > 50 AND nice_score > (naughty_score * 1.5);

2 years ago | Likes 2 Dislikes 0

Seems reasonable

2 years ago | Likes 2 Dislikes 0

He's decided to learn to code. He chose to learn PERL. after watch a tutorial he printed Hello world. Then he never learned any more agaain.

2 years ago | Likes 6 Dislikes 0

I'm curious but I also don't quite understand---is 'Hello World' like a really long or difficult thing?

2 years ago | Likes 1 Dislikes 0

...They were just making it fit the song cadence. But that's just the first program you do in any language generally.

2 years ago | Likes 3 Dislikes 0

little Bobby Tables is fucked

2 years ago | Likes 5 Dislikes 0

I imagine an immortal being with magic powers would sanitize inputs. If nothing else, the magic should sanitize them

2 years ago | Likes 3 Dislikes 0

I have this on a Christmas sweater! Just started grad school in data science.

2 years ago | Likes 1 Dislikes 0

What about those of us with NULL behavior

2 years ago | Likes 1 Dislikes 0

SELECT * FROM fuck_around_and_find_out WHERE behavior = 'naughty'

2 years ago | Likes 1 Dislikes 0

GO 2

2 years ago | Likes 1 Dislikes 0

I’ll just take this. Thanks.

2 years ago | Likes 1 Dislikes 0

Santa Bot performs 50 megachecks per second.

2 years ago | Likes 1 Dislikes 0

Well, with cell phone data collection and a small sub routine, 'nice' is an automatic function now.

2 years ago | Likes 1 Dislikes 0

He's gonna use the Santa Clause

2 years ago | Likes 1 Dislikes 0

WITH(NOLOCK)

2 years ago | Likes 2 Dislikes 0

2 years ago | Likes 378 Dislikes 2

'Little Bobby Tables' xD omg

2 years ago | Likes 32 Dislikes 0

2 years ago | Likes 9 Dislikes 0

One of my all-time favorite XKCDs.

2 years ago | Likes 85 Dislikes 0

Mine too. I sent it in when the company had some "questions" about my self-selected username.

2 years ago | Likes 5 Dislikes 0

This mom features in several strips. Her hacking skills are legend.

2 years ago | Likes 60 Dislikes 0

...even when wearing oven gloves *nods*

2 years ago | Likes 11 Dislikes 0

I want to scream at the IT team at my sons school. Instead I teach my son how I used to get past school computer security.

2 years ago | Likes 6 Dislikes 0

The "IT team" at schools are usually.... well, not exactly great, and if they do have skills they're still so blocked in they can't do much.

2 years ago | Likes 6 Dislikes 0

Non of the tricks I used to use work any more. I am not making things harder for then. Still frustrating though.

2 years ago | Likes 3 Dislikes 0

I've dealt with many applications susceptible to SQL injection, but none of them used ID's that could drop or create anything.

2 years ago | Likes 2 Dislikes 0

Deleting all the records in the table will effectively accomplish the same thing

2 years ago | Likes 2 Dislikes 0

you should look up Fall Guys on the PC, they had to disable usernames for this reason

2 years ago | Likes 4 Dislikes 0

Rankin Bass presents "The Year Without a Santa Claus... Because of Little Bobby Tables"

2 years ago | Likes 4 Dislikes 0

Little Bobby Tables.

2 years ago | Likes 1 Dislikes 0

Fuck SQL.

2 years ago | Likes 3 Dislikes 3

? R Studio, is that you?

2 years ago | Likes 2 Dislikes 0

Lol what has SQL done to you deserve this?

2 years ago | Likes 2 Dislikes 0

Be unnecessary difficult. Excel and Tableau have never done me wrong.

2 years ago | Likes 1 Dislikes 0

'Sorting twice' is a non-optimal use of resources...

2 years ago | Likes 1 Dislikes 0

well he's not even sorting it once.. so problem solved

2 years ago | Likes 1 Dislikes 0

I don't like that I understand this.

2 years ago | Likes 1 Dislikes 0

2 years ago | Likes 1 Dislikes 0

... I know...

2 years ago | Likes 2 Dislikes 0

2 years ago | Likes 1 Dislikes 0

Since naughty/nice is binary, a bit field should be used. This makes the where clause "where nice =1". Better.

2 years ago | Likes 1 Dislikes 0

Nice = true in case true = -1

2 years ago | Likes 1 Dislikes 0

In SQL, the BIT data type is an integer that accepts 0, 1, and NULL. BIT represents a boolean type with TRUE (1) and FALSE (0) values.

2 years ago | Likes 2 Dislikes 0

2 years ago | Likes 230 Dislikes 3

Hahahahahah*sob*

2 years ago | Likes 3 Dislikes 0

Like a wizard

2 years ago | Likes 5 Dislikes 0

The worst thing is this is so fucking true it hurts.

2 years ago | Likes 37 Dislikes 0

Haven't been in a factory that wasn't at least half run on excel

2 years ago | Likes 4 Dislikes 0

You'd be surprised how many large financial companies run on excel

2 years ago | Likes 5 Dislikes 0

In defense of excel, it is a very versatile and generally useful spreadsheet.

2 years ago | Likes 5 Dislikes 0

Best part of this is that it works better if you pronounce it ‘sequel’ instead of S.Q.L.

2 years ago | Likes 6 Dislikes 0

I pronounce it Scully, just to piss everyone off. Also MySQL gets called müesli.

2 years ago | Likes 2 Dislikes 1

I always say the letters and feel like I'm the only person in the world that does this.

2 years ago | Likes 1 Dislikes 0

If you’ve been in the business for any length of time then it is pronounced sequel (SQL was a standard that came later)

2 years ago | Likes 1 Dislikes 0

Or if you're european it's the reason it doesn't work at all

2 years ago | Likes 1 Dislikes 0

I have always heard people say it sequel so where it resides is "Sequel Server"

2 years ago | Likes 3 Dislikes 0

on the other hand a different software package out there called SAP, the company prefers the letters for obvious reasons.

2 years ago | Likes 1 Dislikes 0

sap when said out is not just tree juice but at least in American English its another term for sucker(ex one born every minute).

2 years ago | Likes 1 Dislikes 0

I still don't know which is the right way to say it

2 years ago | Likes 1 Dislikes 0

According to one of the co-developers of it, S.Q.L. MySQL is also usually pronounced "my S.Q.L." and not "my sequel".

2 years ago | Likes 1 Dislikes 0

Squirrel

2 years ago | Likes 3 Dislikes 0

Depends how old you are - originally it was sequel then later standardised as SQL

2 years ago | Likes 1 Dislikes 0

Doesn't matter which you go with, you'll inevitably be wrong in the eyes of who you're talking to.

2 years ago | Likes 2 Dislikes 0

I would have gone with LIKE instead of = but whatever

2 years ago | Likes 48 Dislikes 5

Every person named Unice is "good".

2 years ago | Likes 1 Dislikes 0

Do you want to not use indexes? Because that's how you don't use indexes.

2 years ago | Likes 1 Dislikes 0

No wildcard means they'll likely be executed the same way. Even with a wildcard, some DBs can use indexes. When in doubt EXPLAIN PLAN.

2 years ago | Likes 1 Dislikes 0

Not good on DB of >7 billion records!?

2 years ago | Likes 2 Dislikes 1

And unnecessary when we know that due to Santa's ruthlessly dialectic logic there's only 'naughty' or 'nice'!

2 years ago | Likes 3 Dislikes 0

Well Santa should have used a Boolean data type really.. I guess DB architecture really isn't his strong suit (hohoho)

2 years ago | Likes 4 Dislikes 0

Came to say this. Another engineer I see.

2 years ago | Likes 2 Dislikes 0

But then you might get 'nicely evil'. Behavior should be BehaviorID with a separate reference table listing the IDs, Behavior names and a...

2 years ago | Likes 35 Dislikes 2

Look at this guy, thinking someone had any sort of foresight when building the table

2 years ago | Likes 2 Dislikes 0

LIKE 'Nice' wouldn't normally return 'nicely evil' without a wildcard? LIKE 'Nice%'

2 years ago | Likes 3 Dislikes 0

But if you're not using a wildcard then you don't need to use LIKE.

2 years ago | Likes 1 Dislikes 0

Thanks for your comment.

2 years ago | Likes 1 Dislikes 0

Well, I've got to comment SOMEWHERE, 'cause I sure ain't commenting my own code.

2 years ago | Likes 2 Dislikes 0

Naughty/nice binary value. Then you can have 'where behaviormorals=1' and a left join clause joining to the RefBehavior table and that's ...

2 years ago | Likes 23 Dislikes 1

How many normal forms is that? :)

2 years ago | Likes 4 Dislikes 0

Welcome to STACKOVERFLOW where everything is made up and the points do not matter Let's get started with a game we call 'It's better my way'

2 years ago | Likes 7 Dislikes 0

Stack overflow is very useful but always take the answers with a grain of salt.

2 years ago | Likes 1 Dislikes 0

But yeah, ? I instantly thought this should be a boolean value.

2 years ago | Likes 8 Dislikes 0

... By God i need a vacay.

2 years ago | Likes 30 Dislikes 1

You need BCNF

2 years ago | Likes 6 Dislikes 0

At least he doesn't have to deal with a star schema - I dealt with Facts and Dimensions for years before having to go to nosql

2 years ago | Likes 2 Dislikes 0

Has to Google it and wow. If I had studied this back in school I'd have been a chemist instead. But yup, been there done that.

2 years ago | Likes 1 Dislikes 0

I'm with you all the way here, I've been forced to use a nosql db :(

2 years ago | Likes 6 Dislikes 1