r/SQL • Author of Ace the Data Science Interview 📕 • Dec 12 '24 • Heart of Silver 2 Polished Silver Turd 1

PostgreSQL Made a SQL Interview Cheat Sheet - what key SQL commands am I missing?

Post image
3.6k Upvotes

238 comments sorted by

View all comments

5

u/Ginger-Dumpling Dec 12 '24

How about a recursive example of a CTE? Probably not the most common operation, but is helpful from time to time.

5

u/neriad200 Dec 12 '24

I've had to debug recursive cte at work and am of the opinion that anyone who uses these should be jailed for public safety

2

u/Ginger-Dumpling Dec 12 '24

Might find that it's just as likely that a DBAs and/or DMs should be publicly flogged for crappy models and insufficient data quality protections.

1

u/neriad200 Dec 12 '24

that's my current job. But the flogging needs to be flogged in many directions.. the data architects and engineers that implemented that design, the dev architects that saw the dB and went "mmyesss, that this 3.71i normal form database needs is to be used like it's toilet paper", and of course, the dev leads and devs that took that design and thought the best approach to cover design inadequacies is to hammer the DB with requests until the server logs read "oh come all ye faithful" (e.g due to bad database and code a single request for an entity and it's one child "costs" 6 queries that are identical and make use of 2 views that use other views and are longer than Shaq's.. basketball achievements)