Add Unique - MySQL Command

106 19
Definition: When you are altering a table to add in another colum you can use Add Unique. This will add in a new column, and make sure that it's not a duplicate of any of the already existing columns. It is written as: alter table your_table add unique (column_name)

Also Known As: Add Unique Column

Examples:

alter table people add unique (eye_color) This code would add a new column, eye_color, to the table called people - if that column didn't already exist.
Subscribe to our newsletter
Sign up here to get the latest news, updates and special offers delivered directly to your inbox.
You can unsubscribe at any time

Leave A Reply

Your email address will not be published.