Super learner
This user is a Super Learner. To become a Super Learner, you need to reach Level 8.
Last answered:

22 Feb 2024

Posted on:

10 Feb 2024

0

Resolved: Why null values

 Why these values are null?

3 answers ( 3 marked as helpful)
Instructor
Posted on:

12 Feb 2024

0

Hi Sayed!
Thanks for reaching out.


It is because we do not have a value for these columns. When we have the last or the first salaries we do not have the next and the previous values.


Hope this helps.
Best,
Tsvetelin

Posted on:

21 Feb 2024

0

@sayed 

There are null values because we have used PARTITION BY emp_no in windows function and hence the LAG() and LEAD() works as if every individual emp_no is a separate part which is in partition

i.e, It does not take the salary of the previous employee and the next employee into account. So there is no previous and next value of the same employee to display.

This explains the null values at the beginning and at the end of every employee partition, I hope.


Super learner
This user is a Super Learner. To become a Super Learner, you need to reach Level 8.
Posted on:

22 Feb 2024

0

Thank you both for illustrating

Submit an answer