B & I Contractors interview question

Coding question on python and sql