Added sql for retrieving records
Added clear for the tables when choosing index 0 in the dropdowns