When attempting to calculate age of teacher I'm receiving an error 'CURDATE' is not a recognized built-in function name., I'm new to SQL and learning on my own so i can't quite figure out where I'm going wrong with this query. any hints would be appreciated.
SELECT t.TeacherID, t.TeacherFName, t.TeacherLName,DOB
FROM TEACHER t INNER JOIN CLASS c
ON t.TeacherID = c.TeacherID
WHERE TIMESTAMPDIFF(YEAR, DOB, CURDATE())>=60;
-Question example
A program coordinator is interested in knowing the age of their teachers who teach all classes, and to find this info he needs the teacherID, teachers first and last name
-Table below
CREATE TABLE TEACHER (
teacherNo int primary key,
teacherFName varchar (25) NOT NULL,
teacherLName varchar (25) NOT NULL,
teacherPhone nvarchar (10),
DOB datetime,
Salary money
)
CREATE TABLE CLASS (
classNo int primary key,
classDay date,
teacherID int,
NoOfStudents int,
)