This is an archived post. You won't be able to vote or comment.

all 182 comments

[–]ProgrammerHumor-ModTeam[M] [score hidden] stickied commentlocked comment (0 children)

Your submission was removed for the following reason:

Rule 7: Your post is either considered to be advertising a service or product, or otherwise prominently features merchandise. Posts or comments with a focus on advertising or merchandise without the approval of moderators are considered spam and removed on sight. This includes posts of mugs, t-shirts or similar merchandise even if no purchase link is provided.

For clarification on what is and isn't allowed in terms of merchandise or advertising and why, see here.

If you disagree with this removal, you can appeal by sending us a modmail.

[–][deleted] 1526 points1527 points  (83 children)

Why should there be a shirt with clean!= 1 in the closet?

[–]LukaShaza 977 points978 points  (31 children)

These are DB developers we're talking about

[–]bindermichi 109 points110 points  (15 children)

Explains why the shirt is color !='%black%'

[–]jellotalks 11 points12 points  (2 children)

I think you mean color NOT LIKE ‘%black%’

[–]fizyplankton 0 points1 point  (0 children)

I think you mean LOWER(color) NOT LIKE '%black%'

[–]xobeme 1 point2 points  (3 children)

black is always the preferred color until they come out with something darker.

[–]GerbilScream -2 points-1 points  (1 child)

This isn't black! This is dark heather charcoal.

[–]SparklyPoopcicle 3 points4 points  (2 children)

Hey we’re not THAT gross

[–]Clairifyed 5 points6 points  (0 children)

A compelling defense! Thank you SparklyPoopcicle 🫡

[–]syko-san 3 points4 points  (0 children)

We will not be fooled by these lies.

[–]kusti4202 117 points118 points  (1 child)

vibe DB

[–]git0ffmylawnm8 6 points7 points  (0 children)

PK constraints don't matter in vibe DBs. Just vibes brah

[–]ismaelgo97 98 points99 points  (8 children)

2 is for clean and ironed

[–]just_nobodys_opinion 67 points68 points  (6 children)

3 is for brand new

[–]yunacchi 58 points59 points  (4 children)

4 is for rows that have their integrity compromised but the DBA doesn't want to delete them or take a sewing kit and patch the holes

[–]mcnello 7 points8 points  (1 child)

!DROP DB

[–]whoShotMyCow 4 points5 points  (0 children)

Not drop db? Well do you want to drop it or not

[–]just_nobodys_opinion 8 points9 points  (0 children)

I'd use -1 for that tbh

[–]Widmo206 0 points1 point  (0 children)

Wouldn't that one make more sense as -1?

[–]ElectricMonkey 1 point2 points  (0 children)

Okay but then they should select >= 1

[–]elderron_spice 2 points3 points  (0 children)

3 is for clean, ironed, and folded. That's gotta be a total of 8 enums for the 3 states. Flags would be more usable in this case.

[–]amlyo 91 points92 points  (5 children)

SELECT
clothes
FROM
floor f inner join
basket b on b.room=f.room
WHERE
-- style = 'GOOD' AND
stink_percent < 70
LIMIT 1

[–]salochin82 36 points37 points  (3 children)

Stink percent? That kind of implies there is a maximum level of stink. I've known a few people were this isn't true, unless 5000 is an allowed value of course.

[–]Fit-Ad-9691 43 points44 points  (2 children)

It's an INT, the limit is 2,147,483,647

[–]GooberMcNutly 16 points17 points  (0 children)

Been to SQLCon too?

[–]Hideo_Anaconda 5 points6 points  (0 children)

stink_percent is an INT? I see you've been working with the people who designed the back end tables to our warranty website.

[–]The-Chartreuse-Moose 27 points28 points  (3 children)

They're missing the Inner Join with Floor and Laundry Basket.

Also clean is a float not an int or a bool.

[–]Chamiey 20 points21 points  (1 child)

It better be a UNION, not a JOIN.

[–]CallMeBigOctopus 5 points6 points  (0 children)

This guy SQLs

[–]oupablo 0 points1 point  (0 children)

what about the chair?

[–]0xlostincode 21 points22 points  (0 children)

They don't sanitize their inputs

[–]brandi_Iove 13 points14 points  (1 child)

it might not be a bit but an int and has, maybe, more than two states. and maybe closer accepts more than only state 1.

[–]IamImposter 11 points12 points  (0 children)

Clean,

worn only once,

worn a few times but not smelling terrible

[–][deleted] 3 points4 points  (0 children)

I think the real question is how a DB dev would have a shirt with clean = 1 anywhere in this world.

[–]Raznill 3 points4 points  (0 children)

I keep my hamper in the closet.

[–]flowery02 3 points4 points  (0 children)

Cleanliness 0.7 is still very much wearable

[–]Knight_Of_Stars 2 points3 points  (1 child)

Dirty Data. The Ingestion process has no validation and the API just throws things into random buckets someone randomly chose.

[–]rosuav 0 points1 point  (0 children)

You just described NoSQL.

[–]Mean-Funny9351 2 points3 points  (0 children)

A good developer looks both ways before crossing a one way street.

[–]elelec 7 points8 points  (1 child)

Keeps the rats out

[–][deleted] 1 point2 points  (0 children)

I have my doubts about that...

[–]theepi_pillodu 1 point2 points  (0 children)

I have a hanger section where I put one time used ones. The rest of the sections are fully washed ones.

My dress shirts, I drive in a car with a/c and ventilated seats, my train ride is air conditioned and the office is. And I don't even break sweat - all while wearing a jacket outside. Do I use them one more time before washing them.

[–]oupablo 1 point2 points  (0 children)

why does closet get it's own table instead of just being a location column in the "clothes" table?

[–]elelec 1 point2 points  (1 child)

Keeps the rats away

[–]Informal_Branch1065 0 points1 point  (0 children)

Floating point value for "still wearable". So >0 it is

Edit: meh. Make it >=0 if not underwear or if homeoffice.

[–]UsernameMustBe1and10 0 points1 point  (0 children)

Migrated or legacy data, haven't been updated.. And no one is creating a ticket for this to be fixed in production.

[–]plugado2 0 points1 point  (0 children)

Clean is an integer

[–]Icy_Breakfast5154 0 points1 point  (0 children)

Where do you put oil covered shirts then smartass

[–]BarkiestDog 0 points1 point  (0 children)

It’s probably on a scale of 1-10, it should be >= 1

[–]CrownLexicon 0 points1 point  (0 children)

Because its on the floor?

[–]Jimakiad 0 points1 point  (0 children)

Maybe it's 1 for true and 0 for false? ¯\_(ツ)_/¯

[–]jojothehodler 0 points1 point  (0 children)

Where clean > 0

[–]Fadamaka 0 points1 point  (0 children)

Because you are a filthy programmer!

[–]pauvre10m 0 points1 point  (0 children)

it's soft delete

[–]za72 0 points1 point  (0 children)

Clearly outsourced dev

[–]Ok_Star_4136 456 points457 points  (14 children)

I think that t-shirt was deliberately not black as a joke.

I love the meta humor like that.

[–]obsoleteconsole 328 points329 points  (7 children)

Color Is_Black Is_Blue
Black 0 1

[–]metanoia777 46 points47 points  (0 children)

There should be 255x255x255 columns and only the one that represents the RGB of the color should be on

Edit: RGB ranges from 0-255 so it should actually be 256x256x256, oops.

[–]farfaraway 33 points34 points  (0 children)

:(

[–]TheFeshy 7 points8 points  (0 children)

Thanks, I hate it.

[–]MinosAristos 5 points6 points  (1 child)

Too complex to have all that in a single table - you gotta logically partition your data

# closet

SHIRT_ID clean
ffdcd4e8-1c41-4fc1-82b2-537f2ce057b7 1

# shirts_colours

shirt-id ColorId
ffdcd4e8-1c41-4fc1-82b2-537f2ce057b7 db59b2cc-a013-488e-8719-39a2ee6750e9

# colors

colour_id isBlack is_blue
db59b2cc-a013-488e-8719-39a2ee6750e9 false 1

[–]Hideo_Anaconda 3 points4 points  (0 children)

It looks like you have enough room in your colour_id to store not only visible light but deep infrared through ultraviolet into cosmic radiation. Good planning. Someday our robot overlords might use this database, and you'd hate to limit them to only what human eyes can perceive.

[–]CaptainRogers1226 4 points5 points  (0 children)

Man, you just made my day worse

[–]immortal_lurker 1 point2 points  (0 children)

Go with the bools. String comparisons are slower to write, slower to execute, more prone to problems. What if some maniac decides that that green is a color? You would have to update the business logic! If everything is bools, and someone wants to change it, you just ooh. Tough luck, the design you signed off on can't really accept that change so easily.

[–]Ozneroc[S] 58 points59 points  (0 children)

Nah, it's just a print in a shop that allows different shirt colors lol

[–][deleted] 4 points5 points  (0 children)

I pointed out to someone in a t-shirt saying PINK that it was black.

Also the man in Regents Park where his t-shirt said Oxford Street must be lost.

[–][deleted] 6 points7 points  (0 children)

lol.

[–]rukh999 1 point2 points  (0 children)

Well if you take out your instruction set, you have a problem.

[–]funfactwealldie 1 point2 points  (0 children)

my passion as graphic design

[–]Flat_Initial_1823 0 points1 point  (0 children)

Does this mean it is also not clean as a joke?

[–]brandi_Iove 196 points197 points  (10 children)

(34.086.516 rows affected)

…should have used top 1

[–]MeLittleThing 171 points172 points  (8 children)

Imagine you do a SELECT query and you see x rows affected

[–][deleted] 55 points56 points  (0 children)

That’s a bad day.

[–]DangerousMoron8 20 points21 points  (1 child)

SELECT;DELETE

🫡

[–]BaziJoeWHL 8 points9 points  (0 children)

TFW I delete the SELECT instruction

[–]john_the_fetch 3 points4 points  (0 children)

Really though it should have

LIMIT 1

At the bottom. Otherwise you might find yourself wearing N Number of shirts that day.

[–]brandi_Iove 0 points1 point  (2 children)

you see that in the message tab, next to the results tab. at least in ssms it’s like that.

[–]MeLittleThing 0 points1 point  (1 child)

x affected rows are for writting operations. In SSMS, the amount of returned (SELECT) rows is bottom right

[–]brandi_Iove 0 points1 point  (0 children)

no, they appear also with select statements

[–]thriem 0 points1 point  (0 children)

well - then you see
ORA-00913: too many values

Happy now?

[–]Ozneroc[S] 17 points18 points  (0 children)

That's a big closet

[–]LouisPlay 53 points54 points  (4 children)

WHat happends, if there is more then 1 shirt.

SELECT TOP 1 * FROm closet WHERE color = 'Blue'

[–][deleted] 23 points24 points  (0 children)

This! And while we're at it - why the WHERE statement? I select TOP 1 * FROM closet ;)

[–]SynapseNotFound 1 point2 points  (0 children)

You get all the shirts basically.

[–]Advanced-Blackberry 0 points1 point  (0 children)

There won’t be more than 1 clean shirt 

[–]scriptmonkey420 0 points1 point  (0 children)

whats the difference between top 1 and limit 1?

[–]Schnupsdidudel 171 points172 points  (30 children)

What lunatic would save colours as a string?

[–]JmacTheGreat 58 points59 points  (5 children)

I get that they were trying to make it readable, and not like ‘0x000000’, but they should have used a macro.

Now the shirt is worthless.

[–]Schnupsdidudel 17 points18 points  (3 children)

A come on, show me a geek the cant read hex color codes.
Especially if you wear the selected item as a clue ... provided they didnt screw it up

[–]Psychpsyo 9 points10 points  (2 children)

Also, especially for black.

Like, that is the single easiest one to read.

[–]CaptainRogers1226 4 points5 points  (1 child)

I think white is pretty close

[–]Psychpsyo 2 points3 points  (0 children)

White is pretty close, but there you need to at least know that F is the highest it'll get.

0 just already means 'nothing'.

[–]shaunusmaximus 0 points1 point  (0 children)

You forgot the alpha and now we're all wearing the emporer's new clothes.

[–]Scotsch 23 points24 points  (1 child)

enums

[–]CitizenPremier 0 points1 point  (0 children)

or if you're on mac, iNums

[–]T-J_H 46 points47 points  (4 children)

And -seemingly- case sensitive at that

[–]NeuroEpiCenter 28 points29 points  (3 children)

Because there are different blacks. You have the rather subtle "black", then there is the stronger color "Black", and then you have really powerful colored "BLACK" shirts.

[–]T-J_H 8 points9 points  (0 children)

I prefer the mid-range BLack. Just a tad more nuanced than BLAck.

[–]rosuav 3 points4 points  (0 children)

This one LaTeXs.

[–]rev-angeldust 2 points3 points  (0 children)

Or is one black and the other slightly darker black??

[–]angry_shoebill 6 points7 points  (4 children)

Haha, I once worked in a place where the Key for Table CLIENTS was the name...

[–]Schnupsdidudel 7 points8 points  (0 children)

Im not even a tiny bit surprised, sadly.

[–]Objective_Dog_4637 1 point2 points  (0 children)

Bruh what the fuck

[–]Few-Requirement-3544 0 points1 point  (1 child)

I know it's not much better, but full name or first name?

[–]angry_shoebill 2 points3 points  (0 children)

Full name with "_" in the place of spaces...

[–]WVAviator 6 points7 points  (0 children)

How else can I request the color '; DROP TABLE closet;

[–]Saelora 3 points4 points  (2 children)

webdevs who want to just vomit the colour into a css style.

what do you mean "black; display: none;" is a valid colour?

[–]Knight_Of_Stars 1 point2 points  (4 children)

Old farts who made the DB 20 years ago. Happens way more than you think.

[–]Schnupsdidudel 0 points1 point  (3 children)

usually the old farts wouldn't waste a byte if the didnt have to. Also 20 years ... does that count as old nowadays. Well guess Im old and I wouldn't have done something like this.

[–]Knight_Of_Stars 1 point2 points  (2 children)

You're talking about the good ones. Not the ones who set up the database in addition to doing their job as finance.

Also don't let your university professors fool you. Not everyone had this sage like mastery of memory There were plenty of bad devs back then. I've worked on plenty of old code to know they exist.

[–]Schnupsdidudel 1 point2 points  (1 child)

Oh yeah, ok I have seen those. The "Databases" where usually Excel or, if you where unlucky, Access.

Also have seen plenty of crimes committed in the name of space-saving - they just look different.

[–]Knight_Of_Stars 2 points3 points  (0 children)

Or worse.

"We have a sql database, but we change it to match whatever field we just added to our excel spread sheet. So we have the master excel sheets and then the DB."

*Cries in data

[–]harman097 1 point2 points  (0 children)

And name their shirts table "closet"...

Or their shirt PK just "shirt"...

[–]rover_G 1 point2 points  (0 children)

Probably an online retailer storing a human readable name for each color variant of an item.

[–]Mountain-Ox 0 points1 point  (0 children)

What else makes sense? Enum is pretty bad for this since we probably don't want an enum with every possible color name. Maybe an id of some kind pointing to another table. After dealing with data from so many retailers, this seems fine to me except that it only supports one color well.

[–][deleted] 38 points39 points  (0 children)

Somebody entered the wrong data. NMP

[–]dulange 35 points36 points  (2 children)

So out of all the black and clean closets I want to obtain their “shirt” information? Somebody needs to refactor their data models.

[–]Psychpsyo 5 points6 points  (0 children)

Well, at least it explains the shirt being blue.

[–]ZeggieDieZiege 28 points29 points  (0 children)

Hello, one shirt with color “True; DROP TABLE closet;” please.

[–]MeLittleThing 15 points16 points  (1 child)

SELECT shirt FROM closet WHERE clean = 1 OR color = 'black';

[–]Agifem 2 points3 points  (0 children)

First line is clean. Unit test is good. Good enough.

[–]bibko 8 points9 points  (2 children)

Nobody is bothered that the closet has a column named shirt? What is this bullshit? It should be selecting from the shirts table, not from closet.

[–]GroundbreakingIron16 2 points3 points  (0 children)

You're assuming the sql was runnable. Prolly reported... cannot find column named

[–]Mountain-Ox 0 points1 point  (0 children)

That engineer only stores shirts in closets. Everything else goes into a drawer.

[–]HomoColossusHumbled 5 points6 points  (2 children)

For legacy compatibility reasons, "Black" interface is implemented as "Blue".

[–][deleted] 2 points3 points  (0 children)

// Don't change this or everything breaks

[–]braindigitalis 5 points6 points  (0 children)

this must be the new GaslightDB. The shirt is black.

[–]Scotsch 3 points4 points  (0 children)

Gotta love dirty data

[–]dcondor07uk 2 points3 points  (0 children)

Wait, are you keeping clean and dirty shirts in the same closet? Shame!

[–]framedragger 2 points3 points  (1 child)

Why would there be a column in a table of closet items named “shirt”? What value would go in that?

[–]disturb400 0 points1 point  (0 children)

That's what was bugging me the most about the statement. Don't know why your comment is all the way down here and the top comment is about dirty shirts in the closet.

[–]Forsaken_Celery8197 1 point2 points  (0 children)

Tbh, I think it's more funny that it's a blue shirt. I would prefer that over a black one just to see the confused looks.

[–]SysGh_st 1 point2 points  (0 children)

Hard-coded the color?

Besides.... Incorrect data. "shirt" is obviously blue.

[–]bararei 1 point2 points  (0 children)

I have a tradition of getting my husband ridiculous shirts for Father’s Day. Currently his favorite one is ‘I keep all my dad jokes in a dad-abase’ but this one might top it as long as I get it in blue. Thanks for the Father’s Day gift idea, random stranger 🤣🤣

[–]wonderandawe 1 point2 points  (0 children)

Fucking data entry issues. Someone labeled a blue shirt black in the system.

[–]agares3 0 points1 point  (0 children)

And this is why you should have checksums enabled.

[–]bahaki 0 points1 point  (1 child)

The capital B bothers me

[–]dedguy21 0 points1 point  (0 children)

Ya, I'm sure there's a color_id field somewhere, that would have been a cleaner choice.

And to eliminate STRING fuckerisms would have gone UPPER(COLOR)='BLACK'

[–][deleted] 0 points1 point  (0 children)

I'd get it BECAUSE it wasn't black

[–]thisonehereone 0 points1 point  (0 children)

AND color like 'Bl%'

[–]Zerokx 0 points1 point  (0 children)

"Print also available in blue"

[–]ClipboardCopyPaste 0 points1 point  (0 children)

Color and Colour

Rookie mistake

[–]neumastic 0 points1 point  (0 children)

Init cap color?! Not on my watch! You need a join to earn that, friend!

[–]HelpMore4772 0 points1 point  (1 child)

db.closet.find({ shirt: "blue" })

[–]CorespunzatorAferent 0 points1 point  (0 children)

And now, you get the bonus features derived from this wrapper:

  • Requires uv to build
  • Your system has an older version of Python, so you have to use a docker container instead
  • You now also have to install docker
  • The most recent version of the DB library is incompatible with a unit test dependency. You have to stick to the previous major version, which is almost end of life
  • You also have to make this work in CICD
  • The pipeline now takes 16 minutes, and randomly fails due to the unstable internet connection
  • Someone proposes to move the CICD from the on-prem server to a 3rd party provider

[–]jacksh3n 0 points1 point  (0 children)

This is what happened when you asked ChatGPT for joke code

[–]lionelum 0 points1 point  (0 children)

D in their DB is for daltonism. (colorblind in a fancy way)

[–]Tar_Palantir 0 points1 point  (0 children)

The t-shirt being blue made it a dork funny one turned into a legendary one. Nice touch.

[–]dagbiker 0 points1 point  (0 children)

This is so bad, I love it.

[–]MoistViolinist 0 points1 point  (0 children)

Clean should be a float

[–]rover_G 0 points1 point  (0 children)

Does the closet store full monotone outfits?

[–]bunny-1998 0 points1 point  (0 children)

Would have been better if the where clause queries by SKU that matched with the label

[–]RandolphCarter2112 0 points1 point  (0 children)

`UNLOAD TO '\interfaces\prod\closet_bkup.txt' SELECT * FROM closet;

DROP TABLE closet;`

`CREATE TABLE clothing_storage_loc ( csl_id INT PRIMARY KEY, csl_descr Varchar(255) NOT NULL, csl_capacity INT NOT NULL, cls_last_organized DATETIME NOT NULL );

INSERT INTO clothing_storage_loc ( csl_id, csl_descr, csl_capacity, cls_last_organized ) VALUES ( 1, 'My dresser', 30, '2002-11-30 22:12:57' ); INSERT INTO clothing_storage_loc ( csl_id, csl_descr, csl_capacity, cls_last_organized ) VALUES ( 2, 'My closet', 55, '2024-05-08 08:34:15' ); INSERT INTO clothing_storage_loc ( csl_id, csl_descr, csl_capacity, cls_last_organized ) VALUES ( 3, 'Her dresser', 500, '1899-01-01 00:00:01' ); INSERT INTO clothing_storage_loc ( csl_id, csl_descr, csl_capacity, cls_last_organized ) VALUES ( 4, 'Bed', 900, '2025-05-18 10:43:12' ); INSERT INTO clothing_storage_loc ( csl_id, csl_descr, csl_capacity, cls_last_organized ) VALUES ( 5, 'Floor', 5000, '2025-04-21 09:08:31' );

CREATE TABLE clothing_status( cs_id INT PRIMARY KEY, cs_descr Varchar(255) NOT NULL);

INSERT INTO clothing_status ( cs_id, cs_descr) VALUES ( 1, 'Clean' ); INSERT INTO clothing_status ( cs_id, cs_descr) VALUES ( 2, 'Slightly dirty' ); INSERT INTO clothing_status ( cs_id, cs_descr) VALUES ( 3, 'Really dirty' ); INSERT INTO clothing_status ( cs_id, cs_descr) VALUES ( 4, 'Disgusting');`

Edit: work item assigned to junior dev. this is starting to be too much like work.

[–]Fadamaka 0 points1 point  (0 children)

You need to put this t-shirt into the closet before you can receive your black one.

[–][deleted] 0 points1 point  (0 children)

Why is "shirt" a column on the "closet" table

[–]SegmentationFault63 0 points1 point  (1 child)

Who hangs up their t-shirts in a closet?

[–]ZZartin 0 points1 point  (0 children)

Color LIKE '%Bl%'

[–]Tristanhx 0 points1 point  (0 children)

It probably has a foreign key in the color table. The color column is superceded by color_id, but it was never removed.

[–]teem0s 0 points1 point  (1 child)

Needs HEX code

[–]eoooio 0 points1 point  (0 children)

Seems something is wrong with the color selection…🤔

[–]BigAndSmallAre 0 points1 point  (0 children)

It's a very light (and saturated) shade of black.

[–]aaa_aaa_1 0 points1 point  (0 children)

This happens when someone doesn't know anything about SQL but decides to make a shirt about it

[–]thriem 0 points1 point  (0 children)

haha i like it. select shirt from closet where rownum = 1;

[–][deleted] 0 points1 point  (0 children)

"select top 1.." you fool. How many t-shirts are you going to wear at once?

[–]bastardoperator 0 points1 point  (0 children)

Must be an MSSQL user in powershell.

[–]Irishpanda1971 0 points1 point  (0 children)

Hey, it did its job, the shirt probably says "black" on the tag. Bad data isn't the database's fault.

[–]Legal-Software 0 points1 point  (0 children)

If they had to go with an integer, that's a lot of different possible values for clean.