OBJECTIVE:- Program
to ALTER table.
SOFTWARE
USED: Oracle
SQL
THEORY:-
ALTER:- It is a DDL
command.
The ALTER TABLE statement is used to add, delete, rename or
modify columns in an existing table.
SOURCE
CODE ( IF INCLUDED )
(1) ADD:-
SYNTAX:-
ALTER table table_name
ADD new_column Data_type(Size);
QUERY: -To add a column subject in table stud_itsengg.
OUTPUT:-
(2
) DROP:-
SYNTAX:-
ALTER table table_name
DROP column column_name;
QUERY:- To drop the column marks in table stud_itsengg.
OUTPUT:-
(3) MODIFY:-
SYNTAX:-
ALTER table table_name
MODIFY
column_name new_datatype (New Size);
QUERY:- To modify the column
subject in table stud_itsengg.
OUTPUT:-
(4)
RENAME:-
SYNTAX:-
ALTER table table_name
RENAME column
column_name to new_column_name;
QUERY:- To rename the
column subject to subject_marks in table stud_itsengg.
OUTPUT:-
CONCLUSION:-
We learned about writing
the program to ALTER table..