SQL
Basic CTE Examples
Create a CTE called `cte` and use it in the main query:  
```sql
WITH cte AS (SELECT 42 AS x)
SELECT * FROM cte;
```  
| x  |
|---:|
| 42 |  
Create two CTEs `cte1` and `cte2`, where the second CTE references the first CTE:  
```sql
WITH
cte1 AS (SELECT 42 AS i),
cte2 AS (SELECT i * 100 AS x FROM cte1)
SELECT * FROM cte2;
```  
|  x   |
|-----:|
| 4200 |