To facilitate the use of code written for SQL implementations from other vendors, MySQL maps data
types as shown in the following table. These mappings make it easier to import table definitions from
other database systems into MySQL.
Other Vendor Type MySQL Type
BOOL TINYINT
BOOLEAN TINYINT
CHARACTER VARYING(M) VARCHAR(M)
FIXED DECIMAL
FLOAT4 FLOAT
FLOAT8 DOUBLE
INT1 TINYINT
INT2 SMALLINT
INT3 MEDIUMINT
INT4 INT
INT8 BIGINT
LONG VARBINARY MEDIUMBLOB
LONG VARCHAR MEDIUMTEXT
LONG MEDIUMTEXT
MIDDLEINT MEDIUMINT
NUMERIC DECIMAL
Data type mapping occurs at table creation time, after which the original type specifications are
discarded. If you create a table with types used by other vendors and then issue a DESCRIBE
tbl_name statement, MySQL reports the table structure using the equivalent MySQL types. For
example:
mysql> CREATE TABLE t (a BOOL, b FLOAT8, c LONG VARCHAR, d NUMERIC);
Query OK, 0 rows affected (0.00 sec)
mysql> DESCRIBE t;
+-------+---------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+---------------+------+-----+---------+-------+
| a | tinyint(1) | YES | | NULL | |
| b | double | YES | | NULL | |
| c | mediumtext | YES | | NULL | |
| d | decimal(10,0) | YES | | NULL | |
+-------+---------------+------+-----+---------+-------+
4 rows in set (0.01 sec)

最新文章

  1. AnjularJS系列5 —— scopes、module、controller
  2. 搜索引擎Solr系列(一): Solr6.2.1环境搭建
  3. HDFS的运行原理
  4. 极限编程之TDD
  5. PL/SQL常用设置 可看引用位置更清晰直观 引自:http://blog.csdn.net/xiaoqforever/article/details/27695569
  6. SendMail
  7. Codeforces Round #313 A Currency System in Geraldion
  8. PHP简易计算器方法2
  9. ThinkPHP--IS_AJAX
  10. ZOJ3508 The War 贪心,最大流
  11. Jquery cookie操作示例,写入cookie,读取cookie,删除cookie
  12. sspanelv3魔改版邮件设置指南及常用配置
  13. spring boot中利用mybatis-generator插件生成代码
  14. NOIP水题测试(2017082301)
  15. Mac环境 MySQL 和 MySQLWorkBench 破解版百度云下载
  16. mongodb安装及副本集搭建
  17. bzoj1620 / P2920 [USACO08NOV]时间管理Time Management
  18. Introduction Sockets to Programming in C using TCP/IP
  19. 高可用Kubernetes集群-10. 部署kube-proxy
  20. mysql表的完整性约束

热门文章

  1. vuex commit保存数据技巧
  2. [持续开源]基于nodejs+ligerui的一款mongodb web 端查询工具(MongoStudio)
  3. Myeclipse修改设置Default VM Arguments
  4. centOS7配置DNS服务器
  5. [SDOI 2008]Cave 洞穴勘测
  6. [HAOI2006]旅行
  7. 4999: This Problem Is Too Simple!
  8. bzoj1073[SCOI2007]kshort
  9. [usaco6.1.1Postal Vans]
  10. Thinkphp中的U函数(Thinkphp3.2.3版本)