S
saurabh
Hi All,
I want to store the processed salary information in the data
base. My requirement is as follows:
1.For each location for an employee , I have to pay/deduct different
components (at least 38 )which differ from person to person.
2.Each component is mapped to component table which contains the
component Id.
I may have 2 options
Option 1: Store data in traditional RDBMS system with different rows
for different components like
Emp No, Location ID, Component Id, Amount.
44, LONDON, 1, 5000
44, LONDON 2, 6000
Drawback: will result in no of obselete, non usable columns. Will
result in multiple selects.
Option 2:Storing data in one column for each employee in a location
Emp No,Location Id,Component ID1,Amount 1,componentID2,Amount 2
44, LONDON, 1 5000 2 6000
Advantage: this SAP like table structure can store dynamic data. Will
result in 1 select per employee and location
Problem: In 2 option there is difficulty in inserting and selecting
data.
Please suggest me unique and performance based best way of inserting
and selecting data in Option 2
Thanks and Regards,
Saurabh
I want to store the processed salary information in the data
base. My requirement is as follows:
1.For each location for an employee , I have to pay/deduct different
components (at least 38 )which differ from person to person.
2.Each component is mapped to component table which contains the
component Id.
I may have 2 options
Option 1: Store data in traditional RDBMS system with different rows
for different components like
Emp No, Location ID, Component Id, Amount.
44, LONDON, 1, 5000
44, LONDON 2, 6000
Drawback: will result in no of obselete, non usable columns. Will
result in multiple selects.
Option 2:Storing data in one column for each employee in a location
Emp No,Location Id,Component ID1,Amount 1,componentID2,Amount 2
44, LONDON, 1 5000 2 6000
Advantage: this SAP like table structure can store dynamic data. Will
result in 1 select per employee and location
Problem: In 2 option there is difficulty in inserting and selecting
data.
Please suggest me unique and performance based best way of inserting
and selecting data in Option 2
Thanks and Regards,
Saurabh