Added filters to fetch and print relevant results

Added where clause usage in the queries to filter and print relevant
results from a SQLite database