Skip to main content

Posts

Showing posts with the label mysql data types

Numeric Data Type

       For storing numeric data, MySQL provides integer data  types, floating-point types that store approximate-value (real) numbers, a fixed-point type that stores exact-value (real) numbers, and a BIT type for bit-field  values.  When numeric data type is chosen, consider the following factors:   •   The range of values the data type represents   •   The amount of storage space that column values require   •   The column precision and scale for floating-point and fixed-point values   Precision and scale are terms that apply to floating-point and fixed-point values, which can have both an  integer part and a fractional part. Precision is the number of significant digits. Scale is the number of digits  to the right of the decimal point.  Integer Data Type  The integer data types are summarized in the following table, which indicates the amount of storage per  value that each type requires as well as its ra nge.  For integer values declared with the  UNSIGN

MySQL Data Types

           Before going to deep into the creation of tables, it is important to understand the data types that can be used within MySQL.  These data types will be assigned to  the columns that will make up the MySQL tables and will need to be understood, not only for ensuring the proper data is being stored but also to ensure a database that performs well.  One of the biggest problems associated with database performance is poor design, especially in the choice of data type s that are used in the columns.  In  MySQL the data types available can be broken down into three major categories:  Numeric      •    Numeric values (Integers, Floating-Point, Fixed-Point and Bit-field)  String          •    Text or binary data  Temporal    •   Time and dates               Within each category there are numerous specific data types that use varying amounts of memory and disk space, thus having varying effects on performance.  Choosing the best data type for the column has a rather sm