--Add primary key ALTER TABLE cities add PRIMARY key (name);
--Add the foreign key ALTER TABLE weather add FOREIGN key (city) REFERENCES cities (name) on the update CASCADE on DELETE CASCADE;
On UPDATE cascade: The referenced row is updated automatically when the referenced row is updated;
On update restrict: The referenced row is prohibited from being updated;
On DELETE cascade: When the referenced row is deleted, the reference row is also deleted;
On dellete restrict: The referenced row is forbidden to delete;
--Delete foreign keys
ALTER TABLE orders drop constraint Orders_goods_id_fkey;
--Add UNIQUE constraints
ALTER TABLE goods add constraint Unique_goods_sid unique (SID);
--Delete default values
ALTER TABLE goods ALTER COLUMN SID drop default;
--Modify the data type of the field
ALTER TABLE goods ALTER COLUMN SID type character varying;
--Rename Fields
ALTER TABLE goods rename column SID to SSID;
Primary foreign key for PostgreSQL