HCLTech interview question

Query optimization, stored procedure , function rank function, in banking traction how trigger works give me senerio.