PL/SQL Alter Table

Oracle PL/SQL Alter Table

Alter Table Example:

ALTER TABLE offers
RENAME TO news_offers;
  
ALTER TABLE offers
ADD details varchar2(1000);
  
ALTER TABLE offers
MODIFY details varchar2(800);  
  
ALTER TABLE offers
DROP COLUMN details;   
  
ALTER TABLE offers
RENAME COLUMN amount to new_amount;  
alter table OFFERS
add constraint FK_CUSTOMER_ID foreign key (CUSTOMER_ID)
references CUSTOMERS (CUSTOMER_ID);

alter table OFFERS
add constraint FK_PRODUCT_ID foreign key (PRODUCT_ID)
references PRODUCTS (PRODUCT_ID);

alter table OFFERS
add constraint FK_USER_CODE foreign key (USER_CODE)
references USERS (USER_CODE);