How to use WHERE NOT EXISTS query to avoid duplicate entry using $wpdb to save in custom table?

WHERE NOT IN is what you need.

$sql = “INSERT INTO trip_rate (id, trip, rating, r_name, email, title, review)
SELECT ”, ‘$trip’, ‘$rating’, ‘$name’, ‘$email’, ‘$title’, ‘$review’
WHERE (trip_rate.email)
NOT IN (
SELECT email FROM trip_rate WHERE email=”$email” AND trip=’$trip’)”;