enum('男', '女');
解决方案 »
- 如何建立数据库网站
- 如何减缓服务器对数据库操作的压力???
- MySQL和C++兼容性怎么样
- 加载数据文件 报错 There is no 'root'@'%' registered
- ERROR 1067: Invalid default value for 'time'
- 新手请教一小问题(在线等待)。
- 请教诸位高手,如何在同台电脑的WIN2000下启动第2个mysql。
- 一个MySQL查询问题!!
- 两个查询为什么第一个比第二个慢????
- mysql> select encode("MySQL","YIYI"),decode(encode("MySQL","YIYI"),"YIYI");
- 如果要把大段长文章存入MySql数据库,该把字段设置成什么类型,插入语句如何写?
- mysql自定义函数执行出错
insert into tbl(gender) values('男', '男', '女', '女');
mysql> SHOW TABLE STATUS LIKE 'tbl'\G
*************************** 1. row ***************************
Name: tbl
Engine: MyISAM
Version: 10
Row_format: Fixed
Rows: 4
Avg_row_length: 7
Data_length: 28
Max_data_length: 1970324836974591
Index_length: 1024
Data_free: 0
Auto_increment: NULL
Create_time: 2009-12-16 17:09:48
Update_time: 2009-12-16 17:13:29
Check_time: NULL
Collation: gb2312_chinese_ci
Checksum: NULL
Create_options:
Comment:
1 row in set (0.00 sec)
Rows: 4
Avg_row_length: 7
Query OK, 0 rows affected (0.06 sec)mysql> insert into tbl(gender) values('男'),( '男'), ('女'),( '女');
Query OK, 4 rows affected (0.05 sec)
Records: 4 Duplicates: 0 Warnings: 0mysql> show table status like 'tbl'\G
*************************** 1. row ***************************
Name: tbl
Engine: MyISAM
Version: 10
Row_format: Fixed
Rows: 4
Avg_row_length: 7
Data_length: 28
Max_data_length: 1970324836974591
Index_length: 1024
Data_free: 0
Auto_increment: NULL
Create_time: 2009-12-16 19:40:28
Update_time: 2009-12-16 19:40:32
Check_time: NULL
Collation: latin1_swedish_ci
Checksum: NULL
Create_options:
Comment:
1 row in set (0.00 sec)mysql> create table tbl1(gender SMALLINT) engine=myisam;
Query OK, 0 rows affected (0.06 sec)mysql> insert into tbl1 values(1),(2),(3),(4);
Query OK, 4 rows affected (0.00 sec)
Records: 4 Duplicates: 0 Warnings: 0mysql> show table status like 'tbl1'\G
*************************** 1. row ***************************
Name: tbl1
Engine: MyISAM
Version: 10
Row_format: Fixed
Rows: 4
Avg_row_length: 7
Data_length: 28
Max_data_length: 1970324836974591
Index_length: 1024
Data_free: 0
Auto_increment: NULL
Create_time: 2009-12-16 19:42:31
Update_time: 2009-12-16 19:42:34
Check_time: NULL
Collation: latin1_swedish_ci
Checksum: NULL
Create_options:
Comment:
1 row in set (0.00 sec)mysql>
+ (number of columns + 7) / 8
+ (number of char columns)
+ (packed size of numeric columns)
+ (length of strings)
+ (number of NULL columns + 7) / 8