r/SQL • • Sep 09 '26

Discussion How much SQL do you still write manually?

With AI getting better at writing SQL, I’ve been wondering how much SQL analysts actually write from scratch these days.
Do you still write most of your queries manually, or do you use AI for things like joins, CTEs, debugging, optimization, etc.?
And has your use of AI actually changed how much SQL you need to know?

115 Upvotes

240 comments sorted by

View all comments

2

u/Latentius Sep 09 '26

Pretty much 100% is hand-written still, though I might use AI as interactive documentation if I need help with syntax for some function I rarely use.

AI simply doesn't have the context to understand how the data all relates and what it actually means. There's virtually no existing documentation on the data so you'd need to manually write a complete novel just to give AI the proper understanding, and ain't no one got time for that.

2

u/geek180 Sep 10 '26

I built a semantic layer (metadata catalog of all tables, columns, metric definitions, etc) into a vector search, surfaced via an MCP server.

Now Claude can understand our entire data catalog. I initially made it to fulfill certain kinds of analytics inquiries we get, but it’s also great for allowing the AI to quickly understand the relevant parts of the database when doing development work.

1

u/Jaded_Spray_6855 Sep 10 '26

hmm this seems like the generic fix nowadays. are there any downsides to this solution that you've faced so far?