I have a table X with a column enabled which has default value as 'T'. I need a trigger which can put value into the enabled column based on value present in another table Y which has a row called trusted with value 'Y'.
So everytime table X is inserted with values i want that the value of enabled should be updated based on value of table Y's row trusted.
If trusted = 'N' then set enable ='F' Else enabled = 'T'
Sorry for not providing any code. I am a bit confused about the strategy as of now.
Table X:
id username enable
-------------------
1 ab T
2 cd T
3 ef T
4 gh T
Table Y:
key value
-------------
trusted Y
tested N