Table creation with Primary Key

suggest change
CREATE TABLE person (
    person_id BIGINT NOT NULL,
    last_name VARCHAR(255) NOT NULL,
    first_name VARCHAR(255),
    address VARCHAR(255),
    city VARCHAR(255),
    PRIMARY KEY (person_id)
);

Alternatively, you can place the PRIMARY KEY constraint directly in the column definition:

CREATE TABLE person (
    person_id BIGINT NOT NULL PRIMARY KEY,
    last_name VARCHAR(255) NOT NULL,
    first_name VARCHAR(255),
    address VARCHAR(255),
    city VARCHAR(255)
);

It is recommended that you use lower-case names for the table and for all the columns. If you create a table with a quoted mixed-case name such as "Person", you must quote that name in every query. Unquoted identifiers are folded to lower case.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents