MySQL Tutorial/Data Types/BLOB

Материал из SQL эксперт
Перейти к: навигация, поиск

BLOB column

mysql>
mysql> CREATE TABLE Inventory
    -> (
    ->    ID SMALLINT UNSIGNED,
    ->    Name VARCHAR(40),
    ->    Photo BLOB,
    ->    Quantity INT UNSIGNED
    -> );
Query OK, 0 rows affected (0.03 sec)
mysql>
mysql> desc Inventory;
+----------+----------------------+------+-----+---------+-------+
| Field    | Type                 | Null | Key | Default | Extra |
+----------+----------------------+------+-----+---------+-------+
| ID       | smallint(5) unsigned | YES  |     | NULL    |       |
| Name     | varchar(40)          | YES  |     | NULL    |       |
| Photo    | blob                 | YES  |     | NULL    |       |
| Quantity | int(10) unsigned     | YES  |     | NULL    |       |
+----------+----------------------+------+-----+---------+-------+
4 rows in set (0.01 sec)
mysql>
mysql>
mysql> drop table Inventory;
Query OK, 0 rows affected (0.00 sec)