TRENDING TOPICS

×

NOT NULL Constraint

By default, a column can hold NULL values.

The NOT NULL Constraint used to makes sure that a column does not hold NULL value.

SQL NOT NULL - CREATE TABLE

The following SQL Query ensures that the "ID", "FULL_NAME", and "COUNTRY" columns will NOT accept NULL values when the "STUDENTS" table is created:

CREATE TABLE STUDENTS (
  ID INT   NOT NULL,
  FULL_NAME VARCHAR (200)   NOT NULL,
  ADDRESS VARCHAR (200),
  CITY VARCHAR (200),
  COUNTRY VARCHAR (200)   NOT NULL
  PRIMARY KEY (ID)
);

SQL NOT NULL - ALTER TABLE

ALTER TABLE STUDENTS
MODIFY ADDRESS VARCHAR (200)   NOT NULL;

Advertise With Us

We offer sponsored posts and guest posts with do-follow links, back-links, and other advertising services, To advertise email us at "advertise@gdatamart.com"

© 2021 GDATAMART.COM (All Rights Reserved)