AdventureWorks Database: Find marketing Assistants with more than 41 vacation hours

SQL Query - AdventureWorks: Exercise-142 with Solution

142. From the following table write a query in SQL to select employees who have the title of Marketing Assistant and more than 41 vacation hours.

Sample table: HumanResources.Employee

Click to view Full table

Sample Solution:

SELECT  BusinessEntityID, LoginID, JobTitle, VacationHours   
FROM HumanResources.Employee  
WHERE JobTitle = 'Marketing Assistant'  
AND VacationHours > 41 ;

Sample Output:

businessentityid|loginid               |jobtitle           |vacationhours|
              17|adventure-works\kevin0|Marketing Assistant|           42|
              19|adventure-works\mary2 |Marketing Assistant|           43|

SQL AdventureWorks Editor:

Practice Online

Contribute your code and comments through Disqus.

Previous: Find unit price, ID number, and modulus of division.
Next: Find all rows outside a specified range of rate.

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.