Compute necessary insertions, deletions, and new table hashes for updating the database to contain $newData for the subject with ID $sid. Insertions and deletions are returned in as an array mapping table names to arrays of table rows. Each row is an array mapping column names to values as usual. The table hashes are returned as an array mapping table names to hash values.
It is ensured that table names (keys) in the returned insert data are exaclty the same as the table names (keys) in the delete data, even if one of them maps to an empty array (no changes). If a table needs neither insertions nor deletions, then it will not be mentioned as a key anywhere.
The given database is only needed for reading the data that is related assigned to sid.