Child records under the parent record in SQLite
The following query creates these rows:


mstr_id    party      billamount  sort1  sort2
 1         abc           500        1     -1     from bill_master
 2         def           600        2     -1
           lunch box     100        1      1     from bill_details
           water bag     400        1      2
           pencil boxes  300        2      1
           a4 papers     100        2      2
           staple pins   200        2      3


These sort* values cause the rows to be ordered correctly after sorting.

SELECT id AS mstr_id,
       party,
       bill_amount AS billamount,
       id AS sort1,
       -1 AS sort2
FROM BILL_MASTER
UNION_ALL
SELECT NULL,
       perticular,
       amount,
       mstr_id,
       sr_no
FROM BILL_DETAILS
ORDER BY sort1,
         sort2