Fractal Interview Question

They asked me to write sql queries