Difference between revisions of "MySQL"

Jump to navigation Jump to search
1,065 bytes added ,  12:20, 11 February 2010
m
→‎Data Types: Added "Numbers"
m (→‎Insert / Update Rows: Added Syntax Highlight)
m (→‎Data Types: Added "Numbers")
Line 37: Line 37:
To set a field to NULL, use NULL without any quotes eg...
To set a field to NULL, use NULL without any quotes eg...
<source lang="mysql">INSERT INTO table (col1, col2) VALUES ('data1', NULL); </source>
<source lang="mysql">INSERT INTO table (col1, col2) VALUES ('data1', NULL); </source>
=== Numbers ===
<code> BOOL </code> and <code> BOOLEAN </code> are synonyms for <code> TINYINT(1) </code>.
{|cellpadding="2" cellspacing="0" border="1"
! Type              !! Bytes !! Min    !! Max
|-
| <code> TINYINT  </code>          || 1    || -128                  || 127
|-
| <code> TINYINT UNSIGNED </code>  || 1    || 0                    || 255
|-
| <code> SMALLINT </code>          || 2    || -32768                || 32767
|-
| <code> SMALLINT UNSIGNED </code>  || 2    || 0                    || 65535
|-
| <code> MEDIUMINT </code>          || 3    || -8388608              || 8388607
|-
| <code> MEDIUMINT UNSIGNED </code> || 3    || 0                    || 16777215
|-
| <code> INT  </code>              || 4    || -2147483648          || 2147483647
|-
| <code> INT UNSIGNED </code>      || 4    || 0                    || 4294967295
|-
| <code> BIGINT </code>            || 8    || -9223372036854775808  || 9223372036854775807
|-
| <code> BIGINT UNSIGNED </code>    || 8    || 0                    || 18446744073709551615
|}


=== IP Addresses ===
=== IP Addresses ===

Navigation menu