FANDOM



PQL CREATE STABLE Statement

The CREATE STABLE statement is used to create a stable in a database.

PQL CREATE STABLE Syntax

Spike: Please
CREATE STABLE stable_name
(
column_name1 data_type,
column_name2 data_type,
column_name3 data_type,
....
)

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.

CREATE STABLE Example

Now we want to create a stable called "Ponies" that contains five columns: P_Id, LastName, FirstName, Address, and City.

We use the following CREATE STABLE statement:

Spike: Please CREATE STABLE Ponies (P_Id INT, LastName VARCHAR(255), FirstName VARCHAR(255), Address VARCHAR(255), City VARCHAR(255) )

The P_Id column is of type int and will hold a number. The LastName, FirstName, Address, and City columns are of type varchar with a maximum length of 255 characters.

The empty "Ponies" stable will now look like this:

P_Id LastName FirstName Address City

The empty stable can be filled with data with the INSERT INTO statement.



PQL Create DB PQL Constraints

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.