Is there a way to create a table with a field that defaults to the current date value instead of a timestamp?
CREATE TABLE animal (
animal_id INT AUTO_INCREMENT PRIMARY KEY,
animal_name VARCHAR(50) NOT NULL,
animal_type VARCHAR(50) NOT NULL,
species VARCHAR(50) NOT NULL,
gender VARCHAR(10),
entry_date DATE DEFAULT CURRENT_DATE,
status VARCHAR(10) DEFAULT 'present' NOT NULL
);
I have tried using CURRENT_DATE but i got this error: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CURRENT_DATE, status VARCHAR(10) DEFAULT 'present' NOT NULL )' at line 7