Stu_Table
+--------+----------+-----------+
| Stu_Id | Stu_Name | Stu_Class |
+--------+----------+-----------+
| 1 | Komal | 10 |
| 2 | Ajay | 10 |
| 3 | Rakesh | 10 |
| 4 | Bhanu | 10 |
| 5 | Santosh | 10 |
+--------+----------+-----------+
Syntax
The ALTER table statement in SQL is used to modify the table 'Stu_Table' and change keyword change the name of field to new name of field. The syntax used for Alter Table is given below:
Alter table table_name change old_column_name new_column_name type size
Query
The Alter Table alter the table 'Stu_Table'. The change keyword change the column name of Stu_Id to Id in table 'Stu_Table'.
Alter table Stu_Table change Stu_Id Id varchar(10)
Stu_Table
+--------+----------+-----------+
| Id | Stu_Name | Stu_Class |
+--------+----------+-----------+
| 1 | Komal | 10 |
| 2 | Ajay | 10 |
| 3 | Rakesh | 10 |
| 4 | Bhanu | 10 |
| 5 | Santosh | 10 |
+--------+----------+-----------+
Gow.Net, if this helps please login to Mark As Answer. | Alert Moderator