Learn how to work with SQL models for data operations and queries
SQL models provide powerful ways to interact with your data warehouse, enabling you to write data back to models, perform custom queries, and maintain data consistency across your systems.
The SQL write node enables direct database operations inside a connected warehouse.Step 1: Enter database name and select schema/tableStep 2: Choose the action to perform
Insert: Always creates a new row
Upsert: Creates a new row if no matching row exists, otherwise updates it
Update: Updates matching rows without creating new entries
Delete: Removes matching rows
Step 3: Define matching criteria for non-INSERT operationsStep 4: Specify data mapping for each column
Create powerful SQL-based data models that combine data from multiple sources.Add an SQL connector to enable direct database access. The connector supports both BigQuery and Snowflake with consistent patterns for table structure.Step 1: Add SQL model and configure database connectionStep 2: Write the SQL query for your specific database (BigQuery or Snowflake) respecting their syntaxStep 3: Adapt the SQL query for your database scopeIf you selected database scope: ‘[DATABASE].datasets_[CONNECTOR_SLUG].models_[MODEL_SLUG]’If you have chosen schema scope when setting up Snowflake system of record then use the following naming convention:‘[DATABASE].[SCHEMA].datasets_[CONNECTOR_SLUG]_models[MODEL_SLUG]’Step 4: Configure mapping for unique identifier, title, and timestamp columnsStep 5: Preview and save the query