Nice knowing you, I wish i could one day write such codes on my own. It would require a lot of dedication and willingness.
Hope with your codes and explanation i will try to understand and apply in my future projects of similar nature.
Run would be a good name.
Looking at this there are 2 blocks of information. Without knowing your process I called a block a "Run". Do you have better name for it?
The first "run" is 1, 10, 1000 and its reasons
The second "run" is 1, 50, 1000 and its reasons
1,10,1000 or 1,50,1000 can be anything.
I would put each "reason" in its own table and relate it back to the "run". Unfortunately, a "run" does not seem to have a unique id. But these two runs occur under
Reference: 1234567890123 Reference Name: PQR
If reference numbers do not repeat then that makes a good natural key. The first "run" 1, 10, 1000 would get a primary key of 1234567890123PQR_1 and the second run would get the PK 1234567890123PQR_2. All of the reasons would get this run ID as a foreign key to relate back to the run.
There will be repetitive Reference & Reference Name. in the data.
Each of them can have anything from
1, 10, 1000 denotes:
1 as running number starting with 1, 2, 3....
10 is the reference nos which can be anything from 1 to 999999 and
1000 is the amount again can be anything.
Will the above information help you in building the code