diff --git a/code_thingies/dbtlearn/models/src/src_hosts.sql b/code_thingies/dbtlearn/models/src/src_hosts.sql new file mode 100644 index 0000000..a39842a --- /dev/null +++ b/code_thingies/dbtlearn/models/src/src_hosts.sql @@ -0,0 +1,10 @@ +WITH raw_hosts AS ( + SELECT * + FROM raw.raw_hosts +) +SELECT + id as host_id, + name as host_name, + is_superhost as flag_is_superhost +FROM + raw_hosts \ No newline at end of file diff --git a/notes/8.md b/notes/8.md index a2b0b27..ea53e09 100644 --- a/notes/8.md +++ b/notes/8.md @@ -4,4 +4,17 @@ Models are the fundamental concept behind dbt. They are stored as SQL files in the `models` folder. -Models can be related between themselves to map dependencies. \ No newline at end of file +Models can be related between themselves to map dependencies. + + + +## Materializations + +- Ways in which a model can be stored in the database. There are 4: + - View: it's just a view + - Table: the model gets stored as a table + - Incremental: also a table, but can only create new records, not update + - Ephemeral: it's actually NOT materializing. The model can be used by dependents, but it won't be materialized in the DB. It will truly only be a CTE that gets used by other models. Mostly for intermediate states in transformations. + + +## \ No newline at end of file