I have a table in mysql of name Contracts who has the sig. structure:
----------------------
|id|nombre |fecha |
----------------------
|1 |Emp1 |2015-02-12|
-----------------------
|2 |Emp2 |2016-02-11|
-----------------------
Every time I create a contract, it creates a database with the id of the created contract, example: NombreBD_1
.
What I am looking for is that every time I delete a contract I delete the database that has the id of this, I have researched but I do not understand very well how the triggers work in mysql , I guess it's the best way to do it.