Dear all l have two different designs for this task.Please read the designs and give me some advice on plan selection, thanks. Goals:1 users can add, delete and modify tags.2 Select the process to add the created tags.3 Click the tags to display processes. Plan ?? ##Database Design t_ds_process_definition id??unique identifier?? name??process name?????? t_ds_process_to_tags id ??unique identifier]??tag_id??tag id??process_id??workflow id?? t_ds_process_definiton_tags id??unique identification??tag_name??tag name?? ##Goal 1 Add tags: add a row of data in t_ds_process_definiton_tags Modify tags: modify the tag_name of t_ds_process_definiton_tags Delete tags: delete tag_name data of t_ds_process_definiton_tags, and delete the tag_id data of t_ds_process_to_tags ##Goal 2 1 Select the process and get the process_id. 2 select the tag and get the tag_id. 3 add a row of data in t_ds_process_to_tags. ## Goal 3 1 Query the tag_id corresponding to the tag_name at t_ds_process_definiton_tag 2 Query the process_id corresponding to the tag_id at t_ds_process_to_tags 3 Query the process corresponding to the process_id at t_ds_process_definition Problem: There are three database tables, which have many associations and are more complicated to operate. Plan II ##Database Design t_ds_process_definition id ??unique identifier?? name ??process name?????? t_ds_process_to_tags id ??unique identifier?? tag_name ??tag id?? process_id ??process id]?? ##Goal 1 Adding tags: because a row of data in t_ds_process_definiton_tags contains tag_name and process_id, adding tag_name alone does not make sense. Modify tags: modify the tag_name of t_ds_process_definiton_tags Delete tags: delete tag_name data of t_ds_process_definiton_tags ##Goal 2 1 Select the process and get process_id 2 select the tag and get tag_name 3 add a row of data in t_ds_process_to_tags ## Goal 3 1 Query all process_id corresponding to tag_name at t_ds_process_definiton_tags 2 Query process corresponding to process_id at t_ds_process_definition Problem: Because a process may contains multiple tags, there is duplication of tag_name. However, the number of tables can be reduced, and it is easier to operate the tables. ?????? 1 ???????????????????????????????????????????????? 2 ???????????????????????????? 3 ??????????????????????????????????????????
?????? ##?????????? t_ds_process_definition id????????????name??????????????version???????? t_ds_process_to_tags id????????????tag_id??????id??process_id????????id?? t_ds_process_definiton_tags id????????????tag_name???????????? ##???? 1 ????????t_ds_process_definiton_tags?????????????? ??????????t_ds_process_definiton_tags??tag_name ??????????t_ds_process_definiton_tags??tag_name??????t_ds_process_to_tags??tag_id???? ##???? 2 ??????????process_id??????????tag_id????t_ds_process_to_tags?????????????? ##????3 ??t_ds_process_definiton_tag????tag_name??????tag_id????t_ds_process_to_tags??????tag_id??????process_id????t_ds_process_definition??????process_id ???????????????????????????????????????????????? ?????? ##?????????? t_ds_process_definition id????????????name??????????????version???????? t_ds_process_to_tags id????????????tag_name??????id??process_id????????id?? ##???? 1 ??????????????t_ds_process_to_tags????????tag_name????????process_id,???????????????????????? ??????????????t_ds_process_definiton_tags??tag_name ??????????????t_ds_process_definiton_tags??tag_name???? ##???? 2 ??????????process_id??????????tag_name????t_ds_process_to_tags?????????????? ##????3 ??t_ds_process_definiton_tags????tag_name??????????process_id????t_ds_process_definition????process_id ??????????????????????????????????????????tag_name??????????????????????????????????????????????
