(转)A SQL query walks into a bar and sees two tables. He walks up to them and says 'Can I join you?'

A SQL query walks into a bar and sees two tables. He walks up to them and says 'Can I join you?' (self.programming)

submitted 2 years ago by zoomzoom83

all 203 comments

[–]bunz 142 分/分 2 years ago

he then selects one to take home and asks, may I insert into you?

[–]deus_pater 118 分/分 2 years ago

Only if you're willing to commit!

[–][deleted] 7 分/分 2 years ago

Rollback transaction

[–]indescription 38 分/分 2 years ago

purge results

[–]sans-serif 27 分/分 2 years ago

This program has performed an illegal operation.

[–]Aviator 71 分/分 2 years ago* 

Wait till he sees the last insert id.

[–]Snoron 36 分/分 2 years ago

I'd love to auto_increment that shit, if you know what I'm sayin ;)

[–]rule 20 分/分 2 years ago

But watch out for stored procedures.

[–]Daemoncoder 19 分/分 2 years ago

And remember to catch exceptions.

[–]Dr-No 7 分/分 2 years ago

and constrain yourself.

[–]c0ldfusi0n 0 分/分 2 years ago

I'm not even going to start about what could possibly go wrong with the character encoding.

[–][deleted] 54 分/分 2 years ago

I can't think of any SQL jokes like you guys, I feel so left outer

[–]sgndave 2 分/分 2 years ago

Don't worry, some day you'll get inner join!

[–]TheRobman 1 分/分 2 years ago

But that's still better than the guy who gets LEFT OUTER JOINs.

[–]deadtime 2 分/分 2 years ago

this is funny

[–]helleborus 2 分/分 2 years ago

Yes. Yes, it is.

[–]mage2k 0 分/分 2 years ago

you made me laugh...

[–]eclipse007 31 分/分 2 years ago

Hope they use protection, not all SQL queries are sanitized.

[–][deleted] 2 years ago

[deleted]

[–]Snoron 1 分/分 2 years ago

At least no one can get pregnant, he's firing NULLs.

[–]mshade 4 分/分 2 years ago* 

BEGIN TRANSACTION;

There, now just roll back.

[–]judgej2 2 分/分 2 years ago

Trust you to inject that joke.

[–][deleted] 10 分/分 2 years ago

only one? why not both! :)

[–]scook0 22 分/分 2 years ago

Turns out the other one was a relation.

[–]judgej2 7 分/分 2 years ago

That would certainly be an unholy union.

[–]Charice 36 分/分 2 years ago

he selected distinctly

[–]Rofl_Waffler 5 分/分 2 years ago

He should select the union of the two.

[–]WayOfTheIronPaw 18 分/分 2 years ago

The other one wasn't normal.

[–]waldemarsu 2 分/分 2 years ago

Before entering it takes some time to deal with the amazingly difficult primary key. But you manage to insert eventually.

However, the insert pulls a trigger on your data because the last time this happened, certain procedures were put in place to handle unwanted insertions such as yours.

[–]dwayneAnderson 5 分/分 2 years ago

all the tables were then dumped

[–]wiuara 1 分/分 2 years ago

inner join!

[–]veritaze 1 分/分 2 years ago

In her what? loins?

[–]samlee 2 分/分 2 years ago

i grant all to thee as long as you localhost.

[–]Verroq 1 分/分 2 years ago

SELECT * FROM tbl1 INNER JOIN tbl2 ON tbl1stuff.id=tbl2stuff.id; DROP TABLE tbl1;--

[–]lexchou 162 分/分 2 years ago

I have the last page code of rocket launch program in NASA written in Lisp:

)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))

[–]noamsml 54 分/分 2 years ago* 

Aaand... pickup lines! "Are you 64-bit, baby? Because you put me into long mode."

[–]bigboehmboy 59 分/分 2 years ago

My favorite joke based on a less well known language has always been:

Q: How many prolog programmers does it take to change a lightbulb?

A: Yes.

[–]lostrootpass 21 分/分 2 years ago

My personal favourite take on this is:

Q: How many programmers does it take to screw in a lightbulb?A: None, that's a hardware problem.

[–]Poltras 1 分/分 2 years ago

And my favorite reply to that one is:

Q: How many hardware engineer does it take to change in a lightbulb?

None, it's a software problem.

[–]scook0 21 分/分 2 years ago

The punchline works a little better if you use "no".

[–][deleted] 3 分/分 2 years ago

In fact, the joke only makes sense that way...

[–]bigboehmboy 1 分/分 2 years ago* 

I seem to recall encountering frustrations with just being told "yes." when I was learning Prolog. It's possible I was making newbish mistakes like using the don't-care operator instead of a variable (ie: ?- changebulb(prologprogrammer,_).)

[–][deleted] 1 分/分 2 years ago

In that case, the answer would still be no, but if it was yes, then you would get no instantiations (since there are no variables to instantiate).

[–]bigboehmboy 1 分/分 2 years ago* 

Sorry, I guess I should have been more clear. Here's an example of what I mean with "test" containing the one fact "redditUser(bigboehmboy)":

| ?- [test].

% compiling file /home/u4/mboehm2/Prolog/test

% test compiled in module user, 0.000 sec 392 bytes

yes

| ?- redditUser(X).

X = bigboehmboy ;

no

| ?- redditUser(_).

yes

using "no" instead would certainly make more sense for the joke though, I was just repeating it as I heard it.

[–][deleted] 1 分/分 2 years ago

Ah, I see that now. I understood the joke in a slightly different way, and apparently my memory of Prolog isn't as good as I thought ;-)

[–]killerstorm 4 分/分 2 years ago

and what does it mean?

[–][deleted] 46 分/分 2 years ago

Prolog is a logical programming language, which means that the result of a query (question) is always either "yes" or "no" (or equivalent).

If it answers yes, it also gives you an instantiation of variables (written in CamelCase) for which the query holds. For example

mother(alice, amy).
father(bob, amy).
parent(P, C) :- mother(P, C).
parent(P, C) :- father(P, C).

?- parent(X, amy).
yes: X = alice.
yes: X = bob.

?- parent(amy, X).
no.

The joke on Prolog form is then:

?- changebulb(prologprogrammer, X)
no.

[–]jensm -2 分/分 2 years ago

Prolog... I had happily forgotten all about it...

[–]jenkinsloveschicken 1 分/分 2 years ago

I believe the term is concluding logic.

[–]calib0rx 19 分/分 2 years ago* 

Did you see Database Movie? I hear the sequel is coming out!

(credit: dj roze)

[–]neilk 78 分/分 2 years ago

This joke is pure CRUD.

[–]ringzero 47 分/分 2 years ago

True, but it's normal form for reddit.

[–]---sniff--- -4 分/分 2 years ago

Is that first normal or second normal?

[–]pyry 4 分/分 2 years ago

I did it while on ACID.

[–]matthewt 1 分/分 2 years ago

No, this is the BREAD. The rest of reddit is the circuses ...

[–]MostUsually 0 分/分 2 years ago* 

I thought I was the only one who remembered that blog post...

[–]organic 0 分/分 2 years ago

There innoD(oubt a)B out it.

[–]Rofl_Waffler 63 分/分 2 years ago

I don't get the joke. Can someone please EXPLAIN it?

[–]FunnyMan3595 10 分/分 2 years ago

mysql> explain select * from table_1 JOIN table_2;
+----+-------------+---------+------+---------------+------+---------+------+------+-------+
| id | select_type | table   | type | possible_keys | key  | key_len | ref  | rows | Extra |
+----+-------------+---------+------+---------------+------+---------+------+------+-------+
|  1 | SIMPLE      | table_2 | ALL  | NULL          | NULL | NULL    | NULL |    5 |       | 
|  1 | SIMPLE      | table_1 | ALL  | NULL          | NULL | NULL    | NULL |    9 |       | 
+----+-------------+---------+------+---------------+------+---------+------+------+-------

[–]scook0 10 分/分 2 years ago

It's a pun, or play on words.

Normally the phrase "Can I join you?" would mean "Can I accompany you?". However, because the speaker is an SQL query and the subjects are tables, "join" can also refer to an operation that combines data from two tables in a database. This intentional ambiguity between multiple meanings can be considered humorous.

In addition, the word "table" can refer to the item of furniture (as might be found in a bar), or to a collection of data elements in a database. However, this extra pun is not essential to the core joke.

[–]killerstorm 60 分/分 2 years ago

JFYI, EXPLAIN is an SQL statement as well

[–]scook0 46 分/分 2 years ago

I realized that about halfway through writing my post, but I didn't want to let a good joke-explanation go to waste.

[–][deleted] 10 分/分 2 years ago

You should have just delegated the work to someone else.

[–]Daleo 3 分/分 2 years ago

You know your a geek when you get more joy out of explaining a joke than telling it.

[–]MihaiC 14 分/分 2 years ago

Thank you, mr. Data

[–]SgtSausage 10 分/分 2 years ago

Woooooossshshshshshss!

[–]arnar 2 分/分 2 years ago

Did you hear that whoosh sound? Thank you, you made my day.. links and all.

[–][deleted] -2 分/分 2 years ago* 

Hmmm...

[–]CadillacJoe 36 分/分 2 years ago

Get outer here.

[–]shamhow 16 分/分 2 years ago

I thought it was innertaining

[–]Porges 3 分/分 2 years ago* 

You! Right, outer here!

[–]willdabeast 3 分/分 2 years ago

I think he left a while ago

[–]akatherder 6 分/分 2 years ago

These comments are making me cross, join the rest of the punsters over there.

[–]ErroneousFrog 1 分/分 2 years ago

I don't think these replies are natural.

[–][deleted] 115 分/分 2 years ago* 

and then mysql accidentally the whole table

[–][deleted] 33 分/分 2 years ago

fuck you

[–]thatAnonymousGuy 1 分/分 2 years ago

Where's the xkcd Bobby tables reference?

[–][deleted] 14 分/分 2 years ago

It's in the comment right above this one, are you blind?

[–]munificent 3 分/分 2 years ago

You just blew my mind.

[–]solfood 1 分/分 2 years ago

Oh yes, little Bobby Tables we call him

[–]kbedell 7 分/分 2 years ago

Two queries walk into a bar. They overhear a query next to them say, 'Shut the @#!@#% up you dumb son of a #$@%&!@$)'.

The first query leans over to the second and whispers, 'hmmm... she must be using a CURSOR'...

[–]mahlzeit 2 分/分 2 years ago

'Shut the wookie up you dumb son of a banana'.

That doesn't even make sense.

[–]spacepope 3 分/分 2 years ago

This is reddit, you can say “fuck” and “bitch” here.

[–]kbedell 9 分/分 2 years ago

OK - Fuck you, bitch.

[–]spacepope 5 分/分 2 years ago

Allow me to amend my comment: ...however, insulting other redditors is strongly frowned upon.

[–]kbedell 4 分/分 2 years ago

Thanks for the clarification -- I've never been one that picked up social mores quickly.

[–]nshrestha -1 分/分 2 years ago

LOL!

[–]damagednoob 7 分/分 2 years ago

Q: Why did it take God only 7 days to create the universe?A: There wasn't any legacy code

[–]paranoidgeek 5 分/分 2 years ago* 

Database jokes seem to be my weakness... with most jokes i can keep a straight face when i hear them but database jokes always cause me to laugh out loud.

[–][deleted] 3 分/分 2 years ago

The tables have nothing in common. So the SQL query elects to just do a carestian join. As the SQL query stares at that ungodly scene, the DBA comes rushing in the door.

"What the fucking hell? Who is thrashing the instance?!?"

The DBA proceeds to kill the query. The DBA is arrested, and sentenced to life in jail.

Thus, a new DBA position is posted on Craigslist, doing a small part to help stimulate a very weak job market.

And that, kids, is why cartesian joins aren't always bad. They do have their uses.

[–]kbedell 1 分/分 2 years ago

Better a STRAIGHT join than one that swings to the LEFT.

[–]elus 1 分/分 2 years ago

FULL OUTER is just being greedy.

[–]ChrisRathman 14 分/分 2 years ago* 

Then the drunk dbdebunk guys sitting in the corner stand up and start complaining that SQL has no business walking into a bar and pretending to be a relational match maker and that there are better ways to arrange a Date.

[–]OvidPerl 0 分/分 2 years ago

Bravo! (Too bad the dbdebunk guys are such arrogant twats)

[–]yourparadigm 16 分/分 2 years ago

HEY! A SQL query is what M$ uses. Us decent folk use an SQL query.

[–]LudoA 7 分/分 2 years ago

Actually, if you look up on it, you'll see that it was originally Sequel, then due to copyrights it had to be changed to SQL.

Personally, as I'm not a fan of copyrights, and because "Sequel" is IMHO *much* more pronouncable, I say Sequel.

[–]scook0 7 分/分 2 years ago

If you look more closely you'll find that it was a trademark issue, not a copyright issue.

Changing the name for copyright reasons wouldn't make much sense.

[–]LudoA 1 分/分 2 years ago

You're right, I should look up on the differences between trademark/copyright/registered/etc.

[–]killerstorm 6 分/分 2 years ago* 

In the original SQL standard, ANSI declared that the official pronunciation for SQL is "es queue el"


is IMHO much more pronouncable, I say Sequel.

standard conformance is often sacrificed for the sake of convenience

[–]muffinman 3 分/分 2 years ago

yeah here in Germany CTRL on keyboards is translated to "STRG" ("Steuerung", meaning "Control" (duh)).

Most (computer illiterate) people say something along the lines of string, strang, strong, stategie(!!!)

[–]frankster 5 分/分 2 years ago

I've heard people refer to Ctrl as "Sitrull"

[–][deleted] 6 分/分 2 years ago

I've been known to say "kitarl" on occasion

[–]grigri 3 分/分 2 years ago

That would be cool in French as "citrouille" means pumpkin.

commits that to long-term storage

[–]LudoA 2 分/分 2 years ago

Sequal/SQL existed before ANSI, you know.

[–]killerstorm 1 分/分 2 years ago* 

standard conformance is often sacrificed for the sake of compatibility with older versions

[–]LudoA 1 分/分 2 years ago

Actually, in this case the compatibility was sacrificed by the standard for stupid reasons.

But you know that pronouncing it doesn't have much to do with writing ANSI-compliant SQL, so this discussion doesn't have much point.

I'm also not convinced it's the ANSI standard's place to dictate how its name should be pronounced.

[–]psyhofreak 1 分/分 2 years ago

I predate ANSI, so I pronounce it "squeal". As in "I'm gonna make you-a SQL database!"

[–]newredditsucks 3 分/分 2 years ago

I'm probably the only one, but I make my living from it and still call it SQuirreL. Makes just as much sense to me as SeQueL.

[–]greyfinch 1 分/分 2 years ago

Haw, another one with alternate pronunciations! I like calling it SQuiggLe, it sounds very friendly. SQuirreL is pretty friendly too.

[–]LudoA 1 分/分 2 years ago

A squiggle actually already exists. You know those red, non-straight lines which a spell-checker puts under an incorrect word? It's called a squiggle.

[–]CritterM72800 0 分/分 2 years ago

In the case of MySQL...

"The official way to pronounce “MySQL” is “My Ess Que Ell” (not “my sequel”), but we do not mind if you pronounce it as “my sequel” or in some other localized way." http://dev.mysql.com/doc/refman/5.0/en/what-is-mysql.html

I say sequel too :/.

[–]jplindstrom 5 分/分 2 years ago

Or, unofficially, "that piece of crap".

Is that not in their FAQ? Weird.

[–]gordonjay2 1 分/分 2 years ago

i say MySqull. two syllables.

[–]Tordek 2 分/分 2 years ago

You store your data in yourskull? Awesome.

[–]gordonjay2 1 分/分 2 years ago

i have a 90mb BrainDrive.

[–]thatAnonymousGuy 2 分/分 2 years ago

Came here to say the same thing. So reddit, how do YOU pronounce SQL? Es queue el, or sequel?

[–]mycatverbs 3 分/分 2 years ago

Squirrel.

[–]thatAnonymousGuy 1 分/分 2 years ago

I haven't heard that one. I like it!

[–]xoxox 4 分/分 2 years ago

My Ess Queue El. Not My-sequel!!!

[–]LeeJunFan 5 分/分 2 years ago

No habla espanol!

[–]ktvoelker 4 分/分 2 years ago

I think you meant Post Gress Queue El.

[–]jehahn 2 分/分 2 years ago

And never Post Greh See Quel.

[–]gecko 1 分/分 2 years ago

Personally, when it comes to that, my preferred pronunciation is unquestionably My Squeal.

[–]maweaver 1 分/分 2 years ago

I've heard it both ways, and I lean towards sequel, just because it's one less syllable. I'm not a "M$" developer, and didn't realize that had an impact on which was favored. What an odd thing to be snooty about.

[–]raskolnikov027 1 分/分 2 years ago

I've always said Ess Que El, and My EssQueEl. But for some reason I've always gone with MySequelServer, which isn't consistent at all.

[–]my_nth_account_name 1 分/分 2 years ago

Squeal, es queue ell, or sequel, in decreasing order of preference.

[–][deleted] 2 分/分 2 years ago* 

Round here we pronounce it 'squeal', as in 'MySqueal'.

[–]gordonjay2 1 分/分 2 years ago

that's how i usually pronounce it, but more of a 'Squhl.' laziness FTW

[–][deleted] 3 分/分 2 years ago

Its Squizzle in da hizzle!

[–]vagif 13 分/分 2 years ago

Tables show him index finger.

[–]jehahn 3 分/分 2 years ago

Just the one? Is it a UNIQUE index finger?

[–]rreader 6 分/分 2 years ago

"OK," they say.
"And how would you like that sorted" the query asks."Top to bottom," they answer."I knew you were my kind of tables," the query exclaims.

[–]eytanlevit 5 分/分 2 years ago

i heard it was the bar's name was inetpub

[–]dggoldst 7 分/分 2 years ago* 

Tables: Ick. We BOTH knew you'd SELECT us FOR one of those cheesy LINES. WHERE do you get the RIGHT TO INSERT yourself ALL IN our faces LIKE that? Just DROP it and LEAVE, OR ELSE ...

Query: Hey, let me EXPLAIN. Don't be CROSS. WHILE I may appear INSENSITIVE, BEFORE you IGNORE me, I just want TO DECLARE you're, LIKE, the FIRST NORMAL TABLES I've seen IN a LONG TIME!

Tables: RIGHT, RIGHT ...

Query: It's TRUE! You're UNIQUE, AND DISTINCT FROM the GROUP. Look, I'm NOT TRAILING you, AND I'm NOT OUT TO USE you, AND and I'm NOT OUT TO get WITH you.

Tables: Fine. IF you FETCH us EACH a drink, you can CONTINUE ....

[–]shamhow 2 分/分 2 years ago

it was going good until they saw my old honda and started cartesian

[–]tamrix 3 分/分 2 years ago* 

"You posses the primary key to my heart!" said the table. The SQL query then joined both the tables hands and the primary and secondary key combined to create a new index of love. "It just feels so right, joined." the table said as a row got added. They lived happily ever.. or until Mr Redundant came along..

"Why table, you are surposed to be joined to me, we have had an index since version 1!" dropped Mr Redundant as his pain could be heard echo'ing into to management systems room.

The table replied "I'm sorry. in our relationship you were only a temp table, besides the table I'm with now has soo many rows and such a handsome schema".

[–]kbedell 5 分/分 2 years ago

A PREPARED STATEMENT walks into a bar and sees a couple of cute STRINGS sitting at a table.

He walks up and asks for their NUMBERS and they say -- 'Just DROP it! We're the wrong data type!'

He responds, 'don't worry! I can overload my function calls!'.

[–]Howard_Beale 3 分/分 2 years ago

"only if you belong to a union!"

[–]hacksoncode 3 分/分 2 years ago

To which they respond, "No, we have no index in common."

[–]jehahn 3 分/分 2 years ago

"That's okay. We can do it real slow," the query answered.

[–]fas2 1 分/分 2 years ago

Go over the books!

[–]kbedell 1 分/分 2 years ago

When considering joins - given the choice, I'd rather be INNER.

[–]G_Morgan 1 分/分 2 years ago

This one time a SQL query was stopped in its track by a check constraint denying insertion into the rear table.

Also one query I know uses a cursor to iterate across every entry in the club.

[–]uriel 1 分/分 2 years ago

God, that joke was so bad I laughed out loud.

[–]henrygeorge 1 分/分 2 years ago

Bus error: driver executed

[–]xamox 1 分/分 2 years ago

WHERE joke="lame' OR 1=1--

[–]deleteduser 1 分/分 1 year ago

Msg 105, Level 15, State 1, Line 1Unclosed quotation mark before the character string 'lame'

[–]monkeyman114 -1 分/分 2 years ago

I'm a DBA, and that one just floored me.

[–]bprager 1 分/分 2 years ago

To be or not to be = FFHex: 2b || ^2b

[–]LOLster -2 分/分 2 years ago

"An SQL query"

With respect,Grammar Nazi

[–]piderman 14 分/分 2 years ago

Unless you pronounce it 'Sequel' as some people do.

[–]jones77 3 分/分 2 years ago

Grammar Nazis Denied!!!!

Puta. I was gonna come in here to complain too.

[–]eatadonut 1 分/分 2 years ago

I'm still not sure which is considered more "in the know". I grew up calling it S-Q-L, but then in high school my teacher called it Sequel.

[–]rabidcow 3 分/分 2 years ago

That depends on how long you've been using SQL.

[–]pyry 1 分/分 2 years ago

Or your ability to change.

[–]a1phanumeric 2 分/分 2 years ago

An Structured Query Language?

[–]pyry 2 分/分 2 years ago

An Ess-Queue-El query.

[–]mahlzeit 1 分/分 2 years ago

I heard those silly Americans pronounce it "Sequel".

[–]SubGothius 2 分/分 2 years ago

Actually, I picked up that pronunciation from an Oxford-educated VP of Dev/Ops at an ISP where I once worked.

[–]tch 0 分/分 2 years ago

/facepalm

[–][deleted] 2 years ago

[deleted]

[–]thatAnonymousGuy 2 分/分 2 years ago

Yea that was lame.

You mean that was crappy...

[–][deleted] 0 分/分 2 years ago* 

Your incredibly bad joke has shown me I'm still not over my 'poop is funny' phase. I laughed. :(

[–]kernelhappy 0 分/分 2 years ago

! I can't find it. Since we're talking geek humor....

When I was young and green (working on Tandems so you get my age) someone sent me an email (no not THAT old) made completely out of single character statements.

Anyone happen to remember/know what I'm talking about.

[–]kking254 0 分/分 2 years ago

I'm going to pretend I don't know what you're talking about so I don't feel like such a nerd.

[–]helleborus 0 分/分 2 years ago

It's LIKE 'that*', is it?

[–]arnar 5 分/分 2 years ago

Fail. It's LIKE 'that%'.

[–]helleborus 1 分/分 2 years ago

Yeah - I've been in Access all day and I get used to *.

[–]randroid 0 分/分 2 years ago

Is that some kind of a nerd joke?

[–]MikeSeth -2 分/分 2 years ago

Oh my $deity best thread ever

[–]amccloud -4 分/分 2 years ago

SQL pulled up to a house about seven or eight and he yelled to the cabby yo, home smell you later. SQL looked at his kingdom, he was finally there, to settle in his throne as the prince of bel-air.

[–]aradil 6 分/分 2 years ago

I think you need to work on your setup.


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值