How to write some PLSQL statements in OS to perform some operations on entities.
Also, How to create entity triggers. 



Please clarify it a bit more what you want to achieve and why?

In any case, when creating your datamodel in outsystems completely, you are not able to have triggers.

you either create wrappers around the crud actioons, or do something with BPT(light).