Mysql rename column3/11/2024 ![]() The syntax to perform the above operation can be stated as follows: ALTER TABLE table_name RENAME COLUMN old_name TO new_name One of the most basic methods to change the name of a column in MySQL is to use the RENAME COLUMN clause. ![]() Renaming the Column Using the RENAME Statement Let’s aim at renaming the stu_firstName column to simply firstName. The line of code above would give the following output. To view the entries in the data, we use the following code. The above query creates a table along with rows with student first name and last name in it. INSERT INTO student_details(stu_id,stu_firstName,stu_lastName) insert rows to the table student_details Here we create a table, student_details, along with a few rows in it. However, before we begin, we need to create a dummy dataset to work with.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |