Purpose and vocabulary · Explore invoices
Beginner5 min read · 5 practice questions
START WITH THE IDEA
Run real SQLite queries, CTEs, subqueries and window functions over fictional financial tables. Row grain: what one database record represents. Join key: field relating records across tables. CTE: named intermediate query introduced with WITH. Result row 1: {"invoices.id":101,"invoices.customer_id":1,"invoices.month":"2026-01","invoices.amount":1200,"invoices.status":"paid"} Result row 2: {"invoices.id":102,"invoices.customer_id":2,"invoices.month":"2026-01","invoices.amount":800,"invoices.status":"unpaid"} Result row 3: {"invoices.id":103,"invoices.customer_id":3,"invoices.month":"2026-01","invoices.amount":1500,"invoices.status":"paid"} Result row 4: {"invoices.id":104,"invoices.customer_id":1,"invoices.month":"2026-02","invoices.amount":1800,"invoices.status":"paid"} Result row 5: {"invoices.id":105,"invoices.customer_id":2,"invoices.month":"2026-02","invoices.amount":950,"invoices.status":"unpaid"} Result row 6: {"invoices.id":106,"invoices.customer_id":3,"invoices.month":"2026-02","invoices.amount":2100,"invoices.status":"unpaid"} Result row 7: {"invoices.id":107,"invoices.customer_id":1,"invoices.month":"2026-03","invoices.amount":1600,"invoices.status":"unpaid"} Result row 8: {"invoices.id":108,"invoices.customer_id":2,"invoices.month":"2026-03","invoices.amount":1100,"invoices.status":"paid"} Result row 9: {"invoices.id":109,"invoices.customer_id":3,"invoices.month":"2026-03","invoices.amount":1700,"invoices.status":"paid"} Multiplying records through a nonunique join.
Your focus: Run real SQLite queries, CTEs, subqueries and window functions over fictional financial tables.
Learning goals & prerequisites
Learning objectives
- Run real SQLite queries, CTEs, subqueries and window functions over fictional financial tables.
- Apply purpose and vocabulary to SQL focus: Explore invoices
- Explain the mechanism, perform a check and state a limitation.
Before you begin
- Read the tool labels; basic arithmetic where a calculation is required.
VOCABULARY
Key definitions
- Row grain
- what one database record represents.
- Join key
- field relating records across tables.
- CTE
- named intermediate query introduced with WITH.
METHOD & REASONING
Why this tool and lesson matter
Run real SQLite queries, CTEs, subqueries and window functions over fictional financial tables. Start by identifying the business question this tool answers. A label is useful only when you can explain its meaning and distinguish it from a related concept. Read the worked case without changing its inputs. Identify the resource, obligation, outcome or evidence being measured and the period to which it applies. Explain one definition in your own words, then test that explanation against the supplied example.
A tool can accelerate a method; it cannot choose the business meaning of a field for you.
Vocabulary and field meaning
Row grain: what one database record represents. Join key: field relating records across tables. CTE: named intermediate query introduced with WITH.
The how: an explicit workflow
Inspect the source tables and understand one row before selecting columns. Use the supported SELECT, filtering, grouping and joins shown in the original exercises. Reconcile aggregate results to the fictional source data; inspect key uniqueness before joins. Move to Advanced SQL Lab for full SQLite workflows beyond the original teaching subset.
Supplied business case
customers — one row per customer Row 1: {"id":1,"name":"Harbor Books","region":"East"} Row 2: {"id":2,"name":"Cedar Coffee","region":"West"} Row 3: {"id":3,"name":"North Studio","region":"East"} invoices — one row per invoice Row 1: {"id":101,"customer_id":1,"month":"2026-01","amount":1200,"status":"paid"} Row 2: {"id":102,"customer_id":2,"month":"2026-01","amount":800,"status":"unpaid"} Row 3: {"id":103,"customer_id":3,"month":"2026-01","amount":1500,"status":"paid"} Row 4: {"id":104,"customer_id":1,"month":"2026-02","amount":1800,"status":"paid"} Row 5: {"id":105,"customer_id":2,"month":"2026-02","amount":950,"status":"unpaid"} Row 6: {"id":106,"customer_id":3,"month":"2026-02","amount":2100,"status":"unpaid"} Row 7: {"id":107,"customer_id":1,"month":"2026-03","amount":1600,"status":"unpaid"} Row 8: {"id":108,"customer_id":2,"month":"2026-03","amount":1100,"status":"paid"} Row 9: {"id":109,"customer_id":3,"month":"2026-03","amount":1700,"status":"paid"} expenses — one row per listed expense Row 1: {"id":1,"month":"2026-01","category":"Payroll","amount":1600} Row 2: {"id":2,"month":"2026-01","category":"Rent","amount":500} Row 3: {"id":3,"month":"2026-02","category":"Payroll","amount":1800} Row 4: {"id":4,"month":"2026-02","category":"Rent","amount":500} Row 5: {"id":5,"month":"2026-03","category":"Payroll","amount":1900} Row 6: {"id":6,"month":"2026-03","category":"Rent","amount":500} Query: SELECT * FROM invoices; SQL focus: Explore invoices
Worked query
SELECT * FROM invoices;Worked method and answer
Inspect the row grain before aggregating: one row represents one invoice. Inspect SELECT columns, FROM sources, filtering, grouping and ordering separately. Reconcile the result with the stated source rows. Result row 1: {"invoices.id":101,"invoices.customer_id":1,"invoices.month":"2026-01","invoices.amount":1200,"invoices.status":"paid"} Result row 2: {"invoices.id":102,"invoices.customer_id":2,"invoices.month":"2026-01","invoices.amount":800,"invoices.status":"unpaid"} Result row 3: {"invoices.id":103,"invoices.customer_id":3,"invoices.month":"2026-01","invoices.amount":1500,"invoices.status":"paid"} Result row 4: {"invoices.id":104,"invoices.customer_id":1,"invoices.month":"2026-02","invoices.amount":1800,"invoices.status":"paid"} Result row 5: {"invoices.id":105,"invoices.customer_id":2,"invoices.month":"2026-02","invoices.amount":950,"invoices.status":"unpaid"} Result row 6: {"invoices.id":106,"invoices.customer_id":3,"invoices.month":"2026-02","invoices.amount":2100,"invoices.status":"unpaid"} Result row 7: {"invoices.id":107,"invoices.customer_id":1,"invoices.month":"2026-03","invoices.amount":1600,"invoices.status":"unpaid"} Result row 8: {"invoices.id":108,"invoices.customer_id":2,"invoices.month":"2026-03","invoices.amount":1100,"invoices.status":"paid"} Result row 9: {"invoices.id":109,"invoices.customer_id":3,"invoices.month":"2026-03","invoices.amount":1700,"invoices.status":"paid"}
The why: interpret and cross-check
Inspect the row grain before aggregating: one row represents one invoice. The data is fictional and statements about cash, revenue recognition or business quality need separate evidence. SELECT * FROM invoices; Inspect the row grain before aggregating: one row represents one invoice.
Guided application in the tool
Open SQL for Financial Analysis using the Use tool option. Read the labels and enter only the supported values or evidence from this case. Try to predict the result before calculating or revealing worked reasoning. For a writing task, draft your own explanation and compare it with the stated review criteria. Record the source, period and assumptions. Preserve the original example and note any changed inputs. Use your conclusion or reflection area to explain what the result means, then save the workspace if signed in.
Independent task and review criteria
Start by identifying the business question this tool answers. A label is useful only when you can explain its meaning and distinguish it from a related concept. Read the worked case without changing its inputs. Identify the resource, obligation, outcome or evidence being measured and the period to which it applies. Explain one definition in your own words, then test that explanation against the supplied example. A tool can accelerate a method; it cannot choose the business meaning of a field for you.
A strong submission identifies the business question, uses the supplied facts consistently, shows the method, performs a useful independent check and acknowledges a condition that could change the conclusion. A correct number alone is incomplete; explain its unit and business mechanism. Separate a future assumption from an observed outcome and avoid claiming a credential from a practice result.
Common mistake
Multiplying records through a nonunique join.
Scope, assumptions and limitations
Fictional invoices, customers and expenses in the original guided SQL workspace. Its supported query subset is narrower than full SQLite; use Advanced SQL Lab for CTEs and window functions. No account database or outside connection is available. Fictional invoices, customers and expenses in the original guided SQL workspace. Its supported query subset is narrower than full SQLite; use Advanced SQL Lab for CTEs and window functions. No account database or outside connection is available.
FORMULA TOOLKIT
SEE IT IN ACTION
Worked examples
Worked example 1 · Start here
customers — one row per customer Row 1: {"id":1,"name":"Harbor Books","region":"East"} Row 2: {"id":2,"name":"Cedar Coffee","region":"West"} Row 3: {"id":3,"name":"North Studio","region":"East"} invoices — one row per invoice Row 1: {"id":101,"customer_id":1,"month":"2026-01","amount":1200,"status":"paid"} Row 2: {"id":102,"customer_id":2,"month":"2026-01","amount":800,"status":"unpaid"} Row 3: {"id":103,"customer_id":3,"month":"2026-01","amount":1500,"status":"paid"} Row 4: {"id":104,"customer_id":1,"month":"2026-02","amount":1800,"status":"paid"} Row 5: {"id":105,"customer_id":2,"month":"2026-02","amount":950,"status":"unpaid"} Row 6: {"id":106,"customer_id":3,"month":"2026-02","amount":2100,"status":"unpaid"} Row 7: {"id":107,"customer_id":1,"month":"2026-03","amount":1600,"status":"unpaid"} Row 8: {"id":108,"customer_id":2,"month":"2026-03","amount":1100,"status":"paid"} Row 9: {"id":109,"customer_id":3,"month":"2026-03","amount":1700,"status":"paid"} expenses — one row per listed expense Row 1: {"id":1,"month":"2026-01","category":"Payroll","amount":1600} Row 2: {"id":2,"month":"2026-01","category":"Rent","amount":500} Row 3: {"id":3,"month":"2026-02","category":"Payroll","amount":1800} Row 4: {"id":4,"month":"2026-02","category":"Rent","amount":500} Row 5: {"id":5,"month":"2026-03","category":"Payroll","amount":1900} Row 6: {"id":6,"month":"2026-03","category":"Rent","amount":500} Query: SELECT * FROM invoices; Inspect the row grain before aggregating: one row represents one invoice.
Inspect SELECT columns, FROM sources, filtering, grouping and ordering separately. Reconcile the result with the stated source rows. Result row 1: {"invoices.id":101,"invoices.customer_id":1,"invoices.month":"2026-01","invoices.amount":1200,"invoices.status":"paid"} Result row 2: {"invoices.id":102,"invoices.customer_id":2,"invoices.month":"2026-01","invoices.amount":800,"invoices.status":"unpaid"} Result row 3: {"invoices.id":103,"invoices.customer_id":3,"invoices.month":"2026-01","invoices.amount":1500,"invoices.status":"paid"} Result row 4: {"invoices.id":104,"invoices.customer_id":1,"invoices.month":"2026-02","invoices.amount":1800,"invoices.status":"paid"} Result row 5: {"invoices.id":105,"invoices.customer_id":2,"invoices.month":"2026-02","invoices.amount":950,"invoices.status":"unpaid"} Result row 6: {"invoices.id":106,"invoices.customer_id":3,"invoices.month":"2026-02","invoices.amount":2100,"invoices.status":"unpaid"} Result row 7: {"invoices.id":107,"invoices.customer_id":1,"invoices.month":"2026-03","invoices.amount":1600,"invoices.status":"unpaid"} Result row 8: {"invoices.id":108,"invoices.customer_id":2,"invoices.month":"2026-03","invoices.amount":1100,"invoices.status":"paid"} Result row 9: {"invoices.id":109,"invoices.customer_id":3,"invoices.month":"2026-03","invoices.amount":1700,"invoices.status":"paid"}
Check your understanding · 5 questions
Try each question before reading its solution. Guests can check the first three questions. Sign in to save your answers or try the full set. Written responses use self-review.
How to review a written answer
Check your response against the returned model reasoning and each required step. Name a supplied fact, show how it supports the method, and state the conclusion’s limitation. A response that only repeats a definition is incomplete. Written submission is recorded as self-review, not automatically correct.
Predict, explore, and explain
Before revealing the method, predict the result or the approach you would use. Compare your reasoning after you explore.
Test your reasoning against a worked example
Explain it in your own words
STRUCTURED SELF-REVIEW
Close the worked example. Explain the idea, describe why the method works, and give a small business example. Then reopen the lesson to check your reasoning. This is a self-review rubric; no AI analysis or automatic writing score is provided.
Open this section to load the lesson rubric.
TAKE THE NEXT STEP
Use it once. Then explain why.
You’ve explored purpose and vocabulary · explore invoices. Now check what you can explain and apply without the worked answer.
- Recall the idea. Explain when you would use this method and what its answer means.
- Try it independently. Work through a practice question before revealing help.
- Review the reasoning. Compare your method with the feedback, then revisit any saved mistakes.
Ask about a step in this lesson
Build a short review routine
- Close the explanation and describe the main idea in one sentence.
- Work through a question and state why you chose the method.
- Compare your reasoning with the feedback; record what you would change.
- Return later and try a question again before reading your notes.
Marking a lesson as read tracks your place. Practice results track your answers.
Loading saved progress…