Country
You are in the Nigeria edition. Type your country to switch.
Nigeria
Loading every country…
No country matches. Check the spelling, or choose "Any country" for the Global edition.
Your learning profile
AI for data analysis: spreadsheets and BI · Lesson 5 of 9
Natural-language questions and SQL
Many data tools now let you ask questions in plain words and turn them into SQL. This lesson shows how to describe tables precisely, read a generated query before trusting it, spot joins that double-count and check results with row counts and totals.
This lesson is complete in writing. A video for it is on its way.
What you will learn
- By the end you can explain what a natural language query and text-to-SQL are, and where each can go wrong.
- You can describe a set of tables, their keys and links precisely enough for an assistant to write a sensible query.
- You can read a generated query clause by clause before running it.
- You can spot a join that double-counts and check results with row counts and a simple total.
Key terms in this lesson
- Natural language query
- A question put to a data tool in everyday words rather than code, which the tool translates into a query and answers from the data it holds.
- SQL
- Structured Query Language: the standard language for asking a relational database to select, filter, combine and summarise rows of data.
- Text-to-SQL
- Turning a question written in plain language into a database query, often with the help of an AI assistant, so the question can be run against stored data.
- Step 1: Asking data questions in plain words, not started
- Step 2: Describe the tables before you ask, not started
- Step 3: A join that double-counts, not started
- Step 4: Read the query clause by clause, not started
- Step 5: Check the result with counts and totals, not started
About 9 min of reading
Step 1 of 5
Asking data questions in plain words
Opening this step…
Step 2 of 5
Describe the tables before you ask
This step opens when you finish the one above.
Step 3 of 5
A join that double-counts
This step opens when you finish the one above.
Step 4 of 5
Read the query clause by clause
This step opens when you finish the one above.
Step 5 of 5
Check the result with counts and totals
This step opens when you finish the one above.
Key takeaways
The key takeaways open when you finish every step.
Lesson quiz
5 questions. You need 85% to pass.
The quiz opens when you finish every step.
Read first
Stockertim Learn is education. It explains how investing works and never recommends buying or selling anything.
Popular this week: Basics: BeginnerPersonal finance: Beginner