diff --git a/models/staging/stocks/stg_stocks__fund_ownership.sql b/models/staging/stocks/stg_stocks__fund_ownership.sql new file mode 100644 index 00000000..6cbb9fce --- /dev/null +++ b/models/staging/stocks/stg_stocks__fund_ownership.sql @@ -0,0 +1,24 @@ +with + +source as ( + + select * from {{ source('stocks', 'fund_ownership') }} + +), + +renamed as ( + + select + symbol, + report_date, + organization, + pct_held as percent_held, + position as position_total, + value as position_value, + pct_change as percent_change + + from source + +) + +select * from renamed diff --git a/models/staging/stocks/stg_stocks__grade_history.sql b/models/staging/stocks/stg_stocks__grade_history.sql new file mode 100644 index 00000000..6947ea79 --- /dev/null +++ b/models/staging/stocks/stg_stocks__grade_history.sql @@ -0,0 +1,23 @@ +with + +source as ( + + select * from {{ source('stocks', 'grade_history') }} + +), + +renamed as ( + + select + symbol, + epoch_grade_date, + firm, + to_grade, + from_grade, + action as grade_action + + from source + +) + +select * from renamed diff --git a/models/staging/stocks/stg_stocks__insider_transactions.sql b/models/staging/stocks/stg_stocks__insider_transactions.sql new file mode 100644 index 00000000..be8a9dc2 --- /dev/null +++ b/models/staging/stocks/stg_stocks__insider_transactions.sql @@ -0,0 +1,27 @@ +with + +source as ( + + select * from {{ source('stocks', 'insider_transactions') }} + +), + +renamed as ( + + select + symbol, + shares, + filer_url, + transaction_text, + filer_name, + filer_relation, + money_text, + start_date, + ownership, + value as total_value + + from source + +) + +select * from renamed diff --git a/models/staging/stocks/stg_stocks__recommendation_trends.sql b/models/staging/stocks/stg_stocks__recommendation_trends.sql new file mode 100644 index 00000000..7e4ea445 --- /dev/null +++ b/models/staging/stocks/stg_stocks__recommendation_trends.sql @@ -0,0 +1,24 @@ +with + +source as ( + + select * from {{ source('stocks', 'recommendation_trends') }} + +), + +renamed as ( + + select + symbol, + period, + strong_buy as strong_buy_total, + buy as buy_total, + hold as hold_total, + sell as sell_total, + strong_sell as strong_sell_total + + from source + +) + +select * from renamed diff --git a/models/staging/stocks/stg_stocks__sec_filings.sql b/models/staging/stocks/stg_stocks__sec_filings.sql new file mode 100644 index 00000000..fe053da2 --- /dev/null +++ b/models/staging/stocks/stg_stocks__sec_filings.sql @@ -0,0 +1,23 @@ +with + +source as ( + + select * from {{ source('stocks', 'sec_filings') }} + +), + +renamed as ( + + select + symbol, + date as report_date, + epoch_date, + type as report_type, + title as report_title, + edgar_url + + from source + +) + +select * from renamed diff --git a/models/staging/tpch/stg_tpch_line_items.sql b/models/staging/tpch/stg_tpch_line_items.sql index a81647fb..8e374f78 100644 --- a/models/staging/tpch/stg_tpch_line_items.sql +++ b/models/staging/tpch/stg_tpch_line_items.sql @@ -26,7 +26,6 @@ renamed as ( l_commitdate as commit_date, l_receiptdate as receipt_date, l_shipinstruct as ship_instructions, - l_shipmode as ship_mode, l_comment as comment from source