I have database tables that look like this : Table 1 : transaction
id|buyer_id|transaction_date ---------------------------- 1 | 1 |2020-01-01 2 | 4