mysql用命令添加屬性的方法:使用ADD子句來向數據表中添加列。
mysql用命令添加屬性的示例:
MySQL中使用ADD子句來向數據表中添加列,代碼如下:
mysql> alter table exmaple_alter_test add sex varchar(100);Query OK, 0 rows affected (1.06 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> show columns from exmaple_alter_test;
+-------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+--------------+------+-----+---------+-------+
| name | varchar(100) | YES | | NULL | |
| sex | varchar(100) | YES | | NULL | |
+-------+--------------+------+-----+---------+-------+
2 rows in set (0.00 sec)