COUNT function with a DISTINCT keyword can be used to count the distinct values in SQL. Suppose you have to count the number of distinct employees in the Employee table:
SELECT COUNT (DISTINCT e_id) as Employee
FROM EMPLOYEE;
In order to learn SQL from top experts, I recommend this SQL training course by Intellipaat that provides instructor-led training, and also certification.