SQL (data types): table

In the modern world, there are a large number of tools and technologies designed to store information. One of the most common methods are databases, for which various control systems are used. This storage method assumes that all data is clearly structured and listed in special tables. They, in turn, consist of attribute columns of a particular data type.

Data type - what is it?

Today, there are several definitions that explain the concept of the term “data type”. However, each of them has one common meaning. Therefore, the data type can be arbitrarily designated as a group of data characterized by its values ​​(symbolic, numeric, etc.), as well as operations applied to the values ​​in question.

SQL Data Types




. , . . . SQL- , .





. : .

SQL Data Types




, , , , . SQL- . . Oracle MySQL.

, SQL, 4 :

  • ;
  • ;
  • ;
  • .

, .

SQL String Data Types




, , SQL. , , .





CHAR (size)

. . , , – 255.

VARCHAR (size)

255 . CHAR , . , 5- , 6 . .

TINY

255 .

, 65 535 .

BLOB

, 65 535 . , , .

MEDIUM

, 16 777 215 .

MEDIUM BLOB

, 16 777 215 .

LONG

, 4 .

LONG BLOB

(4 294 967 295 ).

ENUM (a, b, c, etc.)

, . 65535 . . , , , .

SET

. , 64 , .

SQL . , , . :

FLOAT (size, d)

d.

DOUBLE (size, d)

.

DECIMAL(size, d)

.

, 8- 10- . .

SQL data type conversion




. SQL . , .

– , . SQL INTEGER .

INT (size)

, [-231; 231-1]

TINYINT (size)

-128 127

SMALLINT (size)

-32 768 32 767

MEDIUMINT (size)

-223 223-1

BIGINT (size)

, -263 263-1

, , SQL-. , , .

Integer SQL table data types




, . , . , , , UNSIGNED.

SQL .

microsoft sql data types




, .

DATE

- -- (“-MM-” "-mm-dd" ). «-», , .

TIME

. «hh:mm:ss»

DATETIME

. : «-mm-dd hh:mm:ss».

TIMESTAMP

, , 1.01.1970 .

YEAR (M)

- .

?

Microsoft. SQL .

, , . , .

– NULL

, . – NULL, SQL. , , , . NULL NOT .

SQL Language Data Types




NULL , . .




All Articles