ALTER TABLE Statement Warning This conversion may result in alteration of data. For example, if you shorten a string column, values may be truncated. To prevent the operation from succeeding if conversions to the new data type would result in loss of data, enable strict SQL mode before using  ALTER TABLE  (see Section 5.1.11, “Server SQL Modes” ). If you use  CHANGE  or  MODIFY  to shorten a column for which an index exists on the column, and the resulting column length is less than the index length, MySQL shortens the index automatically. For columns renamed by  CHANGE  or  RENAME COLUMN , MySQL automatically renames these references to the renamed column: For columns renamed by  CHANGE  or  RENAME COLUMN , MySQL does not automatically rename these references to the renamed column: To reorder columns within a table, use  FIRST  and  AFTER  in  CHANGE  or  MODIFY  operations. ALTER ... SET DEFAULT  or  ALTER ... DROP DEFAULT  specify a new default value for a column or remove the old default value, respectively. If the old default is removed and the column can be  NULL , the new default is  NULL . If the column cannot be  NULL , MySQL assigns a default value as described in Section 11.6, “Data Type Default Values” . As of MySQL 8.0.23,  ALTER ... SET VISIBLE  and  ALTER ... SET INVISIBLE  enable column visibility to be changed. See Section 13.1.20.10, “Invisible Columns” . DROP PRIMARY KEY  drops the primary key. If there is no primary key, an error occurs. For information about the performance characteristics of primary keys, especially for  InnoDB  tables, see Section 8.3.2, “Primary Key Optimization” . If the  sql_require_primary_key  system variable is enabled, attempting to drop a primary key produces an error. If you add a  UNIQUE INDEX  or  PRIMARY KEY  to a table, MySQL stores it before any nonunique index to permit detection of duplicate keys as early as possible. DROP INDEX  removes an index. This is a MySQL extension to standard SQL. See Section 13.1.27, “DROP INDEX Statement” . To determine index names, use  SHOW INDEX FROM  tbl_name . Some storage engines permit you to specify an index type when creating an index. The syntax for the index_type  specifier is  USING  type_name . For details about  USING , see Section 13.1.15, “CREATE INDEX Statement” . The preferred position is after the column list. Expect support for use of the option before the column list to be removed in a future MySQL release. index_option  values specify additional options for an index.  USING  is one such option. For details about permissible  index_option  values, see Section 13.1.15, “CREATE INDEX Statement” . 2492 Primary Keys and Indexes •Views and stored programs that refer to the renamed column. You must manually alter the definition of these objects to refer to the new column name. •Generated column and partition expressions that refer to the renamed column. You must use  CHANGE  to redefine such expressions in the same  ALTER TABLE  statement as the one that renames the column. •Foreign keys that refer to the old column. •Indexes that refer to the old column, including invisible indexes and disabled  MyISAM  indexes.