Article Preview
Buy Now
COLUMN
Deep Dive on Creating MySQL Tables Part 2
Column Names, Data Types, Null Options, Constraints, and some Index Options
Issue: 11.2 (March/April 2013)
Author: Craig Boyd
Author Bio: Craig Boyd is currently a Sr. Data Modeler for a well-known national retailer. But in his 17 years of IT experience, he has been everything from a PC Technician to iSeries System Administrator to iSeries Programmer and Sr. Technical Lead. He lives in the great state of Texas with his wife and two kids.
Article Description: No description available.
Article Length (in bytes): 15,973
Starting Page Number: 76
Article Number: 12113
Related Link(s): None
Excerpt of article text...
Last time we talked about the different kinds of tables that could be created in MySQL as well as a couple of different ways to create them. For this next installment, we are going to talk about the next section of the CREATE TABLE statement, the column definition. The column definition section encompasses the column names, data types, null options, constraints, and some index options.
The first thing we need to discuss is the column name. MySQL refers to table names, column names, index names, etc., as identifiers. As identifiers, they all have the same or similar limitations. So what that basically means is that table and column names must adhere to the following rules:
Can't be more than 64 characters long.
Must consist of A-Z, a-z, 0-9, $, and _ (underscore).
Can start with a number, but cannot consist entirely of numbers without being quoted.
Databases, tables, and columns cannot end in spaces.
...End of Excerpt. Please purchase the magazine to read the full article.