Added return_sql method to fetch table rows.