gsk
gsk

Reputation: 2379

better database design to save large employee details in mysql

I am developing HR&Payroll system. I have to store employee details,employee details contains following data,

I have created employee table and I allocated basic details and personal information. enter image description here

My doubt is,for other details such as passport,visa,labor etc. should i create separate table for each item or include employees tables itself? Or is there any other better method?

Upvotes: 0

Views: 770

Answers (2)

James Anderson
James Anderson

Reputation: 27478

A lot of the information in your table is liable to change over time (work_sites, grades_id etc.) you may consider keeping these in a separate table keyed by dates, as you may need to answer ("Where was bill working last January?") type of questions.

I would also check your security/privacy requirements, depending on how strict they are it may be a good idea to store passport numbers etc. in a separate more highly restricted table.

Upvotes: 1

Swastik Padhi
Swastik Padhi

Reputation: 1909

Keeping everything in the same table will make data entry and indexing easier. However, if you plan to use multiple tables then you can use id as a common attribute among the various tables. Please note that while grouping of information into multiple tables might seem an organized way, it increases the information retrieval complexity. More or less, everything depends upon the objectives of the project and usage patterns.

Upvotes: 1

Related Questions