SITE SEARCH

Basic data types Mysql

For those who do not know what Mysql is,This is a very effective system with which you can manage large amounts of data. It is free of charge and is offered to users under a general license. At the dawn of the development of computer technology, information was "stored" in separate files, and then extracted from them as needed. Today such systems are not always effective, because it takes a lot of time and effort. The Mysql program allows you to sort information and perform operations on arrays of data using a very compact command code.

mysql data types

In order for the database to work correctly, Mysql has a concept of a data type. There are several data options:

- VAR (n) or VARCHAR (n) - character, where n is the number of bytes that can be used (VARCHAR stores no more than 255 characters);

- string data types mysql, includingof the following formats: TEXT (n) - where n can reach 65535, TINITEXT (n) - where n can be up to 255, MEDIUMTEXT (n) from n to 16 777 215 and LONGTEXT (n) with variable n, which can reach 4 294 967 295 (from VARCHAR the variable TEXT differs in that for TEXT (n) the first n characters are indexed);

- VARBINARY or BINARY - for storing pictures in binary code;

- for storing large binary objects, taking into accountthe character register uses the Mysql BLOB (n) data types, which have the same dimension and "prefixes" as TEXT (TINY-, MEDIUM-, LONGBLOB); for example, MEDIUMBLOB (n) has the dimension n equal to 16 777 215;

data type concept

- data types for time and date, including: DATE is the date in year-month-date format, TIME is hour-minute-second time, YEAR is years from 1901 to 2155 and year is 0000, DATETIME combines DATE and TIME (the last data type is output in year- month-date-hour-minute-second); Also, there are data types Mysql format TIMESTAMP, which allows you to make the database years from 1970 to 2037 (this is due to the assumption of the creators of the system that Mysql finally become obsolete by 2037);

- numeric, which in their composition have integertypes of data, including INT - an integer from approximately 2.1 billion to minus 2.1 billion, TINYINT - the number from 128 to -127 or from 255 to 0, SMALINT - from 32 768 to - 32 767, BIGINT - from 9 x 10 at the eighteenth degree to -9 x 10 at the eighteenth degree, MEDIUMINT - from 8.388 million to -8.38 million (if in a particular type of data set a number greater than the maximum set value, it will be truncated to admissible values).

Also there are types for fractional numbers - FLOAT -this is a floating point number, DOUBLE and REAL are the number of double density with a floating point, NUMERIC and DECIMAL are a fractional number that is stored as a string. In programming, mainly FLOAT and INT are used, which support the optimal speed of the database.

integer data types

Work with databases is carried out throughThe PHPMyAdmin tool, which is delivered free of charge in the Denver package. Using it, you can create a database by specifying database names and various tables, data types, passwords. After that the database is filled with information, you can create queries in the form of search (SELECT), change (CHANGE, RENAME, MODIFY), delete (DELETE), add (ADD) or sort the available data and display certain parameters on the screen. The Mysql data types in this case should be added very carefully so that the programs do not produce errors. For example, you can specify a type for VARCHAR data, which allows you to add text to the database of up to 255 characters. And when the database is full, the text will be larger, which will cause Mysql to "truncate" the text to an acceptable length.

</ p>
  • Rating: