home support FAQ resources services partners contact us contact us
 MySQL Tutorial Previous  Next  
 

The president Table

The president table is simpler, so let's discuss it first. This table will contain some basic biographical information about each United States president:

Name. Names can be represented in a table several ways. For example, we could have a single column containing the entire name or separate columns for the first and last name. It's certainly simpler to use a single column, but that limits you in some ways:

If you enter the names with the first name first, you can't sort on last name.

If you enter the names with the last name first, you can't display them with the first name first.

It's harder to search for names. For example, to search for a particular last name, you must use a pattern and look for names that match the pattern. This is less efficient and slower than looking for an exact last name.

To avoid these limitations, our president table will use separate columns for the first and last names.

The first name column will also hold the middle name or initial. This shouldn't break any sorting we might do because it's not likely we'll want to sort on middle name (or even first name). Name display should work properly, too, because the middle name immediately follows the first name regardless of whether a name is printed in "Bush, George W." or in "George W. Bush" format.
Previous  Next  
Link Partners: Asia florist, Flowers to India, Hongkong flowers, Site submit, Cheap web hosting, China florist