Column Constraint Definition

Grammar Syntax

<column constraint definition> ::=
  [ <constraint name definition>  ] <column constraint>
  
<constraint name definition> ::=
  CONSTRAINT <constraint name>

<column constraint> ::=
    NOT NULL
  | <unique specification> 
  | <references specification> 
  | <check constraint definition> 
  
<unique specification> ::=
    UNIQUE
  | PRIMARY KEY
  
<references specification> ::=
  REFERENCES <referenced table and columns> 
      [ MATCH <match type>  ] [ <referential triggered action>  ]

<check constraint definition> ::=
     CHECK <left paren>  <search condition>  <right paren> 

Click here to go to the ANSI SQL Standard specification for this syntax.

Sample Source Patterns

Sample with COLUMN NAME CONSTRAINT NOT NULL

Snowflake Output Code

Sample with COLUMN NAME UNIQUE

Snowflake Output Code

Sample with COLUMN NAME PRIMARY KEY

Snowflake Output Code

Sample with COLUMN NAME REFERENCES

Snowflake Output Code

Sample with COLUMN NAME NOT NULL CHECK

Snowflake Output Code

Sample with CONSTRAINT NAME PRIMARY KEY

Snowflake Output Code

Sample with CONSTRAINT NAME UNIQUE

Snowflake Output Code

Sample with CONSTRAINT NAME FOREIGN KEY

Snowflake Output Code

Sample with CONSTRAINT NAME CHECK

Snowflake Output Code

  1. MSCEWI1073: Pending Functional Equivalence Review.

Last updated

Was this helpful?