Working on the SQL Querys to get results