I'm doing a table query / modification exercise. I have two tables:

```
CREATE TABLE CURSOS
( Codigo NUMBER,
Nombre VARCHAR2(20),
Cod_Profe NUMBER,
Max_Alumn NUMBER,
Fecha_Inic DATE,
Fecha_Fin DATE,
Num_Horas NUMBER,
CONSTRAINT Cod_Curso_PK PRIMARY KEY (Codigo),
CONSTRAINT Cod_Profe_FK
FOREIGN KEY (Cod_Profe)
REFERENCES PROFESORADO(Codigo)
);
CREATE TABLE ALUMNADO
( Codigo NUMBER,
Nombre VARCHAR2(30),
Apellidos VARCHAR2(30),
Sexo VARCHAR2(1),
Fecha_Nac DATE,
Cod_Curso NUMBER,
CONSTRAINT Cod_alum_PK PRIMARY KEY (Codigo),
CONSTRAINT Cod_Curso_FK
FOREIGN KEY (Cod_Curso)
REFERENCES CURSOS(Codigo)
);
```

I have:

```
Curso 1 con 22 alumnos
Curso 2 con 18 alumnos
Curso 3 con 17 alumnos
Curso 4 con 14 alumnos
```

And I need to make a modification that is as follows, "Remove, from the table COURSES, the course record that have less than 15 students."

I have to use the register draft command `DELETE.... WHERE...`

and do the subquery, and it does not work.

This is what I try:

```
DELETE CURSOS
WHERE CODIGO NOT IN (SELECT DISTINCT COD_CURSO
FROM ALUMNADO
WHERE (SELECT COUNT(*) FROM ALUMNADO GROUP BY COD_CURSO) > 15);
```