From f9e58369ca67fd6a8a06b2e5730a410352e07a1c Mon Sep 17 00:00:00 2001 From: Pablo Martin Date: Fri, 27 Oct 2023 10:15:24 +0200 Subject: [PATCH] Remove snowflake bits --- code_thingies/database/README.md | 69 -------------------------------- 1 file changed, 69 deletions(-) diff --git a/code_thingies/database/README.md b/code_thingies/database/README.md index caa1af1..aee293e 100644 --- a/code_thingies/database/README.md +++ b/code_thingies/database/README.md @@ -58,73 +58,4 @@ aws s3 cp s3://dbtlearn/hosts.csv hosts.csv How to put the data into the databases is up to you. I've done it successfully using the import functionality of DBeaver. -# Introduction and Environment Setup -## Snowflake user creation -Copy these SQL statements into a Snowflake Worksheet, select all and execute them (i.e. pressing the play button). - - - - - - -## Snowflake data import - -Copy these SQL statements into a Snowflake Worksheet, select all and execute them (i.e. pressing the play button). - -```sql --- Set up the defaults -USE WAREHOUSE COMPUTE_WH; -USE DATABASE airbnb; -USE SCHEMA RAW; - --- Create our three tables and import the data from S3 -CREATE OR REPLACE TABLE raw_listings - (id integer, - listing_url string, - name string, - room_type string, - minimum_nights integer, - host_id integer, - price string, - created_at datetime, - updated_at datetime); - -COPY INTO raw_listings (id, - listing_url, - name, - room_type, - minimum_nights, - host_id, - price, - created_at, - updated_at) - from 's3://dbtlearn/listings.csv' - FILE_FORMAT = (type = 'CSV' skip_header = 1 - FIELD_OPTIONALLY_ENCLOSED_BY = '"'); - - -CREATE OR REPLACE TABLE raw_reviews - (listing_id integer, - date datetime, - reviewer_name string, - comments string, - sentiment string); - -COPY INTO raw_reviews (listing_id, date, reviewer_name, comments, sentiment) - from 's3://dbtlearn/reviews.csv' - FILE_FORMAT = (type = 'CSV' skip_header = 1 - FIELD_OPTIONALLY_ENCLOSED_BY = '"'); - - -CREATE OR REPLACE TABLE raw_hosts - (id integer, - name string, - is_superhost string, - created_at datetime, - updated_at datetime); - -COPY INTO raw_hosts (id, name, is_superhost, created_at, updated_at) - from 's3://dbtlearn/hosts.csv' - FILE_FORMAT = (type = 'CSV' skip_header = 1 - FIELD_OPTIONALLY_ENCLOSED_BY = '"');