eClinicalWorks Interview Question

was made to write a big join query