fmt code and add sql