Share
Explore BrainMass

Queries

Using the attached database WK5_DB_ACCESS2000.mdb write SQL queries to answer the following questions.

7. Show the employee (by name) that is shortest.

8. Determine the average number of years that the average employee has been working.

Hint: here's how to get started:

SELECT (Now()-[HIRE_DATE])/365 AS YEARS
FROM EMPLOYEES;

9. Count how many employees have blue eyes and are married.

10. Write the SQL to answer this question: which employees have the same letter starting their first name as their last name (every employee actually meets this criteria, but pretend you didn't know that and write the SQL to figure this out.)

Hint: the Left() function will be helpful. For example: SELECT Left([L_NAME],1)

11. Answer this question using SQL: show which eye color is most dominant in the employees (its Brown, with a count of 4 employees) - in other words, show the eye colors by count but only show the max value of count (4).

Attachments

$2.19