Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Bad schema design. Boyfriend should be a foreign key, or in a many to many table.
-
Fucking neeeeerrrrd
This is how you repel any single girls tbh.
Not to mention it's cringe as fuck to begin with -
djlazz313766y@Stuxnet unless she's into SQL, but only problem there is that the query doesn't specify that...
-
boyfriend='no' triggers the PTSD and war flashbacks outta me... oh god the paiiiin!! normalize your database schemes you fucking fuckheads!
-
C0D4681456yI 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! -
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.
-
Storing boyfriend as a string instead of a boolean (or better yet a foreign key) is exactly why you're single, man.
-
C0D4681456y@frickerg sadly I have to deal with enough of this PTSD triggering queries at work, I can't resist to fix these things.
Related Rants
how a programmer seeks for a girlfriend...
joke/meme
funny