-- Common code audit checks
SELECT code_group, code_value
FROM common_codes
WHERE code_value LIKE '% %';

SELECT code_group, COUNT(*)
FROM common_codes
GROUP BY code_group
ORDER BY code_group;

SELECT DISTINCT c.service_type
FROM clients c
LEFT JOIN common_codes cc
  ON cc.code_group = 'CLIENT_SERVICE_TYPE'
 AND cc.code_value = c.service_type
WHERE c.service_type IS NOT NULL
  AND cc.code_value IS NULL;
