Skip to content

Commit

Permalink
scan and edit
Browse files Browse the repository at this point in the history
  • Loading branch information
supergi0 committed Sep 21, 2023
1 parent 0b22917 commit 5b57a47
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion sql/cte/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This example shows CTE functions which potentially improve readability, as well as give us the option to reuse queries.

Let us write a query to calculate the average `tips` as well as number of pickups in high frequency zones. Notice how we can have both the CTEs i.e. `good_tip_pickups` & `high_frequency_pickups` in one CTE as well, but this example is meant to describe how to write multiple CTE functions.
Let us write a query to calculate the average `tips` as well as number of pickups in high frequency zones. Notice how we can have both the CTEs i.e. `good_tip_pickups` & `high_frequency_pickups` in one CTE as well, but in this example let us go ahead with two CTEs to describe how to write multiple CTE functions.

## SQL Query and Structure

Expand Down
2 changes: 1 addition & 1 deletion sql/join/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This example shows how to JOIN two sources with Dozer. The two tables i.e. `taxi_zone_lookup` and `trips` can be JOINed over the `LocationID`.

Let us write a query to calculate the average `tips` for rides taken from a particular `Zone`. Afterwards we will order this to find where the customers have higher chances of tipping a good amount. Additionally a `HAVING` clause is also added to filter out the results.
Let us write a query to calculate the average `tips` for rides taken from a particular `Zone`. Afterwards we will order this to find the zones where the customers have higher chances of tipping a good amount. Additionally a `HAVING` clause is also added to filter out the results.

## SQL Query and Structure

Expand Down
2 changes: 1 addition & 1 deletion sql/sub-queries/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This example shows how to write nested sub queries.

Let us write a query to calculate the average `tips` for rides taken from a particular `Zone`. The outermost query JOINs the `taxi_zone_lookup` with a nested subquery `hfz` which does the job of filtering and grouping the `trips` table. `hfz` contains another sub query which ensures prior filtering of license plates that end with 3.
Let us write a query to calculate the average `tips` for rides taken from a particular `Zone`. The outermost query JOINs the `taxi_zone_lookup` with a nested subquery `hfz` which does the job of filtering and grouping the `trips` table. `hfz` contains another sub query which ensures prior filtering of trips with license plates that end with 3.

## SQL Query and Structure

Expand Down
2 changes: 1 addition & 1 deletion sql/union/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sub queries example
# Union example

This example shows how to use the `UNION` clause in Dozer SQL.

Expand Down
8 changes: 6 additions & 2 deletions sql/window-functions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@
This example shows how to use the `TUMBLE` and `HOP` functions using Dozer SQL. These functions are often useful with real time analytics over vast streams of incoming data. To read more about window functions read the [documentation](https://getdozer.io/docs/transforming-data/windowing).

Here we describe two queries,
- Query to calculate the sum of tips obtained for a particular Pickup location over a 5 minutes window. `TUMBLE` will help us do the same.
- Query to calculate the sum of tips obtained for a particular Pickup location over a 5 minutes window.

- Query to calculate the sum of tips obtained for a particular Pickup location over a 5 minutes window but the windows overlap by 2 minutes, i.e. the 5 minutes are divided into 2 minutes overlapping with past window, 1 minute non overlapping and 2 minutes overlapping with next window. `HOP` will help us do the same.
- Query to calculate the sum of tips obtained for a particular Pickup location over a 5 minutes window but the windows overlap by 2 minutes.
i.e. the 5 minutes is divided into,
- 2 minutes overlapping with past window
- 1 minute non overlapping
- 2 minutes overlapping with next window

## SQL Query and Structure

Expand Down

0 comments on commit 5b57a47

Please sign in to comment.