CBSE Class 12 Informatics Practices Question 66 of 81

MySQL Functions — Question 17

Back to all questions
17
Question

Question 10

Consider two fields B_date, which stores the birth date and J_date, which stores the joining date of an employee. Write commands to find out and display the approximate age of an employee as on today.

Answer
SELECT (YEAR(CURDATE()) - YEAR(B_DATE)) AS AGE FROM EMPLOYEE;