Share on Google+Share on Google+

MySQL Boolean Data Type

Advertisement
This example illustrates how create a boolean data type.

MySQL Boolean Data Type

This example illustrates how create a boolean data type.

In this example we create a table 't' where define four field that is 'a' which is BOOL type, 'b' which is FLOAT type, 'c' which is LONG VARCHAR type and 'd' which is NUMERIC type. The Complete table display below.

 

Query

 

CREATE TABLE t (a BOOL, b FLOAT8, c LONG VARCHAR, d NUMERIC);

 

Query

 

DESCRIBE t;

 

Output

 

+-------+---------------+------+-----+---------+-------+
| Field | Type          | Null | Key | Default | Extra |
+-------+---------------+------+-----+---------+-------+
| a     | tinyint(1)    | YES  |     |         |       |
| b     | double        | YES  |     |         |       |
| c     | mediumblob    | YES  |     |         |       |
| d     | decimal(10,0) | YES  |     |         |       |
+-------+---------------+------+-----+---------+-------+

 

Advertisements

Advertisement

Posted on: December 9, 2010 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.