Loop Insert to table

My Hosting is Heroku, Server model is NodeJS, Database is Postgresql, I have two tables, player table and ticket table. Now Player table have a column named Tickets with data type of integer, what i want to do is depending on the number of the tickets in the player table it will insert a data on the ticket table for example player a have 6 ticket now it should be on the ticket table it will populate the first 6 with Player A name

how will I do that?

Community Page
Last updated: