1409: "Query"

This forum is for the individual discussion thread that goes with each new comic.

Moderators: Moderators General, Prelates, Magistrates

User avatar
Quicksilver
Posts: 437
Joined: Wed Apr 29, 2009 6:21 am UTC

1409: "Query"

Postby Quicksilver » Mon Aug 18, 2014 4:06 am UTC

Image
http://www.xkcd.com/1409/
Alt Text: "SELECT * FROM GHOSTS"

So great to see another SQL joke again, it's how I originally found XKCD. Now apply that to Harold Finch's machine!

User avatar
NeatNit
Posts: 41
Joined: Tue Apr 03, 2012 9:10 pm UTC

Re: 1409: "Query"

Postby NeatNit » Mon Aug 18, 2014 4:23 am UTC

Quicksilver wrote:So great to see another SQL joke again, it's how I originally found XKCD.

Hmm, what was the first? I don't remember a joke specifically about SQL.

User avatar
Quicksilver
Posts: 437
Joined: Wed Apr 29, 2009 6:21 am UTC

Re: 1409: "Query"

Postby Quicksilver » Mon Aug 18, 2014 4:29 am UTC

NeatNit wrote:
Quicksilver wrote:So great to see another SQL joke again, it's how I originally found XKCD.

Hmm, what was the first? I don't remember a joke specifically about SQL.
Image

User avatar
Envelope Generator
Posts: 582
Joined: Sat Mar 03, 2012 8:07 am UTC
Location: pareidolia

Re: 1409: "Query"

Postby Envelope Generator » Mon Aug 18, 2014 4:34 am UTC

I can't believe I didn't see the punchline coming.
I'm going to step off the LEM now... here we are, Pismo Beach and all the clams we can eat

eSOANEM wrote:If Fonzie's on the order of 100 zeptokelvin, I think he has bigger problems than difracting through doors.

User avatar
Hwo Thumb
Posts: 17
Joined: Wed Apr 16, 2014 3:45 am UTC

Re: 1409: "Query"

Postby Hwo Thumb » Mon Aug 18, 2014 5:13 am UTC

Come on, guys, this one's been up for 12 minutes and the Explain XKCD entry isn't even up yet?

Who else reads the explain article for each page even if they get the joke? (Just to make sure we didn't miss anything :))

There's actually one or two times when I thought I got the joke, but I actually didn't and it was something entirely different and I felt really stupid. And then I cried.

User avatar
chalkie
Posts: 44
Joined: Wed Feb 24, 2010 10:03 am UTC
Location: River Trent, UK

Re: 1409: "Query"

Postby chalkie » Mon Aug 18, 2014 7:24 am UTC

NeatNit wrote:
Quicksilver wrote:So great to see another SQL joke again, it's how I originally found XKCD.

Hmm, what was the first? I don't remember a joke specifically about SQL.


Well, off the top of my head there's the (often quoted elsewhere) bobby tables entry http://xkcd.com/327/

I have to say, this was one of the few which actually made me laugh out loud. No, I didn't see the end coming. I love the idea that the physical objects are the actual table, rather than the more common paradigm of the table recording information about the physical objects.

ps.02
Posts: 378
Joined: Fri Apr 05, 2013 8:02 pm UTC

Re: 1409: "Query"

Postby ps.02 » Mon Aug 18, 2014 7:35 am UTC

Meh. Who designed that schema? The age and hours_since_watching_porn fields, I guess, represent events in time but instead of being actual timestamps, they're intervals counting backward from NOW()? And, from context, it seems they use two different units, neither of them seconds.

So based on that, clearly it is a view, not a table. But then, when she DROPs it, it actually seems to be the canonical data source. WTF?

Amusing concept ... terrible execution. This is the script I would expect from someone who is 2 days into a "learn databases in 21 days" book. Hollywood-level understanding, if you will, of the subject of choice. Unless, I guess, the joke is in fact the idiocy of the schema? Like, J. Edgar's database on all of us was implemented by morons?

User avatar
Neil_Boekend
Posts: 3220
Joined: Fri Mar 01, 2013 6:35 am UTC
Location: Yes.

Re: 1409: "Query"

Postby Neil_Boekend » Mon Aug 18, 2014 7:40 am UTC

ps.02 wrote:Meh. Who designed that schema? The age and hours_since_watching_porn fields, I guess, represent events in time but instead of being actual timestamps, they're intervals counting backward from NOW()? And, from context, it seems they use two different units, neither of them seconds.

So based on that, clearly it is a view, not a table. But then, when she DROPs it, it actually seems to be the canonical data source. WTF?

Amusing concept ... terrible execution. This is the script I would expect from someone who is 2 days into a "learn databases in 21 days" book. Hollywood-level understanding, if you will, of the subject of choice. Unless, I guess, the joke is in fact the idiocy of the schema? Like, J. Edgar's database on all of us was implemented by morons?

Unless there is a cron job running that updates those fields.

Hmm, I don't think I have seen many worse ways of doing things on the daily WTF.
Mikeski wrote:A "What If" update is never late. Nor is it early. It is posted precisely when it should be.

patzer's signature wrote:
flicky1991 wrote:I'm being quoted too much!

he/him/his

User avatar
owneroperator
Posts: 24
Joined: Tue Jul 22, 2014 6:56 am UTC

Re: 1409: "Query"

Postby owneroperator » Mon Aug 18, 2014 7:45 am UTC

for some reason I thought of that terrible adam sandler movie

User avatar
chalkie
Posts: 44
Joined: Wed Feb 24, 2010 10:03 am UTC
Location: River Trent, UK

Re: 1409: "Query"

Postby chalkie » Mon Aug 18, 2014 8:35 am UTC

Neil_Boekend wrote:
ps.02 wrote:Meh. Who designed that schema? The age and hours_since_watching_porn fields, I guess, represent events in time but instead of being actual timestamps, they're intervals counting backward from NOW()? And, from context, it seems they use two different units, neither of them seconds.

So based on that, clearly it is a view, not a table. But then, when she DROPs it, it actually seems to be the canonical data source. WTF?

Amusing concept ... terrible execution. This is the script I would expect from someone who is 2 days into a "learn databases in 21 days" book. Hollywood-level understanding, if you will, of the subject of choice. Unless, I guess, the joke is in fact the idiocy of the schema? Like, J. Edgar's database on all of us was implemented by morons?

Unless there is a cron job running that updates those fields.

Hmm, I don't think I have seen many worse ways of doing things on the daily WTF.


That'd be a nasty cron job doing lots of unnecessary updates. Nah, its definately a view with the column as something like "sysdate-porndate"

AdrianChallinor
Posts: 9
Joined: Wed Sep 30, 2009 8:12 am UTC

Re: 1409: "Query"

Postby AdrianChallinor » Mon Aug 18, 2014 8:38 am UTC

It is not necessarily a view. Hours_Since_Watching_Porn could be a dynamically computed field.

User avatar
chalkie
Posts: 44
Joined: Wed Feb 24, 2010 10:03 am UTC
Location: River Trent, UK

Re: 1409: "Query"

Postby chalkie » Mon Aug 18, 2014 8:39 am UTC

ps.02 wrote:So based on that, clearly it is a view, not a table. But then, when she DROPs it, it actually seems to be the canonical data source. WTF?
?


Further than that even, the alt-text implies that dropping the "people" table moves the rows into the "ghosts" table.

User avatar
alvinhochun
Posts: 54
Joined: Wed Nov 14, 2012 3:07 pm UTC

Re: 1409: "Query"

Postby alvinhochun » Mon Aug 18, 2014 8:55 am UTC

Of course, it's not MySQL but People-SQL, so you cannot simply apply your knowledge of typical database systems on it.

sotanaht
Posts: 212
Joined: Sat Nov 27, 2010 2:14 am UTC

Re: 1409: "Query"

Postby sotanaht » Mon Aug 18, 2014 9:37 am UTC

How could dropping "People" remove herself if she was loaded separately from the table?

User avatar
orthogon
Posts: 2963
Joined: Thu May 17, 2012 7:52 am UTC
Location: The Airy 1830 ellipsoid

Re: 1409: "Query"

Postby orthogon » Mon Aug 18, 2014 10:16 am UTC

It's not so bad in an SQL WHERE, and I'm not sure if it can be avoided in SQL (a bit of Googling didn't really enlighten me), but does anyone else cringe when they see "if afraidOfFlying == true"? I mean, if you really feel that a boolean expressions ought to be compared to "true", then why stop there? Why not "if (((afraidOfFlying==true)==true)==true)"?
xtifr wrote:... and orthogon merely sounds undecided.

User avatar
Flumble
Yes Man
Posts: 2051
Joined: Sun Aug 05, 2012 9:35 pm UTC

Re: 1409: "Query"

Postby Flumble » Mon Aug 18, 2014 10:29 am UTC

chalkie wrote:
ps.02 wrote:So based on that, clearly it is a view, not a table. But then, when she DROPs it, it actually seems to be the canonical data source.

Further than that even, the alt-text implies that dropping the "people" table moves the rows into the "ghosts" table.

You're assuming they weren't in the ghosts table already, which is likely, considering the other design flaws.

User avatar
snowyowl
Posts: 464
Joined: Tue Jun 23, 2009 7:36 pm UTC

Re: 1409: "Query"

Postby snowyowl » Mon Aug 18, 2014 10:39 am UTC

orthogon wrote:It's not so bad in an SQL WHERE, and I'm not sure if it can be avoided in SQL (a bit of Googling didn't really enlighten me), but does anyone else cringe when they see "if afraidOfFlying == true"? I mean, if you really feel that a boolean expressions ought to be compared to "true", then why stop there? Why not "if (((afraidOfFlying==true)==true)==true)"?

Not really. I don't use that pattern myself, but I understand it.

Code: Select all

if ((annual_income > 100,000) and (name != "Steve") and (children.number == 0) and (afraidOfFlying))
looks a bit lopsided.
The preceding comment is an automated response.

taemyr
Posts: 111
Joined: Fri Jan 26, 2007 12:14 pm UTC

Re: 1409: "Query"

Postby taemyr » Mon Aug 18, 2014 10:42 am UTC

ps.02 wrote:Meh. Who designed that schema? The age and hours_since_watching_porn fields, I guess, represent events in time but instead of being actual timestamps, they're intervals counting backward from NOW()? And, from context, it seems they use two different units, neither of them seconds.


They could be custom defined functions, my command of peopleSQL is a bit rusty. Although even so it's still a bit of a WTF.

User avatar
orthogon
Posts: 2963
Joined: Thu May 17, 2012 7:52 am UTC
Location: The Airy 1830 ellipsoid

Re: 1409: "Query"

Postby orthogon » Mon Aug 18, 2014 11:03 am UTC

snowyowl wrote:
orthogon wrote:It's not so bad in an SQL WHERE, and I'm not sure if it can be avoided in SQL (a bit of Googling didn't really enlighten me), but does anyone else cringe when they see "if afraidOfFlying == true"? I mean, if you really feel that a boolean expressions ought to be compared to "true", then why stop there? Why not "if (((afraidOfFlying==true)==true)==true)"?

Not really. I don't use that pattern myself, but I understand it.

Code: Select all

if ((annual_income > 100,000) and (name != "Steve") and (children.number == 0) and (afraidOfFlying))
looks a bit lopsided.

I suppose so. As in the SQL example, even if it's syntactically correct, "SELECT * FROM people WHERE afraid_of_flying" isn't as clear. I think I took against the idiom after working with a guy who always used "if bFoo==true" when the expression was boolean, and yet was quite happy to write "if (number_of_children)" to check for a non-zero value of an integer, i.e. he got it completely backwards.

BTW, I'd love to know what would be in the {} of your example. What special treatment would your system apply to well-paid childless aviophobic nonsteves?
xtifr wrote:... and orthogon merely sounds undecided.

User avatar
cellocgw
Posts: 1933
Joined: Sat Jun 21, 2008 7:40 pm UTC

Re: 1409: "Query"

Postby cellocgw » Mon Aug 18, 2014 11:21 am UTC

I bet the query "afraid of flying" is different from the query "fear of flying" :twisted:

Anyway, I bet little Bobby dared this girl to try the DROP command.
https://app.box.com/witthoftresume
Former OTTer
Vote cellocgw for President 2020. #ScienceintheWhiteHouse http://cellocgw.wordpress.com
"The Planck length is 3.81779e-33 picas." -- keithl
" Earth weighs almost exactly π milliJupiters" -- what-if #146, note 7

User avatar
addams
Posts: 9990
Joined: Sun Sep 12, 2010 4:44 am UTC
Location: Oregon Coast: 97444

Re: 1409: "Query"

Postby addams » Mon Aug 18, 2014 12:10 pm UTC

cellocgw wrote:I bet the query "afraid of flying" is different from the query "fear of flying" :twisted:

Anyway, I bet little Bobby dared this girl to try the DROP command.

What?
Is Bobby the bastard child of Black Hat Guy?

It could be.
The characters have been around long enough for complicated lives to have developed inside the creators head.

If not in his head, then mine.
And; Now yours.
Life is, just, an exchange of electrons; It is up to us to give it meaning.

We are all in The Gutter.
Some of us see The Gutter.
Some of us see The Stars.
by mr. Oscar Wilde.

Those that want to Know; Know.
Those that do not Know; Don't tell them.
They do terrible things to people that Tell Them.

TheCycoONE
Posts: 13
Joined: Wed Nov 17, 2010 7:40 pm UTC

Re: 1409: "Query"

Postby TheCycoONE » Mon Aug 18, 2014 12:28 pm UTC

ps.02 wrote:Meh. Who designed that schema? The age and hours_since_watching_porn fields, I guess, represent events in time but instead of being actual timestamps, they're intervals counting backward from NOW()? And, from context, it seems they use two different units, neither of them seconds.

So based on that, clearly it is a view, not a table. But then, when she DROPs it, it actually seems to be the canonical data source. WTF?

Amusing concept ... terrible execution. This is the script I would expect from someone who is 2 days into a "learn databases in 21 days" book. Hollywood-level understanding, if you will, of the subject of choice. Unless, I guess, the joke is in fact the idiocy of the schema? Like, J. Edgar's database on all of us was implemented by morons?


As someone else mentioned, I expect both age and hours_since_watching_porn are computed columns on a standard table. The units are obvious for the columns, and given that they are probably computed then there are actual datestamps (created, and last_porn_watching_date) in the same table.

I can't explain how the ghost table was populated. If it was a DELETE FROM TABLE people then I would guess there was an ON DELETE trigger. As is, we don't actually know if SELECT * FROM GHOSTS returns anything, nor do we know when entries in GHOST are populated.

All in all I don't think it's nearly as WTFy as you and the other guy talking about cron jobs suggest.

Carteeg_Struve
Posts: 116
Joined: Mon Jun 08, 2009 12:56 pm UTC

Re: 1409: "Query"

Postby Carteeg_Struve » Mon Aug 18, 2014 12:38 pm UTC

And that is why you need to back up your data and restrict permissions. Caching will likely also help with performance, or at least that's what she said.

Personally, I'm just disappointed she didn't try an UPDATE command first.
Last edited by Carteeg_Struve on Mon Aug 18, 2014 12:43 pm UTC, edited 1 time in total.

User avatar
orthogon
Posts: 2963
Joined: Thu May 17, 2012 7:52 am UTC
Location: The Airy 1830 ellipsoid

Re: 1409: "Query"

Postby orthogon » Mon Aug 18, 2014 12:41 pm UTC

snowyowl wrote:

Code: Select all

if ((annual_income > 100,000) and (name != "Steve") and (children.number == 0) and (afraidOfFlying))

OK, I think I know what this does now. The high annual income coupled with lack of children suggests the person is likely to be less price-sensitive and also able to be away from home for longer periods. This, together with the fear of flying, suggests that their preferred form of transport might be a slower, surface option such as a luxury sleeper train or cruise ship; perhaps the code in the "true" body offers some special deal. However, the nonsteve condition just smacks of arbitrary prejudice. All I can think is that the programmer is a Creationist who wanted to punish Steves in general for their particularly vocal pro-evolution stance by depriving them access to the deal.
xtifr wrote:... and orthogon merely sounds undecided.

User avatar
chalkie
Posts: 44
Joined: Wed Feb 24, 2010 10:03 am UTC
Location: River Trent, UK

Re: 1409: "Query"

Postby chalkie » Mon Aug 18, 2014 12:56 pm UTC

Carteeg_Struve wrote:And that is why you need to back up your data and restrict permissions. Caching will likely also help with performance, or at least that's what she said.

Personally, I'm just disappointed she didn't try an UPDATE command first.


I still love the idea of being able to manipulate the physical world with SQL E.G. a variation for http://xkcd.com/325/ :

Code: Select all

create or replace trigger xkcd_325
   BEFORE action="unbox" on deliverable
   for each row
   begin
      if content="Office chair" then
         content:="Bobcat";
      end if;
   end;
/

Carteeg_Struve
Posts: 116
Joined: Mon Jun 08, 2009 12:56 pm UTC

Re: 1409: "Query"

Postby Carteeg_Struve » Mon Aug 18, 2014 1:02 pm UTC

snowyowl wrote:

Code: Select all

if ((annual_income > 100,000) and (name != "Steve") and (children.number == 0) and (afraidOfFlying))


I think what would bug me more about this conditional is that:
1) The annual_income and children.number thresholds are hard coded, and
2) There's a comma in 100000. You know that'll bite you later.

:wink:

chris857
Posts: 100
Joined: Thu Dec 02, 2010 5:04 pm UTC

Re: 1409: "Query"

Postby chris857 » Mon Aug 18, 2014 1:07 pm UTC

After like the first line, I was 99% sure that a drop command was going to appear.

User avatar
orthogon
Posts: 2963
Joined: Thu May 17, 2012 7:52 am UTC
Location: The Airy 1830 ellipsoid

Re: 1409: "Query"

Postby orthogon » Mon Aug 18, 2014 1:13 pm UTC

Carteeg_Struve wrote:
snowyowl wrote:

Code: Select all

if ((annual_income > 100,000) and (name != "Steve") and (children.number == 0) and (afraidOfFlying))


I think what would bug me more about this conditional is that:
1) The annual_income and children.number thresholds are hard coded, and
2) There's a comma in 100000. You know that'll bite you later.

:wink:

And yet you don't mind the nonstevenicity being hard-coded? Clearly the anti-Steve movement is even more widespread than I feared.
xtifr wrote:... and orthogon merely sounds undecided.

User avatar
chalkie
Posts: 44
Joined: Wed Feb 24, 2010 10:03 am UTC
Location: River Trent, UK

Re: 1409: "Query"

Postby chalkie » Mon Aug 18, 2014 1:28 pm UTC

orthogon wrote:And yet you don't mind the nonstevenicity being hard-coded? Clearly the anti-Steve movement is even more widespread than I feared.



Its already started elsewhere:
http://www.stevessence.com/2011/10/19/a ... -protests/

Eee gads - I just started reading that site, then I stopped pronto.

"They're all mad except thee and me, and I'm not so sure about thee"

User avatar
orthogon
Posts: 2963
Joined: Thu May 17, 2012 7:52 am UTC
Location: The Airy 1830 ellipsoid

Re: 1409: "Query"

Postby orthogon » Mon Aug 18, 2014 1:51 pm UTC

chalkie wrote:
orthogon wrote:And yet you don't mind the nonstevenicity being hard-coded? Clearly the anti-Steve movement is even more widespread than I feared.



Its already started elsewhere:
http://www.stevessence.com/2011/10/19/a ... -protests/

Eee gads - I just started reading that site, then I stopped pronto.

"They're all mad except thee and me, and I'm not so sure about thee"

The incoherent raving about the incoherent. Welcome to the Intertubes.
At least those guys are only attacking a particular Steve, not Steves in general.

You've reminded me also that Steve is the oft-cited counterfactual gay partner of the biblical Adam, so the religious right have at least three things against Steves (though wasn't able to figure out what they had against Mr Jobs).
xtifr wrote:... and orthogon merely sounds undecided.

cjm
Posts: 18
Joined: Mon Sep 07, 2009 1:17 pm UTC

Re: 1409: "Query"

Postby cjm » Mon Aug 18, 2014 1:58 pm UTC

The panel where only the cellphones drop to the ground is the clearest indication yet that everyone in XKCD is in fact naked.

User avatar
addams
Posts: 9990
Joined: Sun Sep 12, 2010 4:44 am UTC
Location: Oregon Coast: 97444

Re: 1409: "Query"

Postby addams » Mon Aug 18, 2014 2:12 pm UTC

cjm wrote:The panel where only the cellphones drop to the ground is the clearest indication yet that everyone in XKCD is in fact naked.

Everyone except me.
I know for a fact, I am not naked.

Everyone else is likely to be naked.
If the UPS man is not naked, I'll go to the door.

...What a weird community...
Where did the Stick Figures go?
Life is, just, an exchange of electrons; It is up to us to give it meaning.

We are all in The Gutter.
Some of us see The Gutter.
Some of us see The Stars.
by mr. Oscar Wilde.

Those that want to Know; Know.
Those that do not Know; Don't tell them.
They do terrible things to people that Tell Them.

airdrik
Posts: 238
Joined: Wed May 09, 2012 3:08 pm UTC

Re: 1409: "Query"

Postby airdrik » Mon Aug 18, 2014 2:19 pm UTC

cjm wrote:The panel where only the cellphones drop to the ground is the clearest indication yet that everyone in XKCD is in fact naked.

No, I'd suggest that this is more an indication of improper normalization of the schema or inconsistent management of foreign key relationships, resulting in the deletes cascading to certain relationships (e.g. objects worn) and not to others (e.g. objects held). After all, an object that is worn doesn't cease to be after it is removed and has no business being deleted just because the wearer is no more.

On the other hand, maybe there's a way we can exploit this understanding of the schema to rig the system and get infinite supplies of certain items? (anybody have a game genie or game shark that works on life?)

User avatar
FrobozzWizard
Posts: 61
Joined: Wed Feb 02, 2011 2:01 pm UTC

Re: 1409: "Query"

Postby FrobozzWizard » Mon Aug 18, 2014 2:22 pm UTC

Really, the final panel suggests the story of Bobby Tables rather morbid: One little prank, and a town's worth of teenagers is wiped out, including the son of the person who committed the prank.

Carteeg_Struve
Posts: 116
Joined: Mon Jun 08, 2009 12:56 pm UTC

Re: 1409: "Query"

Postby Carteeg_Struve » Mon Aug 18, 2014 2:32 pm UTC

orthogon wrote:
Carteeg_Struve wrote:
snowyowl wrote:

Code: Select all

if ((annual_income > 100,000) and (name != "Steve") and (children.number == 0) and (afraidOfFlying))


I think what would bug me more about this conditional is that:
1) The annual_income and children.number thresholds are hard coded, and
2) There's a comma in 100000. You know that'll bite you later.

:wink:

And yet you don't mind the nonstevenicity being hard-coded? Clearly the anti-Steve movement is even more widespread than I feared.


I though Steve was just a default value to be used in place of NULL (damn legacy schemas). Seriously, nobody in real life actually has a name like "Steve".

Mutex
Posts: 1368
Joined: Wed Jan 09, 2008 10:32 pm UTC

Re: 1409: "Query"

Postby Mutex » Mon Aug 18, 2014 2:56 pm UTC

addams wrote:
cjm wrote:The panel where only the cellphones drop to the ground is the clearest indication yet that everyone in XKCD is in fact naked.

Everyone except me.
I know for a fact, I am not naked.


Oh. That totally changes my mental image of you.

speising
Posts: 2272
Joined: Mon Sep 03, 2012 4:54 pm UTC
Location: wien

Re: 1409: "Query"

Postby speising » Mon Aug 18, 2014 2:57 pm UTC

orthogon wrote:It's not so bad in an SQL WHERE, and I'm not sure if it can be avoided in SQL (a bit of Googling didn't really enlighten me), but does anyone else cringe when they see "if afraidOfFlying == true"? I mean, if you really feel that a boolean expressions ought to be compared to "true", then why stop there? Why not "if (((afraidOfFlying==true)==true)==true)"?

if you imagine that as a parameterized query (or, heaven forbid, a concatenated query string), the value could be variable.

User avatar
chalkie
Posts: 44
Joined: Wed Feb 24, 2010 10:03 am UTC
Location: River Trent, UK

Re: 1409: "Query"

Postby chalkie » Mon Aug 18, 2014 3:15 pm UTC

FrobozzWizard wrote:Really, the final panel suggests the story of Bobby Tables rather morbid: One little prank, and a town's worth of teenagers is wiped out, including the son of the person who committed the prank.


Oh good grief! - I never saw that one coming either. Well played.

ps.02
Posts: 378
Joined: Fri Apr 05, 2013 8:02 pm UTC

Re: 1409: "Query"

Postby ps.02 » Mon Aug 18, 2014 3:52 pm UTC

Carteeg_Struve wrote:
snowyowl wrote:

Code: Select all

if ((annual_income > 100,000) and (name != "Steve") and (children.number == 0) and (afraidOfFlying))

I think what would bug me more about this conditional is that:
1) The annual_income and children.number thresholds are hard coded, and
2) There's a comma in 100000. You know that'll bite you later.

3) WTF are these == and != SQL operators? Are they anything like = and <>?
4) Redundant parentheses are redundant.
5) What is in this children table? It seems odd for a joined table with a name like that to have a number column. More usual would seem to be one row per child, and the query to use some sort of COUNT() or SUM() in it somewhere. Well, I mean, not that you couldn't get that effect with a subselect, but that feels unnecessarily obtuse.

ps.02
Posts: 378
Joined: Fri Apr 05, 2013 8:02 pm UTC

Re: 1409: "Query"

Postby ps.02 » Mon Aug 18, 2014 4:32 pm UTC

alvinhochun wrote:Of course, it's not MySQL but People-SQL, so you cannot simply apply your knowledge of typical database systems on it.

"MySQL ... typical database systems". Ha.


Return to “Individual XKCD Comic Threads”

Who is online

Users browsing this forum: No registered users and 26 guests