mysql> create table teacher (
-> name varchar(20) comment '姓名',
-> age int comment '年龄',
-> stature decimal(4, 4) comment '身高(cm)',
-> weight decimal(4, 4) comment '体重(kg)',
-> sex varchar(20) comment '性别',
-> education varchar(20) comment '学历',
-> birthday timestamp comment '生日',
-> id_number int comment '身份证号'
-> );
Query OK, 0 rows affected (0.19 sec)
mysql> desc teacher;
+-----------+--------------+------+-----+-------------------+-----------------------------+
| Field | Type | Null | Key | Default | Extra |
+-----------+--------------+------+-----+-------------------+-----------------------------+
| name | varchar(20) | YES | | NULL | |
| age | int(11) | YES | | NULL | |
| stature | decimal(4,4) | YES | | NULL | |
| weight | decimal(4,4) | YES | | NULL | |
| sex | varchar(20) | YES | | NULL | |
| education | varchar(20) | YES | | NULL | |
| birthday | timestamp | NO | | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP |
| id_number | int(11) | YES | | NULL | |
+-----------+--------------+------+-----+-------------------+-----------------------------+
8 rows in set (0.00 sec)
mysql>
使用MySQL建表2
最新推荐文章于 2024-07-27 20:32:24 发布