MySQL

MySQL Rename a Table or Column

MySQL Rename a Table or Column

Summary As of MySQL 5.0, renaming a table is trivial with the “rename table” function. Renaming a column was a little cryptic, even looking at the documentation. Here are a couple of concrete examples. To rename a table from “lu_wind_direction” to “lu_direction”: To rename a column called “wind_speed” to “speed” in the table named “spacetime”: So, when renaming a…

MySQL Data Types: Quick Reference Table

MySQL Data Types: Quick Reference Table

The MySQL data-types table in Open Document format (much better for printing). Type {storage} Name Range Attributes Default Numeric{1 byte} TINYINT[(M)] -128 TO 127[0 to 255 if UNSIGNED] AUTO_INCREMENTUNSIGNED, ZEROFILL,SERIAL DEFAULT VALUE NULL[0 if NOT NULL] Numeric{2 bytes} SMALLINT[(M)] -32,768 to 32,767[0 to 65,535] AUTO_INCREMENT,UNSIGNED, ZEROFILL,SERIAL DEFAULT VALUE NULL[0 if NOT NULL] Numeric{3 bytes} MEDIUMINT[(M)] -8,388,608 to 8,388,607[0 to 16,777,215] AUTO_INCREMENT,UNSIGNED,…