Q. Add a constraint (NN-Grade) in table Empl that declares column Grade not null.


Table --



Answer =

Alter table Empl add column grade int(1) Not null ;

7 Comments

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

  1. Can we do like this??

    alter table Empl add Constraint NN-Grade (Grade Not Null);

    ReplyDelete
  2. No modify is required statement.

    ReplyDelete
  3. Question has demanded for adding a constraint . So "ADD constraint nngrade CHECK(grade IS NOT NULL)" Should be the correct query.. Isn't it?

    ReplyDelete
  4. can we write this as

    ALTER TABLE Empl
    modify Grade
    ADD constraint NN-Grade check(Grade IS NOT NULL);

    ReplyDelete

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post