Database / Snowflake Interview Questions
What are the stages in Snowflake (internal vs external) and how do you use them for data loading?
A stage in Snowflake is a named location holding data files before they are loaded into a table (or after being unloaded from one). Stages abstract the physical storage location so the COPY INTO command works identically whether files sit in Snowflake-managed storage or in your own cloud bucket.
Internal stages are managed by Snowflake within its own cloud storage. Three kinds exist: the user stage (@~, one per user, auto-created), the table stage (@%table_name, one per table, auto-created), and named internal stages (@my_stage, created explicitly, shareable across roles and sessions).
External stages point to customer-owned cloud storage (S3 bucket, Azure Blob container, GCS bucket). Defined with a URL and either inline credentials or a Storage Integration object (recommended — avoids embedding credentials in DDL). Supports all the same file formats as COPY INTO.
-- Create a named internal stage with a named file format
CREATE STAGE my_internal_stage
FILE_FORMAT = (TYPE = 'CSV' FIELD_DELIMITER = ',' SKIP_HEADER = 1);
-- Upload a local file to the internal stage (run in SnowSQL)
PUT file:///local/path/orders.csv @my_internal_stage;
-- List files in a stage
LIST @my_internal_stage;
-- Create an external stage pointing to S3 using a Storage Integration
CREATE STAGE my_s3_stage
URL = 's3://my-bucket/data/'
STORAGE_INTEGRATION = my_s3_integration
FILE_FORMAT = (TYPE = 'PARQUET');
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
