Skip to content

Commit f268935

Browse files
committed
Update README.md
1 parent 7a6127e commit f268935

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

README.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,9 +417,29 @@ A list of data types used in MySQL database. This is based on MySQL 8.0.
417417
<b><a href="#table-of-contents">↥ back to top</a></b>
418418
</div>
419419
420-
## Q. What is the difference between blob and text data type in sql?
420+
## Q. What is the difference between blob and text data type in MySQL?
421421
422-
*ToDo*
422+
BLOB stands for Binary Large Objects and as its name suggests, it can be used for storing binary data while TEXT is used for storing large number of strings. BLOB can be used to store **binary data** that means we can store pictures, videos, sounds and programs also.
423+
424+
BLOB values behave like byte string and BLOB does not have a character set. Therefore, comparison and sorting is fully dependent upon numeric values of bytes.
425+
426+
TEXT values behave like non-binary string or character string. TEXT has a character set and the comparison/ sorting fully depends upon the collection of character set.
427+
428+
**Creating a table with TEXT data type:**
429+
430+
```sql
431+
mysql> create table TextTableDemo ( Address TEXT );
432+
433+
mysql> DESC TextTableDemo;
434+
```
435+
436+
**Creating a table with BLOB type:**
437+
438+
```sql
439+
mysql> create table BlobTableDemo ( Images BLOB );
440+
441+
mysql> desc BlobTableDemo;
442+
```
423443
424444
<div align="right">
425445
<b><a href="#table-of-contents">↥ back to top</a></b>

0 commit comments

Comments
 (0)