CREATE { CLASS | TABLE } <class name>
[ <subclass definition> ]
[ ( <class element comma list> ) ]
[ CLASS ATTRIBUTE ( <attribute definition comma list> ) ]
[ ( <class constraint or attribute definition comma list> ) ]
CREATE { VCLASS | VIEW } <class name>
[ <subclass definition> ]
[ CLASS ATTRIBUTE ( <attribute definition comma list> ) ]
[ ( <view attribute definition comma list> ) ]
[ INHERIT <resolution comma list> ]
[ AS <query statement> ]
[ WITH CHECK OPTION ]
CREATE TRIGGER <trigger name>
[ STATUS { ACTIVE | INACTIVE } ]
[ PRIORITY <trigger key> ]
<trigger event time> <event specification>
[ IF <trigger condition> ]
EXECUTE [ <trigger action time> ] <trigger action>
CREATE SERIAL <serial name>
[ START WITH <integer literal> ]
AS SUBCLASS OF <class name comma list>
{ <class constraint definition> | <attribute definition> }
[ CONSTRAINT <constraint name> ] UNIQUE ( <attribute name comma list> )
| [ PRIMARY KEY ( <attribute name comma list> ) ]
| [referential constraint]
<general attribute name> <attribute type>
[ <default or shared> ]
[ <attribute constraint list> ]
<attribute definition> | <attribute name>
<attribute definition> | <class constraint>
<resolution> [ { , <resolution> }... ]
<general attribute name> OF <class name> [ AS <attribute name> ]
<view attribute definition> [ { , <view attribute definition> }... ]
<attribute definition> | <attribute name>
<unsigned real literal>
BEFORE | AFTER | DEFERRED
INSERT ON <event class target>
| STATEMENT INSERT ON <event class target>
| UPDATE ON { <event class target> | <event class attribute target> }
| STATEMENT UPDATE ON { <event class target> | <event class attribute target> }
| DELETE ON <event class target>
| STATEMENT DELETE ON <event class target>
| COMMIT
| ROLLBACK
<class name>
<class name> ( <attribute name> )
<search condition>
AFTER | DEFERRED
REJECT
| INVALIDATE TRANSACTION
| PRINT <string literal>
| <call statement>
| <insert statement>
| <delete statement>
| <update statement>
[ CLASS ] <attribute name>
[ CLASS ] <method name>
<domain name>
<domain name>
<domain name>
FOREIGN KEY
[constraint name] (attribute name comma list)
REFERENCES
[referenced table name] (attribute name comma list)
[ <referential triggered action> ]
<update rule>
[ <delete rule> [ <cache object rule> ] ]
ON UPDATE <referential action>
ON DELETE <referential action>
ON CACHE OBJECT <cache object column name>
<attribute name>
CASCADE | RESTRICT | NO ACTION
CREATE CLASS address (street string, city string);
CREATE CLASS person (
name string,
birthday date,
residence address,
UNIQUE (name))
METHOD get_age () integer
FILE "/p/xsql/current/bin/person.o";
CREATE CLASS album
(id char(10) NOT NULL PRIMARY KEY,
title varchar(100),
artist varchar(100)
);
CREATE CLASS track
(album char(10),
dsk integer,
posn integer,
song varchar(255),
FOREIGN KEY (album) REFERENCES album(id)
);