A NOT NULL constraint is a non-null constraint that often adds a non-null constraint when creating a table to guarantee that the field must enter a value
(1) Add NOT NULL constraint when creating table
Grammar:
CREATE Table table name (field type not NULL ...);
Instance:
CREATE TABLE Managerinfo (ManagerID VARCHAR2 (Ten), LOGINNAME VARCHAR2 (Ten) not Null,password VARCHAR2 (Ten) not null,name VARCHAR2 (+), TEL VARCHAR2 (11));
(2) Adding a non-empty constraint using alter
Grammar:
ALTER table name modify column not NULL;
Instance:
--use ALTER to add a non-empty constraint to the Name column
ALTER TABLE managerinfo MODIFY NAME not NULL;
(3) non-null constraint deletion
Simply change the column to null using the non-empty modify
Grammar:
ALTER Table name Modify column NULL;
Instance:
--use ALTER to change the name to a null value
ALTER TABLE managerinfo MODIFY NAME NULL;
This article is from the "Loly_zhang" blog, make sure to keep this source http://lolyzhang.blog.51cto.com/10029387/1889863
Oracle Add, modify non-null constraints