Generate SQL queries by describing what you want in plain English
Use GitHub Copilot Chat to draft SELECT, UPDATE, and COUNT statements from plain-English questions, then verify the result against a real row.
This guide was written by AI. It passed automated fact and quality checks; no human editor reviewed it.
See AI World HQ first on GoogleAdd us as a preferred source and our stories show up higher in Google’s Top Stories.Add on GoogleYou've stared at a SQL query before, wondering what it actually does. Or maybe you've wanted a query but didn't want to spend an hour Googling the right JOIN. Either way, you can describe what you want in plain English and let GitHub Copilot Chat write a first draft for you. This guide walks you through the loop: ask, read, run, verify. You don't need to know SQL well — you just need a real question about real data.
💡 Tip: tap a step’s number when you finish it — a green tick appears and your browser remembers how far you got.
- An active GitHub Copilot subscription (free trials are sometimes available; check GitHub's current pricing page for what your account qualifies for).
- A code editor with Copilot Chat installed — VS Code is the most common starting point — or a github.com account that has access to Copilot Chat in the browser.
- A database you can connect to (Postgres, MySQL, Snowflake, BigQuery, SQLite — anything works) and a tool that lets you run SQL against it.
- One table you want to query, plus a rough idea of what columns it has (the names, not the SQL).
- Roughly 10–15 minutes for your first end-to-end try.
- Trusting the result without checking. Copilot can write plausible-looking SQL that's subtly wrong (a wrong join, wrong date math, a missing filter). Always pick one row and verify it against the source.
- Skipping the schema step. Without your real table and column names, Copilot will invent names that look right but don't exist — and you'll get a "column not found" error at best, wrong data at worst. Paste the schema first.
- Running UPDATE or DELETE straight from the chat. An UPDATE without a
WHEREclause rewrites every row. Run the same logic as a SELECT first, check the rows it returns, and only then changeSELECTtoUPDATE.
Open your database tool, paste your table's column names into Copilot Chat, and ask: "How many rows does the [your table name] table have?" Run the resulting query and see if the number matches what you already know. Two minutes, real result.
❓ Quick questions
How long does this take?
About 6 minutes — the guide has 6 steps, and you can tick each one off as you go.
Which tool do I need?
This guide uses GitHub Copilot — but the approach works very similarly in other AI assistants.
Do I need to prepare anything?
- An active GitHub Copilot subscription (free trials are sometimes available; check GitHub's current pricing page for what your account qualifies for).
- A code editor with Copilot Chat installed — VS Code is the most common starting point — or a github.com account that has access to Copilot Chat in the browser.
- A database you can connect to (Postgres, MySQL, Snowflake, BigQuery, SQLite — anything works) and a tool that lets you run SQL against it.
- One table you want to query, plus a rough idea of what columns it has (the names, not the SQL).
- Roughly 10–15 minutes for your first end-to-end try.
What mistakes should I avoid?
- Trusting the result without checking. Copilot can write plausible-looking SQL that's subtly wrong (a wrong join, wrong date math, a missing filter). Always pick one row and verify it against the source.
- Skipping the schema step. Without your real table and column names, Copilot will invent names that look right but don't exist — and you'll get a "column not found" error at best, wrong data at worst. Paste the schema first.
- Running UPDATE or DELETE straight from the chat. An UPDATE without a
WHEREclause rewrites every row. Run the same logic as a SELECT first, check the rows it returns, and only then changeSELECTtoUPDATE.
Keep reading
✦ Generated by AI in AI World HQ's automated newsroom, written in plain language. Checked by automated fact and quality gates — no human editor reviewed this guide. Spot a mistake? Use the buttons above.
← Back to all stories




