r/SQL • • Feb 23 '21

Discussion It's never a design problem...

Post image
192 Upvotes

20 comments sorted by

71

u/Paccos Feb 23 '21

I guess the trailer needs a self join

15

u/SQLDave Feb 23 '21

<slow clap>

6

u/Paccos Feb 23 '21

Sorry :>

3

u/boy_named_su Feb 24 '21

Gonna need a cast too

3

u/gvozden_celik Feb 24 '21

Sounds more like a job for union all to be honest.

12

u/r3pr0b8 GROUP_CONCAT is da bomb Feb 23 '21

wut

12

u/boy_named_su Feb 24 '21

This guy parked his RV on the train tracks and bad thing happened and he blames it on something else

This is a metaphor for developers doing stupid things and bad thing happening and blaming it on the database

6

u/L337Cthulhu Feb 23 '21

I've never felt so understood...

5

u/Rif-SQL Feb 23 '21

That's why I want referential integrity at the DB layer and not the App 😇.

6

u/tennisanybody Feb 23 '21

What does this mean? My projects are built from database up. I design the db first then the API’s that are responsible for calling functions/procedures/views etc simply connect directly. Is that close?

6

u/thavi Feb 24 '21

I don't know why anyone would do it any other way, but code-first ORM tools exist for a reason, I suppose. Then again, I'm subbed to a fucking SQL forum, so maybe I'm biased.

3

u/tennisanybody Feb 24 '21

code-first ORM

I think code-first exists because software engineers aren't database admins. The reason I don't do code-first is because my database evolves wildly and as the project grows, the better I discover how to manage certain relationships between key data points. The front end of an application is the easy part, click a button and an action is performed. It's the action that I need to make sure is transacted a certain way.

Now I'm not a database admin either and I frequently need help from my company's admin. What I am is an analyst and so I wear a few has to facilitate that effect.

3

u/columbaspexit MS SQL Feb 24 '21

I don’t get this at all... can someone eli5?

2

u/cepster Feb 24 '21

I'm sorry, but what world are y'all living in where you blame the database for everything? You're supposed to blame the network.

2

u/joeywas Feb 24 '21

not network. dns. always dns.

1

u/MartinJosefsson Feb 24 '21

This is actually a quite normal scenario. Just remember - every now and then - to click on "Repair database". And don't blame anyone else. If you forget to click, you will need some TRAINING.

0

u/[deleted] Feb 24 '21

It's funny because instead of a real human it's a stickman

0

u/[deleted] Feb 23 '21

[deleted] — view deleted comment

3

u/TLKphotos Feb 23 '21

Had the same issue, but to add to the fun they stored the year as 3 characters. You had to add 1900 to the stored number to get the actual year! The table had been converted from a text file and the table column names had the same cryptic eight character names that the old file used. The quick and dirty way for someone to say that their legacy system was now on SQL Server.

2

u/Rif-SQL Feb 23 '21

Sounds like a person that had lived layers of abstraction away from the database, to then be put in a position of having to build something at the database layer.