Dec 17, 2022 2:10 AM
JeromySpokeInClassToday
130193
1324
27
Let's hope your list has a "nice" next to your name!
awesome
funny
database
sql
deilanntau
EXPLAIN INSERT INTO contacts VALUES (1, 'christian nationalism', 2, 'intolerance', 3, 'self-victimizing') WHERE behavior = 'nice';
PathologicalLier
Im pretty sure you should join on a behavior_table on behaviorid = behaviorid and then behavior.behavior = 'nice'
Kalimitous
Wouldn’t behaviour be a Boolean field? And wouldn’t it be in a separate table accessed with a foreign key?
badmonkey0001
SELECT id, full_name, nice_score, naughty_score FROM contacts WHERE nice_score > 50 AND nice_score > (naughty_score * 1.5);
Terabit
Seems reasonable
Frothington
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.
peridotstar
I'm curious but I also don't quite understand---is 'Hello World' like a really long or difficult thing?
celestedrake
...They were just making it fit the song cadence. But that's just the first program you do in any language generally.
ChickenChickenBurningBright
little Bobby Tables is fucked
CitizenClam
I imagine an immortal being with magic powers would sanitize inputs. If nothing else, the magic should sanitize them
PugDogMan
I have this on a Christmas sweater! Just started grad school in data science.
thesnow
What about those of us with NULL behavior
IToldYouSo1
SELECT * FROM fuck_around_and_find_out WHERE behavior = 'naughty'
Vortex153
GO 2
DaUnkn0wn
I’ll just take this. Thanks.
Filanwizard
Santa Bot performs 50 megachecks per second.
nojustsayitdont
Well, with cell phone data collection and a small sub routine, 'nice' is an automatic function now.
nullbr
He's gonna use the Santa Clause
sirrahhc
WITH(NOLOCK)
Randomice
'Little Bobby Tables' xD omg
softsuit
ChorizoPig
One of my all-time favorite XKCDs.
HedonistBeard
Mine too. I sent it in when the company had some "questions" about my self-selected username.
geoffreyfourmyle
This mom features in several strips. Her hacking skills are legend.
ChloeRed
...even when wearing oven gloves *nods*
PirateRubberDuck
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.
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.
Non of the tricks I used to use work any more. I am not making things harder for then. Still frustrating though.
StillNotYouTube
I've dealt with many applications susceptible to SQL injection, but none of them used ID's that could drop or create anything.
Argondey
Deleting all the records in the table will effectively accomplish the same thing
603933
you should look up Fall Guys on the PC, they had to disable usernames for this reason
NotAHugeSpider
Rankin Bass presents "The Year Without a Santa Claus... Because of Little Bobby Tables"
Little Bobby Tables.
AShartInTheWind
Fuck SQL.
? R Studio, is that you?
kvakajek
Lol what has SQL done to you deserve this?
Be unnecessary difficult. Excel and Tableau have never done me wrong.
Bizarkly
'Sorting twice' is a non-optimal use of resources...
ShutUpImWorking
well he's not even sorting it once.. so problem solved
JudgementalMan
I don't like that I understand this.
... I know...
beerkrump
Since naughty/nice is binary, a bit field should be used. This makes the where clause "where nice =1". Better.
tryingtoignoreanythingtodowithuspolitics
Nice = true in case true = -1
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.
Besamel
TinyBadger101
Hahahahahah*sob*
Chickenbuttholeremover
Like a wizard
ycelpt
The worst thing is this is so fucking true it hurts.
zimirken
Haven't been in a factory that wasn't at least half run on excel
You'd be surprised how many large financial companies run on excel
WhatTheHellHero
In defense of excel, it is a very versatile and generally useful spreadsheet.
gahzeeruh
Best part of this is that it works better if you pronounce it ‘sequel’ instead of S.Q.L.
Zinclair
I pronounce it Scully, just to piss everyone off. Also MySQL gets called müesli.
I always say the letters and feel like I'm the only person in the world that does this.
If you’ve been in the business for any length of time then it is pronounced sequel (SQL was a standard that came later)
PhobianDarkmoon
Or if you're european it's the reason it doesn't work at all
I have always heard people say it sequel so where it resides is "Sequel Server"
on the other hand a different software package out there called SAP, the company prefers the letters for obvious reasons.
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).
ScarletEmerald
I still don't know which is the right way to say it
NotMyUsualOnlineName
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".
pleaseconsiderthatImightbejoking
Squirrel
Depends how old you are - originally it was sequel then later standardised as SQL
somnif
Doesn't matter which you go with, you'll inevitably be wrong in the eyes of who you're talking to.
cattlegrazer82
I would have gone with LIKE instead of = but whatever
Every person named Unice is "good".
Boksha
Do you want to not use indexes? Because that's how you don't use indexes.
japh
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.
druid999
Not good on DB of >7 billion records!?
And unnecessary when we know that due to Santa's ruthlessly dialectic logic there's only 'naughty' or 'nice'!
Well Santa should have used a Boolean data type really.. I guess DB architecture really isn't his strong suit (hohoho)
JonWallace1985
Came to say this. Another engineer I see.
SteamingTheCat
But then you might get 'nicely evil'. Behavior should be BehaviorID with a separate reference table listing the IDs, Behavior names and a...
TheyKeepComing
Look at this guy, thinking someone had any sort of foresight when building the table
Gartetan
LIKE 'Nice' wouldn't normally return 'nicely evil' without a wildcard? LIKE 'Nice%'
thekeyofe
But if you're not using a wildcard then you don't need to use LIKE.
Thanks for your comment.
Well, I've got to comment SOMEWHERE, 'cause I sure ain't commenting my own code.
Naughty/nice binary value. Then you can have 'where behaviormorals=1' and a left join clause joining to the RefBehavior table and that's ...
RNHurt
How many normal forms is that? :)
ReconditeEidolon
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'
Stack overflow is very useful but always take the answers with a grain of salt.
But yeah, ? I instantly thought this should be a boolean value.
... By God i need a vacay.
fatman1683
You need BCNF
thorinc
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
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.
I'm with you all the way here, I've been forced to use a nosql db :(
deilanntau
EXPLAIN INSERT INTO contacts VALUES (1, 'christian nationalism', 2, 'intolerance', 3, 'self-victimizing') WHERE behavior = 'nice';
PathologicalLier
Im pretty sure you should join on a behavior_table on behaviorid = behaviorid and then behavior.behavior = 'nice'
Kalimitous
Wouldn’t behaviour be a Boolean field? And wouldn’t it be in a separate table accessed with a foreign key?
badmonkey0001
SELECT id, full_name, nice_score, naughty_score FROM contacts WHERE nice_score > 50 AND nice_score > (naughty_score * 1.5);
Terabit
Seems reasonable
Frothington
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.
peridotstar
I'm curious but I also don't quite understand---is 'Hello World' like a really long or difficult thing?
celestedrake
...They were just making it fit the song cadence. But that's just the first program you do in any language generally.
ChickenChickenBurningBright
little Bobby Tables is fucked
CitizenClam
I imagine an immortal being with magic powers would sanitize inputs. If nothing else, the magic should sanitize them
PugDogMan
I have this on a Christmas sweater! Just started grad school in data science.
thesnow
What about those of us with NULL behavior
IToldYouSo1
SELECT * FROM fuck_around_and_find_out WHERE behavior = 'naughty'
Vortex153
GO 2
DaUnkn0wn
I’ll just take this. Thanks.
Filanwizard
Santa Bot performs 50 megachecks per second.
nojustsayitdont
Well, with cell phone data collection and a small sub routine, 'nice' is an automatic function now.
nullbr
He's gonna use the Santa Clause
sirrahhc
WITH(NOLOCK)
Randomice
peridotstar
'Little Bobby Tables' xD omg
softsuit
ChorizoPig
One of my all-time favorite XKCDs.
HedonistBeard
Mine too. I sent it in when the company had some "questions" about my self-selected username.
geoffreyfourmyle
This mom features in several strips. Her hacking skills are legend.
ChloeRed
...even when wearing oven gloves *nods*
PirateRubberDuck
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.
HedonistBeard
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.
PirateRubberDuck
Non of the tricks I used to use work any more. I am not making things harder for then. Still frustrating though.
StillNotYouTube
I've dealt with many applications susceptible to SQL injection, but none of them used ID's that could drop or create anything.
Argondey
Deleting all the records in the table will effectively accomplish the same thing
603933
you should look up Fall Guys on the PC, they had to disable usernames for this reason
NotAHugeSpider
Rankin Bass presents "The Year Without a Santa Claus... Because of Little Bobby Tables"
nojustsayitdont
Little Bobby Tables.
AShartInTheWind
Fuck SQL.
IToldYouSo1
? R Studio, is that you?
kvakajek
Lol what has SQL done to you deserve this?
AShartInTheWind
Be unnecessary difficult. Excel and Tableau have never done me wrong.
Bizarkly
'Sorting twice' is a non-optimal use of resources...
ShutUpImWorking
well he's not even sorting it once.. so problem solved
JudgementalMan
I don't like that I understand this.
IToldYouSo1
JudgementalMan
... I know...
IToldYouSo1
beerkrump
Since naughty/nice is binary, a bit field should be used. This makes the where clause "where nice =1". Better.
tryingtoignoreanythingtodowithuspolitics
Nice = true in case true = -1
beerkrump
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.
Besamel
TinyBadger101
Hahahahahah*sob*
Chickenbuttholeremover
Like a wizard
ycelpt
The worst thing is this is so fucking true it hurts.
zimirken
Haven't been in a factory that wasn't at least half run on excel
ycelpt
You'd be surprised how many large financial companies run on excel
WhatTheHellHero
In defense of excel, it is a very versatile and generally useful spreadsheet.
gahzeeruh
Best part of this is that it works better if you pronounce it ‘sequel’ instead of S.Q.L.
Zinclair
I pronounce it Scully, just to piss everyone off. Also MySQL gets called müesli.
StillNotYouTube
I always say the letters and feel like I'm the only person in the world that does this.
tryingtoignoreanythingtodowithuspolitics
If you’ve been in the business for any length of time then it is pronounced sequel (SQL was a standard that came later)
PhobianDarkmoon
Or if you're european it's the reason it doesn't work at all
Filanwizard
I have always heard people say it sequel so where it resides is "Sequel Server"
Filanwizard
on the other hand a different software package out there called SAP, the company prefers the letters for obvious reasons.
Filanwizard
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).
ScarletEmerald
I still don't know which is the right way to say it
NotMyUsualOnlineName
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".
pleaseconsiderthatImightbejoking
Squirrel
tryingtoignoreanythingtodowithuspolitics
Depends how old you are - originally it was sequel then later standardised as SQL
somnif
Doesn't matter which you go with, you'll inevitably be wrong in the eyes of who you're talking to.
cattlegrazer82
I would have gone with LIKE instead of = but whatever
badmonkey0001
Every person named Unice is "good".
Boksha
Do you want to not use indexes? Because that's how you don't use indexes.
japh
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.
druid999
Not good on DB of >7 billion records!?
druid999
And unnecessary when we know that due to Santa's ruthlessly dialectic logic there's only 'naughty' or 'nice'!
druid999
Well Santa should have used a Boolean data type really.. I guess DB architecture really isn't his strong suit (hohoho)
JonWallace1985
Came to say this. Another engineer I see.
SteamingTheCat
But then you might get 'nicely evil'. Behavior should be BehaviorID with a separate reference table listing the IDs, Behavior names and a...
TheyKeepComing
Look at this guy, thinking someone had any sort of foresight when building the table
Gartetan
LIKE 'Nice' wouldn't normally return 'nicely evil' without a wildcard? LIKE 'Nice%'
thekeyofe
But if you're not using a wildcard then you don't need to use LIKE.
Gartetan
Thanks for your comment.
thekeyofe
Well, I've got to comment SOMEWHERE, 'cause I sure ain't commenting my own code.
SteamingTheCat
Naughty/nice binary value. Then you can have 'where behaviormorals=1' and a left join clause joining to the RefBehavior table and that's ...
RNHurt
How many normal forms is that? :)
ReconditeEidolon
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'
SteamingTheCat
Stack overflow is very useful but always take the answers with a grain of salt.
ReconditeEidolon
But yeah, ? I instantly thought this should be a boolean value.
SteamingTheCat
... By God i need a vacay.
fatman1683
You need BCNF
thorinc
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
SteamingTheCat
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.
thorinc
I'm with you all the way here, I've been forced to use a nosql db :(