Hi experts,
I would like to set up the database to allow user select the following info:
User can select the project first.
Once user selected the project, if the project got modules under it, the system will show the module list to ask user select. After that, user can select the Lecture based on the module value.
If the project doesnt have any module, system will pop out the lecture name directly.
Now i designed 3 entities (as following), would like to know if it is possible to combine the 3 entities into 1 and also achieve the above function, or how could i simplify my structure?
Hi,
It depends on what you want, your example data leaves open a lot of requirements you might have in terms of referential integrity.
If the Project represents a larger unit to study, and a module is a subcomponent of a project, representing a smaller unit to study, and a lecture a specific session within a module, then I would create two relationships:
Module
Lecture
Not sure why you have a project with a lecture, without a module, I think I would prefer then to create a 'dummy' module on the project like "None"
Regards,
Daniel
Hi @Giselle Chen ,
Base on the requirements, I think DB design should be:
It's not good to combine all 3 entities into 1, the reason is that it will make DB store dulicate (redundant) information as not nessessary and may cause loading information slower. If you want to get project information from Lecture you can join to get it by using joining entity via FK. (Lecture join Module and Module join Project)
Regrads,
Khuong