After searching I can't figure out what I need to do in ALTER TABLE genres
to change the col id
to genre_id
any ideas?
To rename a column in MySQL the following syntax is used: ALTER TABLE table_name RENAME COLUMN old_column_name TO new_column_name; This command is used to change the name of a column to a new column name.
September 30, 2019. This typically happens when you retrieve data from multiple tables with the same column name using a JOIN statement. You might receive an error like this: ERROR: Column 'col_name' in field list is ambiguous.
1. Renaming a column name using the ALTER keyword. Line 2: RENAME COLUMN OldColumnName TO NewColumnName; For Example: Write a query to rename the column name “SID” to “StudentsID”.
alter table genres change id genre_id int(10) auto_increment;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With