Can someone tell me if there is an operation/command that will allow me to pull a sample from a group of data? For example, I might say, if user id is populated >= 3000 return a sample of 50. Or if population is <= 500 return a sample of 5.

Is this something SQL is capable of?

Would really appreciate any help I can get.