Docs
Sign up now
  • Getting started
    • Welcome to Sortment
    • Core Concepts
  • Schema
    • Overview
    • Related and Events Table
    • Setting Up Related Table
    • Setting Up Events Table
    • Custom Properties
  • ENGAGE
    • Audiences
      • Creating Audience
      • Audience Filters
      • Campaign Event Filters
      • Creating Audience Using SQL Builder
      • Managing Audiences
      • Audience Insights
    • Traits
      • Use Cases
      • Calculated Traits
        • Advanced Mode
      • Dynamic Traits
    • Profiles
      • User Profile View
    • Campaigns
      • Overview
      • Building a Campaign
      • Campaign Reports
        • Glossary
      • Conversion Tracking
  • Journeys
    • Getting Started
    • Journey Builder
    • Journey Components
      • Trigger
      • Delays
      • Flow Control
      • Action blocks
    • Tutorial: Creating a journey
    • Journey Settings
  • Connector
    • Overview
    • Getting started
      • Iterable
      • Klaviyo
  • Enable Data Sync
  • Setup
    • Data Warehouses
      • Snowflake
      • BigQuery
      • Redshift
      • Databricks
      • PostgreSQL
    • Cloud Bucket Storage
      • Amazon S3 for Snowflake
      • Google Cloud Storage for BigQuery
      • Amazon S3 for Redshift
      • Amazon S3 for Databricks
    • Communication Channels
      • Email
        • SendGrid
        • SES
        • Mailmodo
      • SMS
        • MSG91
        • Gupshup
      • WhatsApp
        • Meta (Facebook)
          • Add new Phone Number to Meta
        • Gupshup Enterprise
        • WATI
        • Gallabox
        • Yellow.ai
        • Kaleyra.io
    • Real-time Events
      • Setting up Event Source
      • Whitelist Event Payload
  • Settings
    • Sync Schedules
    • Audit Logs
    • Subscription Groups And Contact Fields
    • Delivery Controls
    • Test Profiles
    • Alerts
  • Data and Security
    • Technical Overview
    • Warehouse Data Practices
    • Data Access And Usage
    • Security Compliance
    • Audit Logs
    • Privacy Policy
Powered by GitBook
On this page
  • Relationships
  • Directionality

Was this helpful?

  1. Schema

Related and Events Table

In the e-commerce example, a related table could be an Orders table with columns for:

  • GMV: Total amount for the order

  • order_id: Unique id for the order

  • phone_number: Phone number for the order for communication purposes

  • address: Shipping address for the order

  • customer_name: Customer name for the order

  • placed_on: Order created date

  • modified_at: Order modified date

For these events, an events model might include columns for:

  • id: Unique event id

  • timestamp: Timestamp for occurrence of the event

  • event_name: Event name

  • user_id: User id for the customer who did the event. This is the column the events table gets joined on with users table

An events table might include your app events:

  • account_created

  • account_updated

  • page_viewed

  • login_completed

Relationships

When you create related or event tables, you simultaneously set up their relationships.

In the e-commerce example, let's say you want to create an audience of customers who ordered a specific product or who did a particular event action on your app. You need to define a relationship between your primary table (users) and your related table (orders) and events table (events).

Under the hood, Sortment generates SQL JOINs between your tables. To make this possible, you must create relationships by selecting the foreign keys between your tables.

Directionality

Relationships are directional. That means you can create and view relationships starting from a parent to a child table.

For example, 1:many relationship can be created from users to events

The schema overview page shows the schema from the perspective of primary table; labels are displayed accordingly.

PreviousOverviewNextSetting Up Related Table

Last updated 16 days ago

Was this helpful?