Energy Aspects interview question

What is the most complex logic you have solved in respect to RDBMS?