SlideShare a Scribd company logo
1 of 16
DataTypes in mysql
Mrs.G.Chandraprabha,M.Sc.,M.Phil
.,
Assistant Professor,
Department of IT,
V.V.V college for Women,
Virudhunagar
Introduction
A data type is an attribute that
specifies the type of data that the object can
hold: integer data, character data,
monetary data, date and time data, binary
strings, and so on.
SQL Server supplies a set of
system data types that define all
the types of data that can be used
with SQL Server.
Their types,
MySQL uses many different data types
broken into three categories.
Numeric
Date and Time
String Types.
Numeric Data Types
INT
TINYINT
 SMALLINT
MEDIUMINT
BIGINT
FLOAT(M,D)
DOUBLE(M,D)
DECIMAL(M,D)
Numeric Data Types
INT − A normal-sized integer that can be
signed or unsigned. If signed, the
allowable range is from -2147483648 to
2147483647. If unsigned, the allowable
range is from 0 to 4294967295. You can
specify a width of up to 11 digits.
TINYINT − A very small integer that can
be signed or unsigned. If signed, the
allowable range is from -128 to 127. If
unsigned, the allowable range is from 0 to
255. You can specify a width of up to 4
digits.
Cont……
SMALLINT − A small integer that can be
signed or unsigned. If signed, the
allowable range is from -32768 to
32767. If unsigned, the allowable range
is from 0 to 65535. You can specify a
width of up to 5 digits.
MEDIUMINT − A medium-sized integer
that can be signed or unsigned. If
signed, the allowable range is from -
8388608 to 8388607. If unsigned, the
allowable range is from 0 to 16777215.
You can specify a width of up to 9 digits.
Cont….
BIGINT − A large integer that can be signed or
unsigned. If signed, the allowable range is from -
9223372036854775808 to 9223372036854775807.
If unsigned, the allowable range is from 0 to
18446744073709551615. You can specify a width
of up to 20 digits.
FLOAT(M,D) − A floating-point number that
cannot be unsigned. You can define the display
length (M) and the number of decimals (D). This
is not required and will default to 10,2, where 2
is the number of decimals and 10 is the total
number of digits (including decimals). Decimal
precision can go to 24 places for a FLOAT.
Cont…..
DOUBLE(M,D) − A double precision floating-point
number that cannot be unsigned. You can define the
display length (M) and the number of decimals (D).
This is not required and will default to 16,4, where 4
is the number of decimals. Decimal precision can go
to 53 places for a DOUBLE. REAL is a synonym for
DOUBLE.
DECIMAL(M,D) − An unpacked floating-point
number that cannot be unsigned. In the unpacked
decimals, each decimal corresponds to one byte.
Defining the display length (M) and the number of
decimals (D) is required. NUMERIC is a synonym for
DECIMAL.
Date and Time Types
DATE
DATETIME
TIMESTAMP
TIME
YEAR(M)
Date and Time Types
DATE − A date in YYYY-MM-DD format,
between 1000-01-01 and 9999-12-31. For
example, December 30th, 1973 would be
stored as 1973-12-30.
DATETIME − A date and time combination in
YYYY-MM-DD HH:MM:SS format, between
1000-01-01 00:00:00 and 9999-12-31
23:59:59. For example, 3:30 in the afternoon
on December 30th, 1973 would be stored as
1973-12-30 15:30:00.
Cont……
TIMESTAMP − A timestamp between midnight,
January 1st, 1970 and sometime in 2037. This looks
like the previous DATETIME format, only without the
hyphens between numbers; 3:30 in the afternoon on
December 30th, 1973 would be stored as
19731230153000 ( YYYYMMDDHHMMSS ).
TIME − Stores the time in a HH:MM:SS format.
YEAR(M) − Stores a year in a 2-digit or a 4-digit
format. If the length is specified as 2 (for example
YEAR(2)), YEAR can be between 1970 to 2069 (70 to
69). If the length is specified as 4, then YEAR can be
1901 to 2155. The default length is 4.
String Types
CHAR(M)
VARCHAR(M)
BLOB or TEXT
TINYBLOB or TINYTEXT
MEDIUMBLOB or MEDIUMTEXT
LONGBLOB or LONGTEXT
ENUM
String Types
CHAR(M) − A fixed-length string between 1
and 255 characters in length (for example
CHAR(5)), right-padded with spaces to the
specified length when stored. Defining a
length is not required, but the default is 1.
VARCHAR(M) − A variable-length string
between 1 and 255 characters in length. For
example, VARCHAR(25). You must define a
length when creating a VARCHAR field.
Cont…….
BLOB or TEXT − A field with a maximum length of
65535 characters. BLOBs are "Binary Large Objects"
and are used to store large amounts of binary data,
such as images or other types of files. Fields defined
as TEXT also hold large amounts of data. The
difference between the two is that the sorts and
comparisons on the stored data are case sensitive on
BLOBs and are not case sensitive in TEXT fields.
You do not specify a length with BLOB or TEXT.
TINYBLOB or TINYTEXT − A BLOB or TEXT column
with a maximum length of 255 characters. You do not
specify a length with TINYBLOB or TINYTEXT.
Cont……
MEDIUMBLOB or MEDIUMTEXT − A BLOB or TEXT
column with a maximum length of 16777215
characters. You do not specify a length with
MEDIUMBLOB or MEDIUMTEXT.
LONGBLOB or LONGTEXT − A BLOB or TEXT
column with a maximum length of 4294967295
characters. You do not specify a length with
LONGBLOB or LONGTEXT.
ENUM − An enumeration, which is a fancy term for
list. When defining an ENUM, you are creating a list
of items from which the value must be selected (or it
can be NULL). For example, if you wanted your field
to contain "A" or "B" or "C", you would define your
ENUM as ENUM ('A', 'B', 'C') and only those values (or
NULL) could ever populate that field.
Mysql datatypes

More Related Content

What's hot (20)

Sql tutorial
Sql tutorialSql tutorial
Sql tutorial
 
Sql.pptx
Sql.pptxSql.pptx
Sql.pptx
 
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with ExamplesDML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
 
SQL for interview
SQL for interviewSQL for interview
SQL for interview
 
SQL Tutorial - Basic Commands
SQL Tutorial - Basic CommandsSQL Tutorial - Basic Commands
SQL Tutorial - Basic Commands
 
Unit 4 plsql
Unit 4  plsqlUnit 4  plsql
Unit 4 plsql
 
C++ data types
C++ data typesC++ data types
C++ data types
 
2.0 sql data types for my sql, sql server
2.0 sql data types for my sql, sql server2.0 sql data types for my sql, sql server
2.0 sql data types for my sql, sql server
 
SQL JOINS
SQL JOINSSQL JOINS
SQL JOINS
 
Introduction To Oracle Sql
Introduction To Oracle SqlIntroduction To Oracle Sql
Introduction To Oracle Sql
 
Unit 2 oracle9i
Unit 2  oracle9i Unit 2  oracle9i
Unit 2 oracle9i
 
Sql fundamentals
Sql fundamentalsSql fundamentals
Sql fundamentals
 
Structured Query Language (SQL)
Structured Query Language (SQL)Structured Query Language (SQL)
Structured Query Language (SQL)
 
SQL: Structured Query Language
SQL: Structured Query LanguageSQL: Structured Query Language
SQL: Structured Query Language
 
SQL - Structured query language introduction
SQL - Structured query language introductionSQL - Structured query language introduction
SQL - Structured query language introduction
 
SQL Queries Information
SQL Queries InformationSQL Queries Information
SQL Queries Information
 
PL/SQL Introduction and Concepts
PL/SQL Introduction and Concepts PL/SQL Introduction and Concepts
PL/SQL Introduction and Concepts
 
Nested Queries Lecture
Nested Queries LectureNested Queries Lecture
Nested Queries Lecture
 
STRUCTURE OF SQL QUERIES
STRUCTURE OF SQL QUERIESSTRUCTURE OF SQL QUERIES
STRUCTURE OF SQL QUERIES
 
Mysql
MysqlMysql
Mysql
 

Similar to Mysql datatypes

2019 02 21_biological_databases_part2_v_upload
2019 02 21_biological_databases_part2_v_upload2019 02 21_biological_databases_part2_v_upload
2019 02 21_biological_databases_part2_v_uploadProf. Wim Van Criekinge
 
Simple Queriebhjjnhhbbbbnnnnjjs In SQL.pdf
Simple Queriebhjjnhhbbbbnnnnjjs In SQL.pdfSimple Queriebhjjnhhbbbbnnnnjjs In SQL.pdf
Simple Queriebhjjnhhbbbbnnnnjjs In SQL.pdfManojVishwakarma91
 
Sql data types for various d bs by naveen kumar veligeti
Sql data types for various d bs by naveen kumar veligetiSql data types for various d bs by naveen kumar veligeti
Sql data types for various d bs by naveen kumar veligetiNaveen Kumar Veligeti
 
2018 02 20_biological_databases_part2_v_upload
2018 02 20_biological_databases_part2_v_upload2018 02 20_biological_databases_part2_v_upload
2018 02 20_biological_databases_part2_v_uploadProf. Wim Van Criekinge
 
Copy of MySQL Data Types.pdf
Copy of MySQL Data Types.pdfCopy of MySQL Data Types.pdf
Copy of MySQL Data Types.pdfsadafali71
 
SQL (Basic to Intermediate Customized 8 Hours)
SQL (Basic to Intermediate Customized 8 Hours)SQL (Basic to Intermediate Customized 8 Hours)
SQL (Basic to Intermediate Customized 8 Hours)Edu4Sure
 
SQL Commands Part 1.pptx
SQL Commands Part 1.pptxSQL Commands Part 1.pptx
SQL Commands Part 1.pptxRUBAB79
 
Learn Database Design with MySQL - Chapter 4 - Data types
Learn Database Design with MySQL - Chapter 4 - Data typesLearn Database Design with MySQL - Chapter 4 - Data types
Learn Database Design with MySQL - Chapter 4 - Data typesEduonix Learning Solutions
 
Field datatypes
Field datatypesField datatypes
Field datatypeshanuman
 
Functions data format
Functions data formatFunctions data format
Functions data formatgtankariagt
 
Visual Basic Fundamentals
Visual Basic FundamentalsVisual Basic Fundamentals
Visual Basic FundamentalsDivyaR219113
 
cassignmentii-170424105623.pdf
cassignmentii-170424105623.pdfcassignmentii-170424105623.pdf
cassignmentii-170424105623.pdfYRABHI
 
data types in C programming
data types in C programmingdata types in C programming
data types in C programmingHarshita Yadav
 

Similar to Mysql datatypes (20)

2019 02 21_biological_databases_part2_v_upload
2019 02 21_biological_databases_part2_v_upload2019 02 21_biological_databases_part2_v_upload
2019 02 21_biological_databases_part2_v_upload
 
Simple Queriebhjjnhhbbbbnnnnjjs In SQL.pdf
Simple Queriebhjjnhhbbbbnnnnjjs In SQL.pdfSimple Queriebhjjnhhbbbbnnnnjjs In SQL.pdf
Simple Queriebhjjnhhbbbbnnnnjjs In SQL.pdf
 
2016 02 23_biological_databases_part2
2016 02 23_biological_databases_part22016 02 23_biological_databases_part2
2016 02 23_biological_databases_part2
 
Sql data types for various d bs by naveen kumar veligeti
Sql data types for various d bs by naveen kumar veligetiSql data types for various d bs by naveen kumar veligeti
Sql data types for various d bs by naveen kumar veligeti
 
2017 biological databasespart2
2017 biological databasespart22017 biological databasespart2
2017 biological databasespart2
 
MSAvMySQL.pptx
MSAvMySQL.pptxMSAvMySQL.pptx
MSAvMySQL.pptx
 
2018 02 20_biological_databases_part2_v_upload
2018 02 20_biological_databases_part2_v_upload2018 02 20_biological_databases_part2_v_upload
2018 02 20_biological_databases_part2_v_upload
 
unit 1 ppt.pptx
unit 1 ppt.pptxunit 1 ppt.pptx
unit 1 ppt.pptx
 
Copy of MySQL Data Types.pdf
Copy of MySQL Data Types.pdfCopy of MySQL Data Types.pdf
Copy of MySQL Data Types.pdf
 
DBMS
DBMSDBMS
DBMS
 
SQL (Basic to Intermediate Customized 8 Hours)
SQL (Basic to Intermediate Customized 8 Hours)SQL (Basic to Intermediate Customized 8 Hours)
SQL (Basic to Intermediate Customized 8 Hours)
 
SQL Commands Part 1.pptx
SQL Commands Part 1.pptxSQL Commands Part 1.pptx
SQL Commands Part 1.pptx
 
Learn Database Design with MySQL - Chapter 4 - Data types
Learn Database Design with MySQL - Chapter 4 - Data typesLearn Database Design with MySQL - Chapter 4 - Data types
Learn Database Design with MySQL - Chapter 4 - Data types
 
Field datatypes
Field datatypesField datatypes
Field datatypes
 
Functions data format
Functions data formatFunctions data format
Functions data format
 
Visual Basic Fundamentals
Visual Basic FundamentalsVisual Basic Fundamentals
Visual Basic Fundamentals
 
cassignmentii-170424105623.pdf
cassignmentii-170424105623.pdfcassignmentii-170424105623.pdf
cassignmentii-170424105623.pdf
 
data types in C programming
data types in C programmingdata types in C programming
data types in C programming
 
MySql
MySqlMySql
MySql
 
Chapter 03
Chapter 03Chapter 03
Chapter 03
 

More from V.V.Vanniaperumal College for Women

More from V.V.Vanniaperumal College for Women (20)

Control Memory.pptx
Control Memory.pptxControl Memory.pptx
Control Memory.pptx
 
ADDRESSING MODES.pptx
ADDRESSING MODES.pptxADDRESSING MODES.pptx
ADDRESSING MODES.pptx
 
Data_Transfer&Manupulation Instructions.pptx
Data_Transfer&Manupulation Instructions.pptxData_Transfer&Manupulation Instructions.pptx
Data_Transfer&Manupulation Instructions.pptx
 
Timing & Control.pptx
Timing & Control.pptxTiming & Control.pptx
Timing & Control.pptx
 
Human Rights - 1.pptx
Human Rights - 1.pptxHuman Rights - 1.pptx
Human Rights - 1.pptx
 
Registers.pptx
Registers.pptxRegisters.pptx
Registers.pptx
 
Instruction Codes.pptx
Instruction Codes.pptxInstruction Codes.pptx
Instruction Codes.pptx
 
Features of Java.pptx
Features of Java.pptxFeatures of Java.pptx
Features of Java.pptx
 
JVM.pptx
JVM.pptxJVM.pptx
JVM.pptx
 
Constructors in JAva.pptx
Constructors in JAva.pptxConstructors in JAva.pptx
Constructors in JAva.pptx
 
IS-Crypttools.pptx
IS-Crypttools.pptxIS-Crypttools.pptx
IS-Crypttools.pptx
 
IS-Delibrate software attacks.pptx
IS-Delibrate software attacks.pptxIS-Delibrate software attacks.pptx
IS-Delibrate software attacks.pptx
 
IS-Nature of forces.ppt
IS-Nature of forces.pptIS-Nature of forces.ppt
IS-Nature of forces.ppt
 
IS-cryptograpy algorithms.pptx
IS-cryptograpy algorithms.pptxIS-cryptograpy algorithms.pptx
IS-cryptograpy algorithms.pptx
 
IS-Types of IDPSs.pptx
IS-Types of IDPSs.pptxIS-Types of IDPSs.pptx
IS-Types of IDPSs.pptx
 
IS-honeypot.pptx
IS-honeypot.pptxIS-honeypot.pptx
IS-honeypot.pptx
 
Sum of subset problem.pptx
Sum of subset problem.pptxSum of subset problem.pptx
Sum of subset problem.pptx
 
M-coloring.pptx
M-coloring.pptxM-coloring.pptx
M-coloring.pptx
 
storm.ppt
storm.pptstorm.ppt
storm.ppt
 
storm for RTA.pptx
storm for RTA.pptxstorm for RTA.pptx
storm for RTA.pptx
 

Recently uploaded

SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 

Recently uploaded (20)

SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 

Mysql datatypes

  • 1. DataTypes in mysql Mrs.G.Chandraprabha,M.Sc.,M.Phil ., Assistant Professor, Department of IT, V.V.V college for Women, Virudhunagar
  • 2. Introduction A data type is an attribute that specifies the type of data that the object can hold: integer data, character data, monetary data, date and time data, binary strings, and so on. SQL Server supplies a set of system data types that define all the types of data that can be used with SQL Server.
  • 3. Their types, MySQL uses many different data types broken into three categories. Numeric Date and Time String Types.
  • 4. Numeric Data Types INT TINYINT  SMALLINT MEDIUMINT BIGINT FLOAT(M,D) DOUBLE(M,D) DECIMAL(M,D)
  • 5. Numeric Data Types INT − A normal-sized integer that can be signed or unsigned. If signed, the allowable range is from -2147483648 to 2147483647. If unsigned, the allowable range is from 0 to 4294967295. You can specify a width of up to 11 digits. TINYINT − A very small integer that can be signed or unsigned. If signed, the allowable range is from -128 to 127. If unsigned, the allowable range is from 0 to 255. You can specify a width of up to 4 digits.
  • 6. Cont…… SMALLINT − A small integer that can be signed or unsigned. If signed, the allowable range is from -32768 to 32767. If unsigned, the allowable range is from 0 to 65535. You can specify a width of up to 5 digits. MEDIUMINT − A medium-sized integer that can be signed or unsigned. If signed, the allowable range is from - 8388608 to 8388607. If unsigned, the allowable range is from 0 to 16777215. You can specify a width of up to 9 digits.
  • 7. Cont…. BIGINT − A large integer that can be signed or unsigned. If signed, the allowable range is from - 9223372036854775808 to 9223372036854775807. If unsigned, the allowable range is from 0 to 18446744073709551615. You can specify a width of up to 20 digits. FLOAT(M,D) − A floating-point number that cannot be unsigned. You can define the display length (M) and the number of decimals (D). This is not required and will default to 10,2, where 2 is the number of decimals and 10 is the total number of digits (including decimals). Decimal precision can go to 24 places for a FLOAT.
  • 8. Cont….. DOUBLE(M,D) − A double precision floating-point number that cannot be unsigned. You can define the display length (M) and the number of decimals (D). This is not required and will default to 16,4, where 4 is the number of decimals. Decimal precision can go to 53 places for a DOUBLE. REAL is a synonym for DOUBLE. DECIMAL(M,D) − An unpacked floating-point number that cannot be unsigned. In the unpacked decimals, each decimal corresponds to one byte. Defining the display length (M) and the number of decimals (D) is required. NUMERIC is a synonym for DECIMAL.
  • 9. Date and Time Types DATE DATETIME TIMESTAMP TIME YEAR(M)
  • 10. Date and Time Types DATE − A date in YYYY-MM-DD format, between 1000-01-01 and 9999-12-31. For example, December 30th, 1973 would be stored as 1973-12-30. DATETIME − A date and time combination in YYYY-MM-DD HH:MM:SS format, between 1000-01-01 00:00:00 and 9999-12-31 23:59:59. For example, 3:30 in the afternoon on December 30th, 1973 would be stored as 1973-12-30 15:30:00.
  • 11. Cont…… TIMESTAMP − A timestamp between midnight, January 1st, 1970 and sometime in 2037. This looks like the previous DATETIME format, only without the hyphens between numbers; 3:30 in the afternoon on December 30th, 1973 would be stored as 19731230153000 ( YYYYMMDDHHMMSS ). TIME − Stores the time in a HH:MM:SS format. YEAR(M) − Stores a year in a 2-digit or a 4-digit format. If the length is specified as 2 (for example YEAR(2)), YEAR can be between 1970 to 2069 (70 to 69). If the length is specified as 4, then YEAR can be 1901 to 2155. The default length is 4.
  • 12. String Types CHAR(M) VARCHAR(M) BLOB or TEXT TINYBLOB or TINYTEXT MEDIUMBLOB or MEDIUMTEXT LONGBLOB or LONGTEXT ENUM
  • 13. String Types CHAR(M) − A fixed-length string between 1 and 255 characters in length (for example CHAR(5)), right-padded with spaces to the specified length when stored. Defining a length is not required, but the default is 1. VARCHAR(M) − A variable-length string between 1 and 255 characters in length. For example, VARCHAR(25). You must define a length when creating a VARCHAR field.
  • 14. Cont……. BLOB or TEXT − A field with a maximum length of 65535 characters. BLOBs are "Binary Large Objects" and are used to store large amounts of binary data, such as images or other types of files. Fields defined as TEXT also hold large amounts of data. The difference between the two is that the sorts and comparisons on the stored data are case sensitive on BLOBs and are not case sensitive in TEXT fields. You do not specify a length with BLOB or TEXT. TINYBLOB or TINYTEXT − A BLOB or TEXT column with a maximum length of 255 characters. You do not specify a length with TINYBLOB or TINYTEXT.
  • 15. Cont…… MEDIUMBLOB or MEDIUMTEXT − A BLOB or TEXT column with a maximum length of 16777215 characters. You do not specify a length with MEDIUMBLOB or MEDIUMTEXT. LONGBLOB or LONGTEXT − A BLOB or TEXT column with a maximum length of 4294967295 characters. You do not specify a length with LONGBLOB or LONGTEXT. ENUM − An enumeration, which is a fancy term for list. When defining an ENUM, you are creating a list of items from which the value must be selected (or it can be NULL). For example, if you wanted your field to contain "A" or "B" or "C", you would define your ENUM as ENUM ('A', 'B', 'C') and only those values (or NULL) could ever populate that field.