def table_exists(db_conn, table_name):
    """
    Checks if a table matching table_name exist in the database
    """
    cur = db_conn.cursor()
    tn = (table_name,)
    cur.execute("select name from sqlite_master where type='table' and name=?", tn)
    result = cur.fetchone()
    if(result):
        return True
    else:
        return False