Flatiron Health Interview Question

SQL and R codes, easy level