About us Privacy Disclaimer Contact us
FAQ Help Advertising Feedback
Home Sitemap Search Donate us

  Home > Computer & I'net > Column Modifiers...

   Browse by title articles:
   What is hot:

MySQL Introduction

Planning database structure

MySQL Database Data Types

Column Modifiers

CREATE DATABASE

CREATE TABLE

Accessing Arrays
Include
DHTML-Introduction
Advanced 404 Pages
 1 2Next articles



Column Modifiers


Computer & I'net articlesColumn Modifiers

by David Stanley    



A column modifier is an extra addon command to help the database organize and work better.

As mentioned on the previous page, the integer types have an extra option called UNSIGNED. Normally, the integer goes from an negative to positive value. Using an UNSIGNED command will move that range up so it starts at zero instead of a negative number.

Other modifier commands are : INDEX, UNIQUE, PRIMARY KEY, AUTO_INCREMENT, NULL, NOT NULL, DEFAULT, BINARY, and ZEROFILL.

Indexing is a way to improve a database performance. You are telling the database that THIS specific column is special and may help organize the data. If there is a column you will be referring to often, it would probably be the best to be an INDEX column.

An INDEX column may have more than one cell holding the same data value. The two other index types are UNIQUE and PRIMARY KEY. UNIQUE states that each cell in the column should have a unique value. PRIMARY KEY is a special variety of the UNIQUE command.

The AUTO_INCREMENT modifier works on any of the integer types. Each time a new row is added into the database table, the number in this column will appear and automatically increase by one from the previous row.

NULL is no value. It is not space, it is not zero. A majority of the time you will want to specify a field to be NOT NULL so that any blank entries will be considered as "something".

DEFAULT will assign a default value to a cell if nothing is entered for the value. It will work on most data types except BLOB and TEXT.

BINARY is used with CHAR and VARCHAR types. It causes the values to be treated as "binary strings" making them CaSe SeNsItIvE.

ZEROFILL is used with numeric data types. It will display leading zeros of a number based on the display width.




-----------------
Article by David Stanley. Visit his site http://www.htmlite.com. Reprinted with permission.




Articles

Auto & Trucks

Business

Computer & I'net

  ·General

  ·Apache

  ·CSS

  ·Database

  ·Hardware

  ·HTML

  ·Javascript&DHTML

  ·Linux

MySQL

  ·Operating System

  ·Perl / CGI

  ·PHP

  ·Programming

  ·Publishing

  ·Search Engines

  ·Software Problems

  ·SSI

  ·Tips & Tricks

  ·Utilities

  ·Web Design

Family

Food & Drink

Gardening

Health

Other

Pets

Psychology

Spiritual

Travel

Women

 Calculators

Retirement




  Disclaimer | Privacy | Terms of useCopyright © 2004 Nice2know.com