Creating entities for ER model
The HR department has requested a new system to track the training programs employees have completed.
Your task involves applying the ER model by setting up a new entity to record the details of each session, including a reference to the training program from the trainings entity.
Cet exercice fait partie du cours
Introduction to Data Modeling in Snowflake
Instructions
- Create a new entity called
employee_training_detailsthat will store records of training sessions attended by employees. - This entity should include an
employee_training_idas a primary key; the datatype should beNUMBER(10,0). - Add a new attribute
yearwith datatypeNUMBER(4,0)to record the year that the employee took the training. - Include foreign keys that reference employee_id in the
employeesentity andtraining_idin thetrainingentity; both areNUMBER(38,0)data types.
Exercice interactif pratique
Essayez cet exercice en complétant cet exemple de code.
-- Create new entity
___ employee_training_details (
-- Assign a unique identifier for the entity
___ ___ PRIMARY KEY,
-- Add new attribute
___,
-- Add new attributes to reference foreign entities
___ NUMBER(38,0),
___ NUMBER(38,0),
___ (___) ___ employees(employee_id),
___ (___) ___ trainings(training_id)
);