Now to calculate the fee for each customer based on number of bulbs
That kind of tells that there must be a column that stores the usage of electricity, if yes, then please mention it.
Now, coming to your query on which method to use:
It depends on various factors:
-> which type of file you use in you COBOL code to bill the customers. Do the concerned fields from a part of some key if you are to use VSAM files ?
-> In case you are going to use DB2 (and not the unloaded file) - then is there an INDEX on the 2-3 columns in the picture? if yes, then It will speed up the processing. If you let DB2 do the work, then make sure you select only the required columns in your SQL to do the calculations as it will keep I/O costs to a minimum. Use a cursor to make sure you process each customer's record.