forked from gvwilson/sql-tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:gvwilson/sql-tutorial
- Loading branch information
Showing
38 changed files
with
200 additions
and
177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
"""Regenerate SQL dependency description for Make.""" | ||
|
||
from pathlib import Path | ||
import sys | ||
|
||
|
||
def main(): | ||
"""Main driver.""" | ||
for src in sys.argv[1:]: | ||
lines = [ln.replace(".read", "").strip() for ln in Path(src).read_text().split("\n") if ln.startswith(".read")] | ||
if not lines: | ||
continue | ||
src = src.replace("src/", "${OUT}/").replace(".sql", ".out") | ||
lines = [ln.replace("src/", "${SRC}/") for ln in lines] | ||
print(f"{src}: {' '.join(lines)}") | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
${OUT}/active_penguins.out: ${SRC}/make_active.sql | ||
${OUT}/aggregate_join.out: ${SRC}/create_work_job.sql ${SRC}/populate_work_job.sql | ||
${OUT}/aggregate_left_join.out: ${SRC}/create_work_job.sql ${SRC}/populate_work_job.sql | ||
${OUT}/backing_up.out: ${SRC}/create_work_job.sql ${SRC}/populate_work_job.sql ${SRC}/update_work_job.sql | ||
${OUT}/coalesce.out: ${SRC}/create_work_job.sql ${SRC}/populate_work_job.sql | ||
${OUT}/cross_join.out: ${SRC}/create_work_job.sql ${SRC}/populate_work_job.sql | ||
${OUT}/delete_rows.out: ${SRC}/create_work_job.sql ${SRC}/populate_work_job.sql ${SRC}/update_work_job.sql | ||
${OUT}/inner_join.out: ${SRC}/create_work_job.sql ${SRC}/populate_work_job.sql | ||
${OUT}/insert_values.out: ${SRC}/create_work_job.sql ${SRC}/populate_work_job.sql | ||
${OUT}/left_join.out: ${SRC}/create_work_job.sql ${SRC}/populate_work_job.sql | ||
${OUT}/negate_incorrectly.out: ${SRC}/create_work_job.sql ${SRC}/populate_work_job.sql | ||
${OUT}/recursive_lineage.out: ${SRC}/lineage_setup.sql | ||
${OUT}/represent_graph.out: ${SRC}/lineage_setup.sql | ||
${OUT}/set_membership.out: ${SRC}/create_work_job.sql ${SRC}/populate_work_job.sql | ||
${OUT}/subquery_set.out: ${SRC}/create_work_job.sql ${SRC}/populate_work_job.sql | ||
${OUT}/trigger_firing.out: ${SRC}/trigger_setup.sql | ||
${OUT}/trigger_successful.out: ${SRC}/trigger_setup.sql | ||
${OUT}/update_rows.out: ${SRC}/create_work_job.sql ${SRC}/populate_work_job.sql ${SRC}/update_work_job.sql | ||
${OUT}/views.out: ${SRC}/make_active.sql |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,4 @@ | ||
CREATE TABLE job ( | ||
name text not null, | ||
billable real not null | ||
); | ||
CREATE TABLE work ( | ||
person text not null, | ||
job text not null | ||
); | ||
| person | pay | | ||
|--------|-----| | ||
| mik | 2.0 | | ||
| po | 0.5 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,5 @@ | ||
CREATE TABLE job ( | ||
name text not null, | ||
billable real not null | ||
); | ||
CREATE TABLE work ( | ||
person text not null, | ||
job text not null | ||
); | ||
| person | pay | | ||
|--------|-----| | ||
| mik | 2.0 | | ||
| po | 0.5 | | ||
| tay | | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,3 @@ | ||
CREATE TABLE job ( | ||
name text not null, | ||
billable real not null | ||
); | ||
CREATE TABLE work ( | ||
person text not null, | ||
job text not null | ||
); | ||
| person | job | | ||
|--------|----------| | ||
| tae | complain | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,5 @@ | ||
CREATE TABLE job ( | ||
name text not null, | ||
billable real not null | ||
); | ||
CREATE TABLE work ( | ||
person text not null, | ||
job text not null | ||
); | ||
| person | pay | | ||
|--------|-----| | ||
| mik | 2.0 | | ||
| po | 0.5 | | ||
| tay | 0.0 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,14 @@ | ||
CREATE TABLE job ( | ||
name text not null, | ||
billable real not null | ||
); | ||
CREATE TABLE work ( | ||
person text not null, | ||
job text not null | ||
); | ||
| person | job | name | billable | | ||
|--------|-----------|-----------|----------| | ||
| mik | calibrate | calibrate | 1.5 | | ||
| mik | calibrate | clean | 0.5 | | ||
| mik | clean | calibrate | 1.5 | | ||
| mik | clean | clean | 0.5 | | ||
| mik | complain | calibrate | 1.5 | | ||
| mik | complain | clean | 0.5 | | ||
| po | clean | calibrate | 1.5 | | ||
| po | clean | clean | 0.5 | | ||
| po | complain | calibrate | 1.5 | | ||
| po | complain | clean | 0.5 | | ||
| tay | complain | calibrate | 1.5 | | ||
| tay | complain | clean | 0.5 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
CREATE TABLE job ( | ||
name text not null, | ||
billable real not null | ||
); | ||
CREATE TABLE work ( | ||
person text not null, | ||
job text not null | ||
); | ||
| person | job | | ||
|--------|-----------| | ||
| mik | calibrate | | ||
| mik | clean | | ||
| mik | complain | | ||
| po | clean | | ||
| po | complain | |
Oops, something went wrong.