[摘要]+----------+-------------+------+-----+---------+----------------+
4 rows in set (0.00 sec)删除字段成功,现...
+----------+-------------+------+-----+---------+----------------+
4 rows in set (0.00 sec)删除字段成功,现在我们已经不能看到star的字段了。 2.4.4 rename 重命名表名 2.4.5 null or not null 修改表字段允许为空或不允许为空: mysql> ALTER TABLE PEOPLE MODIFY AGE INT(3) NULL;
Query OK, 0 rows affected (0.01 sec)Records: 0 Duplicates: 0 Warnings: 0 把 PEOPLE 表的 AGE 字段设置成“允许为空”,即插入记录时这个字段可以不录入。否则相反。 它的格式为:ALTER TABLE MODIFY mysql> create table newTable select * from PEOPLE;
Query OK, 0 rows affected (0.01 sec)
Records: 0 Duplicates: 0 Warnings: 0 我们查看一下目前数据库存在的表: mysql> show tables;
+------------------+ |