MySQL database structure

1

Hello I'm having a hard time structuring my data in a database.

I have a table for exam procedures with id, exam name and value. But the problem is that a "procedure" can contain other procedures, and in that case the unit value of each procedure changes.

Example - Single Procedures -Radiography 10.00 -Photography 5.00 -Slide 15.00 -Model 50.00

Sample Procedures Group -Documentation A --Radiography 8.00 --Photos --Model 40.00

-Documentation B --Radiography 8.00 --Photographs 2.50 --Model 40.00

However, these documentation procedures need to reference the id of the single procedures.

Thank you

    
asked by anonymous 08.08.2016 / 16:12

1 answer

0

You could mount a schema like this:

Table: Procedures

id (auto-increment)  
procedimentos (Fotografia, Slide, etc)
valor (1.00, 2.00, etc)

Table: Procedure Group

id (auto-increment)
grupo (Documentação A, Documentação B)

Table: Group Procedures

id_procedimentos (id da tb procedimentos)
id_grupo (id da tb grupo)
valor (Inserir o valor diferenciado)

Looking for the Procedures-Group table you can get the individual or differentiated values, as well as being able to give GROUP BY to id_grupo to show your groups.

I hope I have helped.

    
08.08.2016 / 16:29