Generate query to display Mysql data in php

Asked

Viewed 65 times

0

The bank was created as follows:

  • Each Discipline can have 1 or more classes, while each Class belongs to only 1 discipline.
  • Each Teacher can have 1 or more classes, while each Class belongs to only 1 teacher.
  • Each Student may be enrolled in 1 or more classes, while a Class may have 1 or more students.
  • Each Student has 2 grades per Class in which he is enrolled.

I need to create a page (using the PHP language) that refers to the database and shows the following information:

  • Which teacher has more male students (’m')
  • Which teacher has the most female students ('f')
  • Which class has the highest overall average
  • Which class has the highest individual average (of only 1 student)
  • Which class has the lowest overall average
  • Which class has the lowest individual average (of only 1 student)
  • List the code of each class with the following information associated with it: the general average (of all grades), the name of the student with the lowest average, the name of the student with the highest average.

I’m having doubts about how to generate this query in DB and if I can create a variable for home one of them ?

  • Eduardo, you need to model the entities in the database and assemble the SQL commands by carrying out Join’s between the entities in order to get their 7 answers.

  • You already have some code made?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.