For example , If we want to calculate the average income of American data scientist , all American data scientists will be determine the population in this case,
Here, Walter surveys all students in his math class and finds that 4 prefer tomatoes, 14 prefer carrots, and 9 prefer cucumbers.
Population = All students in his School
Sample = Students in his class.
No, the sample is not a representative sample, it is the convenience sample.
It can be possible that his class has influence of him or students of other classes may like exactly different ingredients for salad like sprouts, fruit etc.