added the final file handling the sql