Hello i have this scenario currently i have 3 default sections. A , B and C,
What I’m trying to do is every time i add a new student it should check if the section is full if so it should progress to the next section. eg. when A is full the student is automatically inserted to B same goes to B and C. So far my tbl_section is structured like this:
tbl_section:
section_id
section_name
school_year
adviser_id
year_level
Will this structure suffice? do i need to add a field for example quantity on tbl_secion? so that everytime i add a new student to that section it would increase the quantity. Would appreciate any help. On how can i perform this.
EDIT: or should i link my SELECT with my tbl_students to check how many are in a section?
How do you know if a section is full? You need a capacity as well.
You also need another table, SectionStudent, that tells you the assignment between students and section.
With this information you can write a query to determine the first “non-full” section. Here is one way: