Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
Function COUNT
Function AVG
Functions SUM, MAX, MIN
Review

Instruction

That's right! The keyword DISTINCT can, of course, be used in queries that apply GROUP BY. Take a look:

SELECT
  client_id,
  COUNT(DISTINCT translator_id)
FROM project
GROUP BY client_id;

The above query will show each client together with the number of translators who have ever worked on at least one project for that client.

Exercise

Let's check the statistics the other way round. For each translator in table project, show their ID (as translator_id) and the number of clients they have worked for. Name the second column clients_no.