Question: **Code:**

```
eval("print('foobar')")

```

**Output:**

```
Traceback (most recent call last):
  File "Untitled.py", line 30, in <module>
    eval("print('foobar')")
  File "<string>", line 1
    print('foobar')
        ^
SyntaxError: invalid syntax

```

What am I doing wrong?

Answer: 
I do not see what the `in` buys you. I find this easier to write and to follow with the calculation in the `from` clause:

```
select d.department_name
from (select s.department_id, count(*) as num_students,
             rank() over (order by count(*) desc) as seqnum
      from student s
      group by s.department_id
     ) s join
     department d
     on s.department_id = d.department_id
where seqnum = 1;

```

This also makes it easy to add the number of students in the most populous departments.
Try using the MAX analytics function

```
SELECT department_name 
FROM department 
WHERE department_id IN
  ( SELECT
      department_id
    FROM
      ( SELECT
          department_id,
          COUNT(student_id) students,
          MAX(COUNT(student_id)) OVER () max_students
        FROM student  
        GROUP BY department_id 
      )
    WHERE students=max_students
  );

```

Not tested.

Or in Oracle 12c onwards you could use the `FECTH` clause

```
SELECT department_name 
FROM department 
WHERE department_id IN
  ( SELECT department_id
    FROM student  
    GROUP BY department_id 
    ORDER BY COUNT(student_id) DESC
    FETCH FIRST ROW WITH TIES
  );

```