For example, to modify the field username in the table user to name:
ALTER TABLE User change username name VARCHAR (20);
Other Modifications to table field information:
1. Add Field: Add field to table user password after ID;
ALTER TABLE user ADD COLUMN password VARCHAR (+) not NULL after ID;
2. Add PRIMARY key: Add ID to table user as primary key
ALTER TABLE user ADD PRIMARY KEY (ID);
3, when the primary key is added, if the primary key is an int type, in order to facilitate it to self-growth
ALTER TABLE user change ID ID INT (TEN) not NULL auto_increment;
4. Delete field: Delete table user's password field:
ALTER TABLE user DROP password;
No matter what the industry, as long as you do two things good enough, one is your professional, one is your character, professional decision of your existence, personality determines your network, the rest is to insist, with good professional and sincere win more trust. Do not forget to beginner's mind party always! Category: MySQL Note tags: mysql good text to the top attention to my collection of the text fantasy of the wheat field
Follow-1
Fans-4+ plus 00? Previous: Ubutun installation php7.1x
? Next: Failed at the @ Watch script ' cross-env node_env=development using CROSS-ENV to troubleshoot cross-platform settings node_env issues
MySQL Common operations Section