NOT NULL constraint in sql server

NOT NULL- This constraint is responsible for a column to confirm that a column cannot have a null value.

Example-

Following we create new table PRODUCT and add six columns where ID, SKU, TITLE, PRICE specify not to accept NULLs.


CREATE TABLE PRODUCT
(
  ID INT NOT NULL,
  SKU VARCHAR(20) NOT NULL,
  TITLE VARCHAR(200) NOT NULL,
  PRICE MONEY NOT NULL,
  DESCRIPTION VARCHAR(2000)  NULL,
  DTCREATE DATETIME NULL
)


If PRODUCT table already created, then to add a NOT NULL constraint to the SKU column, we use the following query.


ALTER TABLE PRODUCT ALTER COLUMN SKU  VARCHAR (20) NOT NULL

PostgreSQL-Query: Sort result set by specific field values using ORDER BY Clause

Problem: Suppose we have a book_inventory table which has some columns such as id, isbn, title, author, publisher, publish_date, etc.. whe...