For a test tomorrow we're told to name our constraints I know it's possible to create a constraint when you use ALTER TABLE but can you add a name to a not null constraint when you CREATE TABLE?
f.e.
CREATE TABLE test (
test1 VARCHAR
CONSTRAINT nn_test1 NOT NULL (test1)
)
I get an error when trying to run this query. Am I writing it wrong?
The error I get is
ERROR: syntax error at or near "NOT" LINE 3: CONSTRAINT nn_test1 NOT NULL (test1)) ^ SQL state: 42601 Character: 56