AbdulBazith
5 months ago
878
4
Laravel

Mapping class and subject and chapters into many to many relationship Laravel

Posted 5 months ago by AbdulBazith

Guys i have started a new project, its a online examination project

these are the following tables

Table: SubjectDetails

id  sub_name
1   english
2   maths
3   physics

Table: classDetails

id  class_name
1   5th std
2   6th std
3   7th std

above i have mentioned my class and subject tables

Further i have to classify the subject into chapters_name in those subjects and topics in each chapter. what i expect is like below

class subject     chapter               topics
5th   Maths     Matrices            Inverse of a Non-Singular
5th   Maths     Matrices        Elementary Transformations of a Matrix
5th   Maths     Matrices        Solving System of Linear Equations
5th   Physics   Electrostatics      Role of electrostatic
5th   Physics   Electrostatics      Electric flux
5th   Physics   Electrostatics      Polarisation
.
.
.
.
Like this for each class, each subject, each chapter wise, topic wise i need to frame question

at present i have class table and subject table only. Next further how many tables i need to create?? which all the tables i need to make many to many relationship? for simple i know that class_subject as pivot table? but what about chapter and topics??

kindly suggest me the pivot tables. I will pickup.

Please sign in or create an account to participate in this conversation.