def data_already_loaded(table_name, collection_date, connection):
    """
    Determines if data corresponding to the collection date was already
    loaded in the database.

    :param str table_name: name of the table
    :param str collection_date: date of web scraping
    :param connection: psycopg2 connection object
    :return bool: True if rows having the specified collection date are
                  present in the database
    """
    statement = f"""
        SELECT EXISTS (
            SELECT 1 FROM {table_name}
            WHERE collection_date = %s
        );"""
    cur = connection.cursor()
    cur.execute(statement, (collection_date,))
    return cur.fetchone()[0]
