AdventureWorks Database: Find number of unique titles that employees can hold

SQL Query - AdventureWorks: Exercise-90 with Solution

90. From the following table write a query in SQL to return the number of different titles that employees can hold.

Sample table: HumanResources.Employee

Click to view Full table

Sample Solution:

SELECT COUNT(DISTINCT jobTitle) as "Number of Jobtitles" 
FROM HumanResources.Employee;

Sample Output:

Number of Jobtitles|

SQL AdventureWorks Editor:

Practice Online

Contribute your code and comments through Disqus.

Previous: Compute moving average of yearly sales for all sales territories.
Next: Find the total number of employees.

What is the difficulty level of this exercise?

Test your Programming skills with w3resource's quiz.

Follow us on Facebook and Twitter for latest update.

SQL: Tips of the Day

How to select date without time in SQL?

select convert(varchar(10), '2011-02-25 21:17:33.933', 120)

120 here tells the convert function that we pass the input date in the following format: yyyy-mm-dd hh:mi:ss.

Ref : https://bit.ly/3SSoTvQ