this post was submitted on 16 Dec 2025
1325 points (99.3% liked)

Programmer Humor

27938 readers
779 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] NullPointerException@lemmy.ca 98 points 3 days ago (24 children)

Why would Santa need two separate tables for this?

[–] joyjoy@lemmy.zip 100 points 3 days ago* (last edited 3 days ago) (18 children)

I would make two separate views. 

CREATE VIEW NiceList AS
 SELECT * FROM Children
  WHERE behavior = 'nice' 
   AND parent.income > 40000; 
CREATE VIEW NaughtyList AS
 SELECT * FROM Children
  WHERE behavior = 'naughty'; 
[–] KairuByte@lemmy.dbzer0.com 8 points 3 days ago (6 children)

Why are we using magic strings for behavior?

[–] TheOctonaut@mander.xyz 15 points 3 days ago (1 children)

It's an ENUM and other people have to read this fucking codebase too, Brian!

[–] Olap@lemmy.world 5 points 3 days ago (1 children)

I've a DBA who would insist on this being in a dimension table and using a foreign key constraint instead of just a fucking string

[–] luciferofastora@feddit.org 5 points 3 days ago

I like your DBA!

Users probably don't.

load more comments (4 replies)
load more comments (15 replies)
load more comments (20 replies)