I would like my orderedDate column (using the date type) to not allow null or 0000-00-00
I've set the orderedDate column as not null, but when using insert into
INSERT INTO Purchase(custName, price)
VALUES('Max Wong', 10.00)
Ordered date is 0000-00-00. I assume this is because it is the default value when no other value is given.
I've also tried
ALTER TABLE Purchase
ADD CHECK (orderedDate > '0000-00-00');
(also orderedDate > 0000-00-00 and orderedDate > 0)
And I read to try
SET mysql_mode = 'NO_ZERO_DATE'
But it didn't work.
I've seen a lot of php suggestions when looking online but I have to use sql.