I have a database with multiple tables. One table is called "users". An example of the data is
0 John Black
1 Joe Bloggs
2 Jane Doe
If I perform a delete on row where id = 1
the data becomes:
0 John Black
2 Jane Doe
What SQL would I write to alter the further records to decrement the ID, so that the data becomes:
0 John Black
1 Jane Doe
Note: There are other tables with related data so e.g employee details may have address and phone number linked via the ID column, but I assume this would also change, as ON UPDATE
is set to "cascade"