Skip to content

Instantly share code, notes, and snippets.

@Martin91
Last active January 2, 2016 06:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Martin91/8265541 to your computer and use it in GitHub Desktop.
Save Martin91/8265541 to your computer and use it in GitHub Desktop.
Mysql sql statements

If not any statement, all the following commands running in the mysql console or a query string.

# Alter table syntax: http://dev.mysql.com/doc/refman/5.6/en/alter-table.html
#   ALTER [IGNORE] TABLE tbl_name
#     [alter_specification [, alter_specification] ...]
#     [partition_options]
ALTER TABLE users ADD username CHAR(30), ADD email CHAR(30);

# Even more, if the name of your column includes a blank space, you should use a pair of ` symbol:
ALTER TABLE users ADD `home address` VARCHAR(255);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment