AI for SQL

Discussions focus on using LLMs like ChatGPT and specialized tools to generate, explain, optimize, and learn SQL queries, including debates on whether deep SQL knowledge is still necessary.

➡️ Stable 0.5x AI & Machine Learning
3,750
Comments
20
Years Active
5
Top Authors
#2415
Topic ID

Activity Over Time

2007
4
2008
9
2009
25
2010
20
2011
33
2012
42
2013
62
2014
74
2015
133
2016
97
2017
126
2018
166
2019
175
2020
254
2021
319
2022
376
2023
637
2024
648
2025
515
2026
35

Keywords

e.g arctype.com LLM MPT godoc.org FixIt SSMS modeanalytics.com openai.com sq.io sql sql queries queries query duckdb ai generate text gpt language

Sample Comments

cpursley • Jan 14, 2025 • View on HN

You're getting downvoted by gatekeepers but LLMs are amazing with SQL and this is a great use-case.

mariopt • Feb 13, 2025 • View on HN

I have been using Phind for building SQL queries and it's actually great to learn more about SQL, and the results are mostly correct. Just try to ask it to build some advanced query then you discover you don't truly know SQL.

JodieBenitez • May 17, 2025 • View on HN

Wait... people need AI to write SQL ?

efitz • Jan 12, 2026 • View on HN

In my experience LLMs excel at SQL.

wakana • Jun 20, 2023 • View on HN

How does your tool differ from, say, when I paste an SQL query into ChatGPT and prompt it with "Explain this SQL query for me, please"

bbakerma • Mar 4, 2024 • View on HN

Hi HN!I built out a few helpful SQL tools (some AI, some not) that I wanted to share with the community. The goal is for these tools to help in the process of learning SQL, organizing SQL, optimizing SQL, and picking up an existing SQL project.SQL Tutorial – a fun, interactive tutorial for 30+ SQL statements[0]SQL AI Optimizer – optimize your SQL statement[1]SQL AI Explainer – explain your complex SQL in plain language[2]SQL Formatter – format your SQL nicely[3]Let me know what

thomasqm • May 5, 2020 • View on HN

why not just use nlp to generate sql from the query /s

vasco • May 4, 2025 • View on HN

There's no point in learning any much deeper SQL anymore, AI assistants have largely solved SQL querying. Just ask for what you want with natural language.

samstave • Feb 5, 2024 • View on HN

If anyone is interested, I had gpt explain this SQL to me - and it was really helpful, as I couldnt parse that with my level of SQL...https://chat.openai.com/share/931b1778-6393-4e86-94b4-b3b5a5...

halayli • Feb 19, 2024 • View on HN

They can ask chatgpt to generate the SQL query and use the SQL output that everyone is familiar with rather than use an abstraction that is prone to versioning and behavioral changes and will consume everyone else's time to go learn a new language and become profficient in it.