CREATE INDEX my_table_my_column_idx on my_table(my_column);
ALTER TABLE my_table MODIFY my_column DEFAULT 1;
ALTER TABLE my_table DROP CONSTRAINT my_table_uk1;
ALTER TABLE "MYTABLE" ADD CONSTRAINT "MYTABLEFK1" FOREIGN KEY ("MYCOLUMN") REFERENCES "OTHERTABLE" ("OTHERCOLUMN") ENABLE;
ALTER TABLE my_table ADD new_column NUMBER;
ALTER TABLE my_table DROP COLUMN my_column;
How do I add a comment to a table in Oracle database?
If your table is named my_oracle_table, you would execute the following command.
COMMENT ON TABLE my_oracle_table IS 'This is a special table.';
How do I add a comment to a column in Oracle database?
If your table is named my_oracle_table and your column is named my_oracle_column, you would execute the following command.
COMMENT ON COLUMN my_oracle_table.my_oracle_column IS 'This is a special column.';
Adding a comment on a column, or any other database schema object, can help you maintain your system. It allows you to give verbose descriptions for objects where the object name itself is not enough. For example, if you had a column called RoleType it would be nice to know which values are acceptable for that column. So your description could say “RoleType accepts the following user role strings: SysAdmin, Admin, User”.
How do I know which version of Oracle I’m running?
Execute the following command.
COL PRODUCT FORMAT A35 COL VERSION FORMAT A15 COL STATUS FORMAT A15 SELECT * FROM PRODUCT_COMPONENT_VERSION;