DBMS or Software for privacy sensitive data
Two possible options:

Have the database administer set limits on SQL queries that only allow result tables with aggregated results with minimum of N people to be returned.

Apply differential privacy which a query result cannot be used to infer much about any single individual, and therefore provides privacy.