Explain the difference between stage and storage integration in Snowflake. How do you load data from a CSV file in S3 to Snowflake? What is the use case of strings?
š” Model Answer
In Snowflake, a stage is a named location that holds data files (CSV, JSON, Parquet, etc.) for loading or unloading. A storage integration is a Snowflake-managed external location that stores the credentials and permissions needed to access an external cloud storage service (like Amazon S3, Azure Blob, or Google Cloud Storage). The stage can be internal (managed by Snowflake) or external (pointing to a storage integration).
To load a CSV from S3, you first create a storage integration that grants Snowflake access to the S3 bucket. Then you create an external stage that references that integration and the bucket path. Finally, you run a COPY INTO command: COPY INTO my_table FROM @my_stage/file.csv FILE_FORMAT = (TYPE = 'CSV' FIELD_DELIMITER = ',' SKIP_HEADER = 1); Snowflake reads the file from S3 via the integration and loads it into the table.
Strings in Snowflake are used for any textual data. They can be stored in VARCHAR, TEXT, or CLOB columns. Use cases include storing names, addresses, JSON strings, or any semi-structured data that can be parsed later. Strings are also used in metadata, such as file names or URLs, and in SQL expressions for filtering, concatenation, or pattern matching.
This answer was generated by AI for study purposes. Use it as a starting point ā personalize it with your own experience.
š¤ Get questions like this answered in real-time
Assisting AI listens to your interview, captures questions live, and gives you instant AI-powered answers ā invisible to screen sharing.
Get Assisting AI ā Starts at ā¹500