I am trying to make a query of three tables in my MariaDB of a gym:
Clases
Instructores
Usuarios
What the query asks me is the following:
"Know which is the class that has more students and display" class ", "Full name of the instructor" also including "names of the students "".
I was able to perform the following deployment:
The query code I used:
select usuarios.Nombre, clases.Nombre_Clase, instructores.Nombre
from((clases
inner join usuarios on clases.Clase_ID = usuarios.Clases)
inner join instructores on clases.ID_instructor = instructores.ID);
But how can I deploy the class that has the most students? in this case that is the one of Box?
I'm not very good at database, but can you apply some kind of counter?
P.D. the last column on the right is that of instructors, the one on the left is of students.