Feature 01 / 17
Find the data you need
Find the data you need: start with the schema, narrow the search, and see how the likely tables relate before you write a query in an unfamiliar database.
Schema browsingPreview
The problem
When you open an unfamiliar database, where does the data you need actually live?
A familiar business concept rarely has a familiar table name. Customer details may sit in one table, purchases in another, and the key that joins them may be undocumented. Guessing from names or opening tables one by one slows down every new investigation.
A clearer workflow
Orient yourself
Browse the source and inspect its tables, columns, and available relationships.
Follow a clue
Start with a business term or a known identifier, then inspect the fields and adjacent tables that look relevant.
Check with data
Preview records or run a small query to confirm that the table contains the answer you expected.
Worked example
Find where customer purchases live
Starting question
Which tables connect a Chinook customer to their purchases?
Steps to follow
- Follow “Inspect the Chinook relationship” to open Chinook Customer Invoices. Customer ID 1 is prefilled and editable; expand Sources and relationships.
- Inspect Customer.CustomerId and Invoice.CustomerId. The declared relationship connects many invoices to one customer.
- Choose Preview SQL, then Run, and inspect the invoice rows. Use Invoice.InvoiceId as the next clue for a separate query against InvoiceLine.InvoiceId.
What you learn
You have a path to investigate: Customer.CustomerId → Invoice.CustomerId, then Invoice.InvoiceId → InvoiceLine.InvoiceId. The line-item step is the next query to build.
Inspect the Chinook relationshipWhat changes
You leave with a specific table, field, and relationship to use, instead of a guess about where to begin.
The case of order 11045 · Act 1 · Find
In the demo story
Bottom-Dollar Markets calls support: order 11045 is due tomorrow and has not shipped. Sarah starts in the Northwind schema, where Customers and Orders hold the caller and the order.
The guided demo of this story is being built. The worked example above runs in today’s demo project.
