master_rec keep records of all categories with their start and end range. Let us suppose for a certain task, for c1='DB' and c2='2', a sequence range is issued from 00-10 for coding purpose. Now the master_rec table is updated as

previous record - master-rec

c1 c2 numberrangefrom numberrangeto
DB 2 00 99

updated record - master_rec [after first transaction]

c1 c2 numberrangefrom numberrangeto
DB 2 11 89

let us suppose, second time for c1='DB' and c2='2', a sequence range is issued from 11-15 for coding purpose. Now the master_rec table is updated as

previous record - master_rec

c1 c2 numberrangefrom numberrangeto
DB 2 11 89

updated record - master_rec [after second transaction]

c1 c2 numberrangefrom numberrangeto
DB 2 15 84

And for transaction, a code need to be generated and stored in trans_rec table to uniqely identify each transaction.

then for each transaction record should be broken down to store like this in seq_detail_rec