Comparing distribution of sample proportions to population proportion

I'm trying to find out whether there is a statistical method for comparing a distribution of sample proportions to a distribution of population proportions. For example if I have only two groups, A and B in a sample, and the proportions of people in A and B in that sample compared to the proportions of people in A and B in the population, then I could perform a one-proportion z-test for either A or B and it would not make a difference, as the z score would be the same. However, I am trying to find out if there is any way to do the same thing if I had multiple groups: A, B, C, D, and E. Is there a specific test for this that would make my life easy? Or would the best option be to look at only the sample category where the difference from the population proportion is the greatest and run a z test on that? Help would be much appreciated.
**EDIT: I am looking for a test that I could easily write in SQL, which I could do with a one-proportion Z-test