Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL base types: integer vs int?

For query language (SQL) functions, what's the difference between the int and integer base types?

How do you know?

like image 955
ma11hew28 Avatar asked Mar 14 '14 12:03

ma11hew28


People also ask

Is integer and INT same in SQL?

The difference between int and integer is that int is a data type, but integer is a group of data types – e.g. int , long , short and byte .

What is the difference between integer and number datatype in SQL?

INTEGER is a 32-bit binary numeric type. It has a fixed storage size of 4 bytes. NUMBER is a new data type, introduced in Teradata 14.0, which is intended to emulate the Oracle number data type. It has an optional precision and scale of up to 38 decimal digits.


2 Answers

In Postgresql int and int4 are aliases for integer, a signed four-byte integer

http://www.postgresql.org/docs/current/static/datatype.html#DATATYPE-TABLE

like image 187
Clodoaldo Neto Avatar answered Sep 25 '22 13:09

Clodoaldo Neto


Int and Integer are the same

"The keyword INT is a synonym for INTEGER"

Similarly

"The keywords DEC and FIXED are synonyms for DECIMAL"

Sql Numeric Documentation Source

like image 28
Smeghead Sev Avatar answered Sep 24 '22 13:09

Smeghead Sev