Use SQL reasonably