Module 4 · Lecture 4.2
Reading VQL
The building blocks of a VQL query, and why Veezoo generates VQL rather than SQL.
VQL stands for Veezoo Query Language. Veezoo generates it every time you ask a question and every time it decides to draw a chart. It reads much closer to natural language than SQL does, which plays to what language models are good at, and it is still translated deterministically into SQL underneath.
The lecture names the building blocks and then follows one measure through three questions: the confidence-scaled price premium across the whole dataset, the same measure broken down by depot, and then filtered to Wales. Each piece of the query is traced back to where it lives in Studio, and the query editor shows how a few lines of VQL expand into a long SQL query.
Key points
- Vars are the named steps of a query, similar to a variable or a common table expression, for example a var for dynamic pricing.
- Relationships span the Knowledge Graph to connect classes, and they appear in the query as the connection into the other class, for example with depot.
- Entities are the specific members inside a class, so a query can filter to one of them, for example depot region equals Wales.
- Measures are called out from the class they live on, and a group by slices them by a dimension such as depot.
optionalbehaves like a left join: if the related data is there it joins, and if not the row stays instead of being filtered out.- VQL is short and readable, and it is far easier for a language model to get right than SQL is.
- The query editor shows Veezoo expanding VQL through deterministic rewrite rules and then into the much longer SQL that actually runs.
Check your understanding
What is a var in a VQL query?
Vars are the named steps of a query, for example the var for dynamic pricing that the demo query starts with.
A VQL query marks one of its relationships as optional. What does that mean for the result?
optional works like a left join, so a row stays in the result even when the related data is missing.
Why does Veezoo generate VQL instead of writing SQL directly?
VQL stays compact and readable while Veezoo rewrites and translates it deterministically into the much longer SQL underneath.