import sqlite3


def query_db(db_file, query):
    """
    This function runs the query on the .db file by spinning up a sqlite connection.
    :param query:
    :param db_file: .db file
    :return: Connection to db, Cursor to executed query
    """
    con = sqlite3.connect(db_file)
    cur = con.cursor()
    return con, cur.execute(query)