def execute_query(conn, query):
    """
    Executes a query.
    :param conn: Connection to database
    :param query: SQL query to execute
    :return: Result of query
    """
    cur = conn.cursor()
    cur.execute(query)
    fetched = cur.fetchone()
    cur.close()
    return fetched
