1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to Data Modeling in Snowflake

Connected

Exercise

Creating hubs

The HR department has commented that they need a more detailed history of all the changes with their records of employees, departments, and training.

You will need to restructure its data into a series of hubs.

Hubs will create a scalable and agile data warehouse that can accommodate changes over time without disrupting existing structures.

Instructions 1/3

undefined XP
  • 1
    • Create hub_employee with a numerical of 10 digits autoincremental key called hub_employee_key.
    • Include a load_date, datatype TIMESTAMP, and record_source, datatype VARCHAR(255), attributes to record the historical changes.
  • 2
    • Modify the script to add the following attributes:
      • The primary key, hub_department_id, as an autoincremental number of 10 digits and no decimals.
      • department_id with datatype numerical of 38 digits.
      • Include the attributes to record the historical changes; load_date and record_source.
  • 3
    • Assign hub_training_key as a numerical auto incremental of 10 digits.
    • Add the attributes training_id as numerical of 38 digits and all the necessary history tracking fields; load_date as TIMESTAMP, and record_source as VARCHAR(255).