SQL Statements

This section describes the syntax and meaning of each of MySQL's SQL statements. A statement will fail if you do not have the necessary privileges to perform it. For example, USE db_name fails if you have no permission to access the database db_name.

ALTER TABLE

ALTER [IGNORE] TABLE tbl_name
							action_list
						

ALTER TABLE allows you to rename tables or modify their structure. To use it, specify the table name tbl_name, then give the specifications for one or more actions to be performed on the table. The IGNORE keyword comes into play if duplicate values result in unique keys in the new table. Without IGNORE, the effect of the ALTER TABLE statement is cancelled. With IGNORE, the rows that duplicate values for unique keys are deleted. ...

Get MySQL now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.