gpt4 book ai didi

mysql - 无法理解 MySQL 中的 INT 和 INTEGER 之间的确切区别?

转载 作者:行者123 更新时间:2023-11-29 06:56:15 25 4
gpt4 key购买 nike

这是我创建客户数据库的第一个查询:

create table customers (id int PRIMARY KEY, Name varchar(50));

我想为其他订单表添加外键,因此我创建第二个数据库订单

create table myOrder 
(
order_ID int,
order_date date,
customers_ID int,

Foreign Key (customers_id) REFERENCES customers(id)
);

我的订单查询不起作用,但是当我用 INTEGER 替换 INT 时,查询工作正常,但我无法理解确切的区别。

最佳答案

整数或 INT 是同义词。

来自 mysql DOC https://dev.mysql.com/doc/refman/5.7/en/integer-types.html

MySQL supports the SQL standard integer types INTEGER (or INT)

关于mysql - 无法理解 MySQL 中的 INT 和 INTEGER 之间的确切区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45499311/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com