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.
Diese Übung ist Teil des Kurses
Introduction to Data Modeling in Snowflake
Anleitung zur Übung
- Create a new entity called
employee_training_details
that will store records of training sessions attended by employees. - This entity should include an
employee_training_id
as a primary key; the datatype should beNUMBER(10,0)
. - Add a new attribute
year
with datatypeNUMBER(4,0)
to record the year that the employee took the training. - Include foreign keys that reference employee_id in the
employees
entity andtraining_id
in thetraining
entity; both areNUMBER(38,0)
data types.
Interaktive Übung
Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.
-- 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)
);