:: TSP Menu
- Home
- Authors
- Glossary
- RSS Feed
- Contact Us
:: Servers
- CPanel
- Hosting
- Linux
- Windows
:: Webmaster
- Databases
- Design
- PHP
- Search Engines
:: Scripts
- Scripts
:: Documentation
- PHP Manual
|
Quick MySQL Cheat Sheet/Quick Reference Author: Wojjie
Posted: (2005-03-14) Viewed: (6797 times)
Introduction:
There are various little details that I always end up having to lookup on the MySQL documentation, so I thought I would put together a 'Cheat Sheet' and make it publicly available for all to use. This 'Cheat Sheet' will be updated constantly.
Numeric Types: (Found in: MySQL :: 11.2 Numeric Types)
| Type | Bytes | Minimum Value | Maximum Value |
| TINYINT | 1 | -128 | 127 |
| TINYINT UNSIGNED | 1 | 0 | 255 |
| SMALLINT | 2 | -32,768 | 32,767 |
| SMALLINT UNSIGNED | 2 | 0 | 65,535 |
| MEDIUMINT | 3 | -8,388,608 | 8,388,607 |
| MEDIUMINT UNSIGNED | 3 | 0 | 16,777,215 |
| INT | 4 | -2,147,483,648 | 2,147,483,647 |
| INT UNSIGNED | 4 | 0 | 4,294,967,295 |
| BIGINT | 8 | -9,223,372,036,854,775,808 | 9,223,372,036,854,775,807 |
| BIGINT UNSIGNED | 8 | 0 | 18,446,744,073,709,551,615 |
| Type | Bytes | Precision | |
| FLOAT | 4 | 0-23 | |
| DOUBLE | 8 | 24-53 | |
String Types: (Found in: MySQL :: 11.4 String Types)
| Type | Max Size (Bytes) |
| CHAR | 255 |
| VARCHAR | 255 |
| BINARY | 255 |
| VARBINARY | 255 |
| TINYTEXT | 255 |
| TEXT | 65,535 |
| MEDIUMTEXT | 16,777,215 |
| LONGTEXT | 4,294,967,295 |
| TINYBLOB | 255 |
| BLOB | 65,535 |
| MEDIUMBLOB | 16,777,215 |
| LONGBLOB | 4,294,967,295 |
Quick SQL Reference:
Transaction:
- MySQL :: 13.4.1 START TRANSACTION, COMMIT, and ROLLBACK Syntax
START TRANSACTION;
.. sql ..
COMMIT;
Change of Table Engine:
- MySQL :: 14 MySQL Storage Engines and Table Types
- MySQL :: 13.2.6 CREATE TABLE Syntax
ALTER TABLE [table_name] engine=[engine_name];
Conditional Statements (IF):
- MySQL :: 12.2 Control Flow Functions
SELECT IF(1=2,'you should not be able to see this!','correct (false statement)');
|
|
Links: Game-Monitor
Home-Recipes
Game Server Sites
|
|