One SQL insert statement into two tables

What's the best way to insert data into two tables (I'm using GUI mode).
I guess I should say, insert data as well as update data.
For instance i have a "maintenance_requests" table and a "tasks" table.

This is being INSERTED into the "tasks" table

{
request_id: {{ maintenanceRequestsTable.selectedRow.data.request_id}},
assigned_to: {{select30.value}},
job_type: {{select33.value}},
task_status: 1
}

But I'd also like to UPDATE the 'status' column of my "maintenance_request" table at the same time.

Basically, when i insert a new record into my "tasks" table, the "maintenance_request" table it's tied to will get a status updated as well.

I have a status column for both tables.

Something like this:

INSERT this into TASKS
{
request_id: {{ maintenanceRequestsTable.selectedRow.data.request_id}},
assigned_to: {{select30.value}},
job_type: {{select33.value}},
task_status: 1
}
UPDATE the selected request_id row in MAINTENANCE_REQUESTS with
status: 1

Hey @dru_nasty!

Would it work to write two separate queries and have one trigger the other with a success handler?

Yes it would, and it worked, thank you!
I just stacked my success queries in the order i needed. The Run script is just a function to close a modal. Would there be any performance issues with chaining these together like this? (They're pretty basic queries.)

That looks fine! Just be aware that each handler will run simultaneously. If you want it to be sequential you can either add them as success handlers for each other or call them at the top of your script using await:

await updateStatus.trigger();
await getAllRequests.trigger();
await getDisplatched.trigger();
/*
  the rest of your script
*/

This was really helpful to finalize the query order. Thanks!