BJIT Interview Question

python basic + sql query