Sachin from Pune
Sachin from Pune

Reputation: 736

cannot understand the exact different between the INT and INTEGER from MySQL?

Here is my first query for creating the customer database:

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

and I want add foreign key for the other order table so I create 2nd database Order

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

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

My order query is not working but when I replace INT with INTEGER, then query works fine, but I can't understand that the exact difference is.

Upvotes: 0

Views: 43

Answers (1)

ScaisEdge
ScaisEdge

Reputation: 133360

Integer or INT are synonymous..

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

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

Upvotes: 2

Related Questions