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.

Writing data to warehouse

Sql Models 1 Pn The SQL write node enables direct database operations inside a connected warehouse. Step 1: Enter database name and select schema/table Step 2: Choose the action to perform
  1. Insert: Always creates a new row
  2. Upsert: Creates a new row if no matching row exists, otherwise updates it
  3. Update: Updates matching rows without creating new entries
  4. Delete: Removes matching rows
Step 3: Define matching criteria for non-INSERT operations Step 4: Specify data mapping for each column

Custom SQL queries

Sql Models 2 Pn 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 connection Step 2: Write the SQL query for your specific database (BigQuery or Snowflake) respecting their syntax Step 3: Adapt the SQL query for your database scope If 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 columns Step 5: Preview and save the query