This is a pretty important topic that you will want to gain some expertise in.
In mysql you can create stored procedures.
https://www.w3resource.com/mysql/mysql-procedure.php
This will allow you to do much more powerful data manipulation than you can do
with simple queries.
SQL only provides for updating a row or rows with one set of values. Assuming
that you're revising your array with different values per row, there's no way
to do this except to iterate the array and do an Update action per row.
Inserting is a different situation, since INSERT's VALUES clause