Unique and not null column
postgres=#
postgres=# CREATE TABLE products (
postgres(# product_no integer UNIQUE NOT NULL,
postgres(# name text,
postgres(# price numeric
postgres(# );
NOTICE: CREATE TABLE / UNIQUE will create implicit index "products_product_no_key" for table "products"
CREATE TABLE
postgres=#
postgres=# drop table products;
DROP TABLE
postgres=#
postgres=#
Related examples in the same category