Develop a strong foundation and understanding of web design by learning HTML, CSS, and additional tools to help you develop your own website.
Do more with
I have no clue how to either use the calculation to calculate the Seniority or use the trigger to do that.. Please help...
create table Employees(ID int, Name varchar(10), Hiredate date,
Seniority as
case
when datediff(year,hiredate, getdate()) < 1 then 'Newbie'
when datediff(year,hiredate, getdate()) between 1 and 4 then 'Junior'
else 'Senior'
end
);
My question is, should I put the seniority field as a calculation field? Or should I use the trigger to determine the employee is 'Newbie', 'Junior', or 'Senior'?None of these, Cause it's a time depended state. Thus it's a separate table where you track the states over time per employee.
Premium Content
You need an Expert Office subscription to comment.Start Free Trial