SQL and Chicks with Essential Dating Tricks

All of you who like databases, SQL and girls, but when you try to type SQL query you got an error, and when you try to talk to a girl you got slap in the face, read this carefully and enjoy.

If you’re tired of your buddies saying “Go home you’ve never seen a naked woman before” or “When will you lose your virginity already” this post is just right for you.

Tutorial “SQL stands 4 -> Sex Query Language” will help you to regain your confidence and SQL knowledge!

Many of you will say “Who needs girls when I have SQL” and offer strong argumentation like “Has your girl ever helped you join five tables, order them by date, and then insert into another table?” NO! But SQL did!

But then you should ask yourself “Has SQL ever made a breakfast for me and brought it to bed, or when has SQL surprised me, after a hard day, in sexy underwear?”

Don’t be modest, own  both a woman and an SQL and have best of both worlds.

My 5 favorite sexy queries:

1. Deleting Duplicate Records

You were in the club having a good time and picking up girls. By the end of the night you end up with 20 phone numbers. Unfortunately, you got wasted and you haven’t noticed that you entered the one number 5 times and now you want to get rid of those duplicates.

First query won’t work in MYSQL, because MySQL doesn’t allow referring to a table that’s targeted for update in a FROM clause, but it is fine with oracle.

WHERE id not in (SELECT id from chicks group by phone) - just group by field that has duplicated values, it this case that’s phone.

MySQL Version:

WHERE id not in ( SELECT id from ( SELECT id from chicks group by phone) as id )

2. Deleting Referential Integrity Violations

E.g. Some girls are associated with addresses that do not exist.

-id INT
-address_id INT [ foreign key ]
-hair_color VARCHAR
-breast_size SET( ‘1′, ‘2′, ‘3′ , ‘4′, ‘5′)
-ex_boys INT

-address_id INT
-address_info VARCHAR
-phone VARCHAR

DELETE from girls WHERE address_id not in (SELECT address_id from address)

3. Using Case

SELECT name,ex_boys,
case when ex_boys < 2 then ‘NUN’
when ex_boys > 10 then ‘Jenna Jameson’
else ‘OK’
end as status
from girls

4. Deleting with Nested Query

Let’s say we have two new tables, Clubs and Club_accidents. There are girls that work in clubs as waitresses, so in girls table we have new field club_id.

Table Clubs

Table Club_accidents

Now, you don’t need girls that have too much problems in their clubs, so for example you want to delete girls who have more than three accidents in three clubs.

DELETE from girls where club_id in (select club_id from club_accidents group by club_id having count(*) >= 3)

5. Creating View and Concatenating Column Values

Finally, let’s say you are making cocktail party every month, and you are the type of guy who likes blond girls and big breasts :), and you are tired of writing same query every time you want to get top 10 girls with blond hair with breast size more then three.

CREATE View best_10_blond_girls as
SELECT concat(`name`,' has breast size = ', breast _size) as girls, hotness
from girls
WHERE hair_color like blond and breast _size > 3
ORDER BY hotness desc

The best way to test if this tutorial helped you is to go to a first club, talk with the girls, and if you get number instead of slap, and if your query works, then you are the man my son.

Tags: database, programming, sql, sql query


8 Responses to “SQL and Chicks with Essential Dating Tricks”

  1. Djura Says:

    IT WORKS!!!!

  2. Rock Pirates Says:

    Gotta throw a cocktail party one of these days!

  3. Rade Joksimovic Says:

    Hahahah awesome!

  4. Jason Says:

    Hilarious post :)
    I wish all tutorials and textbooks had examples like this

  5. Nikola Mitic Says:

    Damnjan you rulez :)
    You have stumbe from me!

  6. Ica Says:

    Would like it better if you used some joins with girls table…

  7. TheDietMafiaHitman Says:

    Great post. I love this post. It has humor on it. Not just serious stuff. This post made me smile and it made my day!

    I hope more post will be produced like this

  8. christophercuizon Says:

    Wicked awesome sql ideas