write functional sql post