PrepZone Logo
PrepZone
Back to Database

Database · Medium

Calculate employee tenure using date arithmetic.

DatabaseSQL QueriesSenior

Answer preview

Use AGE() to get a calendar-aware interval, then pull the years and months out with EXTRACT — never subtract dates and divide by 365.…