SQL
Rank
SELECT student_id, score, RANK() OVER (ORDER BY score DESC) as 'rank' FROM Students;
DENSE_RANK() -> doesn't skip
Partition
DENSE_RANK() OVER (PARTITION BY department_id ORDER BY salary desc)
DateDIFF
DATEDIFF(w1.recordDate,w2.recordDate)=1;