Table creation with Primary Key
suggest changeCREATE 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.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents