faqts : Computers : Databases : MySQL : Language and Syntax : Queries : Alter Table

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

38 of 39 people (97%) answered Yes
Recently 10 of 10 people (100%) answered Yes

Entry

How can I add a column to a table?

Jan 24th, 2000 19:08
Nathan Wallace, Julie Meloni


ALTER TABLE [tblName] ADD [colName, colType, colSize, colOptions, ...]

i.e.

ALTER TABLE COOL_STUFF ADD PHP_SCRIPT_NAME varchar(100)

adds a column called "PHP_SCRIPT_NAME" to a table called "COOL_STUFF".  
The column "PHP_SCRIPT_NAME" is of the varchar type with a limit of 100
characters.

Manuals are our friends:

  http://www.mysql.com/Manual_chapter/manual_Reference.html#ALTER_TABLE