Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

What are the types of data in SQL?

user-image
Question added by Yasmeen Husam , Web Developer , Al Fahid Systems
Date Posted: 2018/11/18
MOHAMAD AJARUDEEN H
by MOHAMAD AJARUDEEN H , salesforce consultant engineer , Tata Consultancy Services

In Generic,

Integer

Varchar

Numeric

Decimal

DateandTime

 

Ahmed Alharbi
by Ahmed Alharbi , Electronics Engineer , Salem Agencies & Services

There are three main data types: text, number, and date.

Alosious Delsot
by Alosious Delsot , Application Analyst , Healthcare Solutions

1) CHARACTER [(length)] or CHAR [(length)]

2) VARCHAR (length)

3) BOOLEAN

4) SMALLINT

5)INTEGER or INT

6) DECIMAL [(p[,s])] or DEC [(p[,s])]

7) NUMERIC [(p[,s])]

8) REAL

9) FLOAT(p)

10) DOUBLE PRECISION

11) DATE

12) TIME

13) TIMESTAMP

Younes LABIOD
by Younes LABIOD , Software Developer , Precision Industries

Threre ara several types of data in SQL, and it's important to understand the uses and particularities of each type of data, in order to choose the best possible type when you define the columns of your tables. Choosing the wrong kind of data could lead to critical situations such as: a waste of memory, performance problems.

Each DBMS has its own data types, the following types are used by the MySQL :

1 Numeric types : numeric types can be subdivided into two sub-categories: integers, and decimals.

Integers : INT, TINYINT, SMALLINT, MEDIUMINT and BIGINT.

Decimals : DECIMAL, NUMERIC, FLOAT, REAL and DOUBLE.

2 Alphanumeric types : CHAR, VARCHAR and TEXT.

3 Time Types : DATE, DATETIME, TIME, TIMESTAMP and YEAR.

Best regards,

Younes LABIOD

More Questions Like This