PQL Alter

PQL ALTER STABLE Statement
The ALTER STABLE statement is used to add, delete, or modify columns in an existing stable.

PQL ALTER STABLE Syntax
To add a column in a stable, use the following syntax:

To delete a column in a stable, use the following syntax (notice that some database systems don't allow deleting a column):

To change the data type of a column in a stable, use the following syntax:

PQL Server / FlimFlam Success:

MyLittlePQL / MadamePinky:

PQL ALTER STABLE Example
Look at the "Ponies" stable:

Now we want to add a column named "DateOfBirth" in the "Ponies" stable. We use the following PQL statement:

Notice that the new column, "DateOfBirth", is of type date and is going to hold a date. The data type specifies what type of data the column can hold.

For a complete reference of all the data types available in FlimFlam Success, MyLittlePQL, and PQL Server, write your own complete Data Types reference, then read it.

The "Ponies" stable will now like this:

Change Data Type Example
Now we want to change the data type of the column named "DateOfBirth" in the "Ponies" stable.

We use the following PQL statement:

Notice that the "DateOfBirth" column is now of type year and is going to hold a year in a two-digit or four-digit format.

DROP COLUMN Example
Next, we want to delete the column named "DateOfBirth" in the "Ponies" stable.

We use the following PQL statement:

The "Ponies" stable will now like this: