CREATE PROCEDURE [dbo].[create_insert_dim_employee_experience_level]
AS
BEGIN
    DROP TABLE IF EXISTS dim_employee_experience_level;
    create table dim_employee_experience_level
    (
        id int identity,
        level int null,
        title varchar(255),
        description varchar(255) null,
    );
    create index dim_employee_experience_level_level_index
        on dim_employee_experience_level (level);
    INSERT INTO dim_employee_experience_level (level, title, description) VALUES
     (1, 'L1', 'experience <= 23 Months'),
     (2, 'L2', 'experience >= 24 Months and experience <= 59 Months'),
     (3, 'L3', 'experience >= 60 Months and experience <= 95 Months'),
     (4, 'L4', 'experience >= 96');
    UPDATE last_updated_at_history set last_updated_at = getdate() where sp_name = 'create_insert_dim_employee_experience_level';


END;
go

