New highlights added 2024-02-07

Esto es pura práctica y mucho ojo con el naming!

Chapter 3: Query Decomposition (View Highlight)

Usually we just chain them

The CTEs should be constructed in such a way that they can be reused if needed later. (View Highlight)

The DRY principle states that if you find yourself copy-pasting the same chunk of code in multiple locations, you should put that code in a CTE and reference that CTE where it’s needed. (View Highlight)

Since both questions and answers tables have the exact same schema, a great way to deal with the above problem is by appending their rows using the UNION operator like this (View Highlight)

Importante en Hex

Bounded Time Windows (View Highlight)

New highlights added 2024-02-14

d (View Highlight)

New highlights added 2024-02-20

Also in Hex

If you know that your data will be used by a business intelligence tool like Looker or Tableau then you should leave the ordering up to the tool itself so the user can sort data any way they see fit. (View Highlight)

Here are some of the ways that data can change: 1. New columns are added that have NULL values for past data 2. Existing columns that didn’t have NULLs before now contain NULLs 3. Columns that contained numbers or dates stored as strings now contain other values 4. The formatting of dates or numbers gets messed up and the type conversion fails. 5. The denominator in a ratio calculation becomes zero (View Highlight)

Youget NULLwhenever youperformanytype ofcalculation withNULL likeadding or subtracting, multiplying or dividing. Doing any operation with an unknown value is still unknown. (View Highlight)

So in order to protect against unexpected NULLs it’s often a good idea for your production queries to wrap COALESCE() around all the fields. (View Highlight)

. BigQuery offers another way we can do this more cleanly. Just like the SAFE_CAST() function, it has a SAFE_DIVIDE() (View Highlight)

New highlights added 2024-02-21

ND INSTR(tags, “|sql|”) > 0 (View Highlight)