Affine Interview Question

Mostly on Excel and SQL