Learn about some key differences between Structured Query Language (SQL) and TrackTik Query Language (TQL).
Overview
TQL is used to write queries in Data Lab. If you used SQL in the past, you might notice it's pretty similar to TQL. This article compares some of the notable differences between the two languages. When you understand TQL better and build on the information you know, you can create insightful reports to show your most important key performance indicators in Data Lab.
Comparing SQL to TQL
In the comparison table, you can see some of the key differences between the two languages:
SQL | TQL |
Uses wildcards. For example, uses Select * from employees to select all columns in the Employees table. |
Doesn't use wildcards. For example, doesn't use |
Uses the JOIN keyword to combine information from two different tables. |
Uses relation categories with elements and dot notation, so you don't need to use the |
Has a set foundation of functions. | Has many of the same functions as SQL, but not all of them. There is a slight difference in the syntax structure, too. TQL can do TrackTik-specific queries. |
It uses casting to convert one type of data to another. For example, 5 starts as an integer or number and can be cast to a string. | Doesn't use casting. |
Uses variables. You can save data in the variables to use the data elsewhere in a query. For example: DECLARE @TestVariable AS VARCHAR(100) |
Variables aren't supported. |
Uses aliases to change column names. For example,Select firstName as 'first name' . |
Supports |
Allows you to update, edit, and delete information. | Uses only Select operations, so you don't need to update, edit, or delete; the focus is to pull information from a source that already exists.
|
Uses subqueries (sometimes called nested selects). For example: SELECT Ord.SalesOrderID, Ord.OrderDate, |
Doesn't use subqueries. |