Develop tables in Looker Flashcards

(41 cards)

1
Q

What is a derived table in Looker?

A

A query whose results are used as if the query were an actual table in the database.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What can you compute with a derived table?

A

Customer-level aggregate metrics such as how many orders each customer has placed or when each customer placed their first order.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the purpose of the derived_table parameter?

A
  • To define a derived table under a view parameter.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the two ways to define a derived table in Looker?

A
  • Native derived table with LookML-based query
  • SQL-based derived table with SQL query
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a native derived table?

A

A derived table based on queries defined using LookML terms.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a SQL-based derived table?

A

A derived table defined using a SQL query.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the main advantage of native derived tables over SQL-based derived tables?

A

Native derived tables are easier to read and understand.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What SQL command is used to create a persistent derived table (PDT)?

A

CREATE TABLE Data Definition Language (DDL) statement.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the purpose of the create_process parameter?

A

To create a PDT in multiple steps if the dialect does not support a single-step CREATE TABLE statement.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the difference between temporary and persistent derived tables?

A
  • Temporary derived tables are not written to the database.
  • Persistent derived tables are written to a schema on your database.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What happens when a user runs an Explore query involving a temporary derived table?

A

Looker constructs a SQL query using the derived table(s) plus requested fields, joins, and filter values.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

True or False: SQL-based derived tables can be incrementally built.

A

False.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Fill in the blank: To create a native derived table, you use the _______ parameter.

A

explore_source

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the sql parameter used for in SQL-based derived tables?

A

To define a query in SQL terms.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is an important consideration for naming columns in SQL-based derived tables?

A

Each column should have a clean alias using AS.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What type of derived tables are created by default if no persistence strategy is defined?

A

Temporary derived tables.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What is the purpose of the sql_create parameter?

A

To create a PDT using custom DDL commands.

18
Q

What does Looker use when cached results are valid for a temporary derived table query?

A

The cached results.

19
Q

What should be ensured about temporary derived tables?

A

They should be performant and not put excessive strain on the database.

20
Q

In the context of Looker, what is a view?

A

A representation of a derived table that can be used like any other table in the database.

21
Q

List the fields included in the customer_order_summary derived table.

A
  • customer_id
  • first_order
  • total_amount
22
Q

What parameter is used to create a derived table in Looker?

A

derived_table

23
Q

What are the two ways to define a derived table in Looker?

A
  • LookML-based query
  • SQL-based query
24
Q

What is a native derived table?

A

A derived table based on queries defined using LookML terms

25
What parameter do you use to define a query for a native derived table?
explore_source
26
In a native derived table, how are the columns created?
By referring to LookML dimensions or measures
27
What is the main advantage of native derived tables over SQL-based derived tables?
They are easier to read and understand
28
What is a SQL-based derived table?
A derived table defined using a SQL query
29
What parameter is commonly used to define a SQL query in a SQL-based derived table?
sql
30
Can you refer to LookML dimensions and measures in a SQL-based derived table?
No
31
What is the purpose of the SQL Runner in Looker?
To create SQL queries and turn them into derived table definitions
32
What is a persistent derived table (PDT)?
A derived table that is stored in the database for reuse
33
What is the create_process parameter used for?
To create a PDT in multiple steps when a single CREATE TABLE statement is not supported
34
What should you ensure when defining columns in a SQL-based derived table?
Give each column a clean alias using AS
35
What is the sql_create parameter used for?
To create a PDT with custom DDL commands
36
Fill in the blank: The two versions of the LookML illustrate how to create equivalent derived tables using either _______ or _______.
[LookML] [SQL]
37
True or False: Both native and SQL-based derived tables can use the same derived_table parameter.
True
38
What fields are included in the customer_order_summary derived table?
* customer_id * first_order * total_amount
39
What does the dimension_group for first_order in the native derived table include?
* type: time * timeframes: [date, week, month]
40
What SQL function is used to determine the first order date in the SQL-based derived table?
MIN(DATE(time))
41
What must you include in the SQL query to reference column names in dimensions?
Clean aliases using AS