Affine interview question

Mostly on Excel and SQL