Stages and file formats
A file has arrived. How does Snowflake find it, read it correctly and distinguish an unknown amount from zero? Follow four fictional orders from a CSV file to an understandable preview, one decision at a time.
You should understand databases, schemas and roles from the earlier modules, plus SELECT, aliases, NULL and casts from Module 5. Module 6 is the previous roadmap step; window functions are not required here. No account is needed to study the explanations.
Eight lessons, one connected example
Begin with the purpose of each object. Then choose a location, define CSV rules, handle missing values, upload and inspect the file, and preview the expected records. Finish with external storage, other formats and a practical troubleshooting exercise.
Each lesson includes a step-through diagram, important terms, a practical scenario, an explained question and a challenge with reasoning. SQL and result tables are illustrative; nothing runs on this website.
From a file to a table: understand the journey
Separate the source file, stage, file format and destination table before learning commands.
Explore lesson ↗Lesson 02 · 20 minInternal and external stages: choose the location
Compare user, table, named internal and external stages with practical scenarios.
Explore lesson ↗Lesson 03 · 25 minRead CSV correctly: delimiters, headers and quotes
Build a named CSV format and trace how one source line becomes four fields.
Explore lesson ↗Lesson 04 · 22 minMissing amounts, zero and data types
Distinguish empty fields, NULL markers and zero, then separate parsing from conversion.
Explore lesson ↗Lesson 05 · 25 minCreate a named stage, upload a file and find it
Follow an internal-stage workflow with clear setup, client requirements and expected observations.
Explore lesson ↗Lesson 06 · 25 minPreview the file and explain every output column
Read staged CSV fields with $1 through $4, convert types and preserve source metadata.
Explore lesson ↗Lesson 07 · 22 minExternal stages: a cloud address plus approved access
Understand stage URLs, storage integrations and the two sides of cloud access.
Explore lesson ↗Lesson 08 · 25 minBeyond CSV: troubleshoot and prepare for loading
Compare JSON and Parquet, diagnose common problems and complete a staged-file readiness exercise.
Explore lesson ↗Keep three questions separate.
Where is the file? How should its bytes be interpreted? Where will the records go? A stage answers the first question, a file format helps answer the second, and a destination table answers the third. Uploading a file does not load table rows.
Explore the file-to-table diagram →What you will be able to explain
- Choose between user, table, named internal and external stages.
- Explain why a quoted comma stays inside a name, and why NULL differs from zero.
- Read CREATE FILE FORMAT, CREATE STAGE, PUT, LIST and staged SELECT examples.
- Trace previewed values to source files and diagnose location, access, parsing and conversion problems.
Continue to Module 8: COPY INTO and data loading to validate, load and reconcile these records. This module prepares you to understand the source before writing it into a table.
Official references
Use these references alongside the worked examples for exact syntax, privileges and source-specific options.