I am trying to add a NOT NULL constraint by the name 'NN_Grade' in existing column 'grade'. but not able to do getting error -
My question is -
Add a constraint (NN_Grade) in table Empl that declares column Grade NOT NULL.
My Command which I tried-
ALTER TABLE students ADD CONSTRAINT NN_Grade NOT NULL(adm_no);
Error -
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 'NOT NULL(adm_no)' at line 1
Need guidance
ALTER TABLE students ADD CONSTRAINT NN_Grade CHECK (adm_no IS NOT NULL);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With