33
gdb123
6y

how a programmer seeks for a girlfriend...

Comments
  • 15
    Bad schema design. Boyfriend should be a foreign key, or in a many to many table.
  • 12
    Talk about low standards.
  • 10
    Fucking neeeeerrrrd

    This is how you repel any single girls tbh.

    Not to mention it's cringe as fuck to begin with
  • 11
    And dude got no limits...
  • 4
    @Stuxnet unless she's into SQL, but only problem there is that the query doesn't specify that...
  • 3
    No row found
  • 3
    18? What you will do with a child? She needs to be 21-22 at least
  • 4
  • 6
    boyfriend='no' triggers the PTSD and war flashbacks outta me... oh god the paiiiin!! normalize your database schemes you fucking fuckheads!
  • 13
    I get this is a poor attempt at a pickup line but......... fuck it I can't help but correct this.

    1) NEVER Select *
    Your query should always provide the data it needs and nothing more, I shouldn't have to connect to the damn database and work out what I have to work with in a table. Especially if you then retrieve said data in an in-normalised manner and now I'm using magic number indexes instead of key names.

    2) What kind of dickhead stores "no" instead of setting a Boolean?
    Are my other options, "yes", "maybe", "it's complicated", "donkey kong", "no comment"

    3) Capitalise ALL your keywords. "and" gets lost when lowercase, especially when we go and add multiple clauses

    4) your where clause tells me you'll take anything at all. Add some more conditions to at least narrow the results down to someone you might actually get along with

    4.1) let's rewrite this so it makes some actual sense.

    SELECT
    g.id,
    g.name,
    g.phone,
    g.email,
    g.age,
    pt.religion,
    pt.hair_color,
    pt.fav_music,
    pt.is_programmer,
    pt.fav_prog_language,
    pt.has_boyfriend
    FROM girls g
    INNER JOIN personal_traits pt ON(pt.girl = g.id)
    WHERE g.age BETWEEN 18 AND 24
    AND pt.has_boyfriend = false
    AND pt.is_programmer = true
    AND pt.hair_color = "Red"
    AND pt.fav_prog_language = "Ruby"
    ORDER BY g.age ASC
    LIMIT 10;

    Now some of these could be shoved into other tables to make foreign keys for options but... I'm on a phone so 🤷‍♂️

    Rant rant over!
  • 5
    Why the fuck is no in quotes. Don't you know Boolean type man...
  • 2
    @gdb123... @C0D4 seems triggered. You better run...
  • 3
    I would love to use SQL in dating apps. I am using an app where you can specify preferences, like “only girls”, “no smokers” and “green eyes”. I want to specify a “NOT” preference. Because sometimes it is not set to a value at all, and therefore no included in the search.
  • 2
    Storing boyfriend as a string instead of a boolean (or better yet a foreign key) is exactly why you're single, man.
  • 3
  • 2
    @rutee07 *unleash claws* don't even approach my lap. Nor my waifu at all
  • 1
    > capitalizes every keyword except AND
    😩
  • 2
    @C0D4 I love you man
  • 2
    @frickerg sadly I have to deal with enough of this PTSD triggering queries at work, I can't resist to fix these things.
  • 0
Add Comment