एक Database Table मे Specific Data Types जैसे कि Numeric और String के साथ एकाधिक Columns होते है. MySQL केवल Numeric और String के अलावा अन्य Data Types प्रदान करता है. MySQL मे प्रत्येक Data Types निम्नलिखित विशेषताओं से निर्धारित किया जा सकता है.
Text
Numbers
Dates and times
इनमे से प्रत्येक के भीतर कई रूप है जिनमे से कुछ MySQL के Specific है जिनका आप उपयोग कर सकते है. अपने Columns Types को ठीक से चुनना न केवल यह निर्धारित करता है कि कौन सी जानकारी Stored की जा सकती है और कैसे लेकिन Database के Overall प्रदर्शन को भी प्रभावित करता है आप नीचे Table मे MySQL के लिए उपलब्ध अधिकांश प्रकार Listed है वे कितना स्थान लेते है और संक्षिप्त विवरण क्या है.
Type | Size | Description |
---|---|---|
CHAR[Length] | Length bytes | A fixed-length Field From 0 to 255 characters long. |
VARCHAR(Length) | String length + 1 bytes | A fixed-length Field From 0 to 255 Characters long. |
TINYTEXT | String length + 1 Bytes | A String with a Maximum Length of 255 Characters. |
TEXT | String Length + 2 bytes | A String with a Maximum Length of 65,535 Characters. |
MEDIUMTEXT | String Length + 3 Bytes | A String with a Maximum Length of 16,777,215 Characters. |
LONGTEXT | String length + 4 bytes | A String with a Maximum Length of 4,294,967,295 Characters. |
TINYINT[Length] | 1 byte | Range of -128 to 127 or 0 to 255 Unsigned. |
SMALLINT[Length] | 2 bytes | Range of -32,768 to 32,767 or 0 to 65535 Unsigned. |
MEDIUMINT[Length] | 3 bytes | Range of -8,388,608 to 8,388,607 or 0 to 16,777,215 Unsigned. |
INT[Length] | 4 bytes | Range of -2,147,483,648 to 2,147,483,647 or 0 to 4,294,967,295 unsigned. |
BIGINT[Length] | 8 bytes | Range of -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 or 0 to 18,446,744,073,709,551,615 unsigned. |
FLOAT | 4 bytes | A Small Number With a Floating Decimal Poin. |
DOUBLE[Length, Decimals] | 8 bytes | A Large Number with a Floating Decimal Poin. |
DECIMAL[Length, Decimals] | Length + 1 or Length + 2 bytes | A DOUBLE Stored as a string, Allowing for a Fixed Decimal Point |
DATE | 3 bytes | In the format of YYYY-MM-DD. |
DATETIME | 8 bytes | In the format of YYYY-MM-DD HH:MM:SS. |
TIMESTAMP | 4 bytes | In the format of YYYYMMDDHHMMSS; acceptable range ends inthe year 2037. |
TIME | 3 bytes | In the format of HH:MM:SS |
ENUM | 1 or 2 bytes | Short for enumeration, which means that each column can haveone of several possible values. |
SET | 1, 2, 3, 4, or 8 bytes | Like ENUM except that each column can have more than one ofseveral possible values. |
MySQL ने Version 5.7.8 के बाद से एक Native JSON Data Type का समर्थन किया है जो आपको JSON Documents को अधिक कुशलता से Store और Manage करने की अनुमति देता है. मूल रूप से JSON Data Type और JSON Documents और Optimal Collection प्रारूप का स्वचालित सत्यापन प्रदान करता है.