Example 5.2.7 To add a new year column to the table ADVISING we use the directive:
alter table advising add year varchar2(4);
The entries of the new column year will have initially null values. Column types can be modified using the modify option. For instance, to increase the maximum length of the values of stno to 12 characters we write:
alter table advising modify stno varchar(12);
Column renaming is executed using the option rename column. Below we rename the column stno to studentno:
alter table advising rename column stno to studentno;
Finally, to drop the column year that we just added we write:
alter table advising drop column year;