Develop tables in Looker Flashcards
(41 cards)
What is a derived table in Looker?
A query whose results are used as if the query were an actual table in the database.
What can you compute with a derived table?
Customer-level aggregate metrics such as how many orders each customer has placed or when each customer placed their first order.
What is the purpose of the derived_table
parameter?
- To define a derived table under a view parameter.
What are the two ways to define a derived table in Looker?
- Native derived table with LookML-based query
- SQL-based derived table with SQL query
What is a native derived table?
A derived table based on queries defined using LookML terms.
What is a SQL-based derived table?
A derived table defined using a SQL query.
What is the main advantage of native derived tables over SQL-based derived tables?
Native derived tables are easier to read and understand.
What SQL command is used to create a persistent derived table (PDT)?
CREATE TABLE Data Definition Language (DDL) statement.
What is the purpose of the create_process parameter?
To create a PDT in multiple steps if the dialect does not support a single-step CREATE TABLE statement.
What is the difference between temporary and persistent derived tables?
- Temporary derived tables are not written to the database.
- Persistent derived tables are written to a schema on your database.
What happens when a user runs an Explore query involving a temporary derived table?
Looker constructs a SQL query using the derived table(s) plus requested fields, joins, and filter values.
True or False: SQL-based derived tables can be incrementally built.
False.
Fill in the blank: To create a native derived table, you use the _______ parameter.
explore_source
What is the sql parameter used for in SQL-based derived tables?
To define a query in SQL terms.
What is an important consideration for naming columns in SQL-based derived tables?
Each column should have a clean alias using AS.
What type of derived tables are created by default if no persistence strategy is defined?
Temporary derived tables.
What is the purpose of the sql_create parameter?
To create a PDT using custom DDL commands.
What does Looker use when cached results are valid for a temporary derived table query?
The cached results.
What should be ensured about temporary derived tables?
They should be performant and not put excessive strain on the database.
In the context of Looker, what is a view?
A representation of a derived table that can be used like any other table in the database.
List the fields included in the customer_order_summary derived table.
- customer_id
- first_order
- total_amount
What parameter is used to create a derived table in Looker?
derived_table
What are the two ways to define a derived table in Looker?
- LookML-based query
- SQL-based query
What is a native derived table?
A derived table based on queries defined using LookML terms