The problem:
- I have a table with rows, nothing special about it
- When a database user removes a row, it should increment a number
- A database user is only allowed to remove 3 rows max in the table
- A database administrator should be able to add more "remove tokens" to a database user
I know I should have a BEFORE DELETE
trigger to see if the user can remove a row, and an AFTER DELETE
trigger to increase the number of rows deleted by the user.
How should I store the info about how many rows a database user has removed from that specific table, and how do I allow a database admin to add more "remove tokens" to the user.
I thought of creating a table to store this, but I wonder if there are different ways to do it without a table? This might sound like a weird question, but I'm just trying to figure out how more advanced stuff works.