You may create or drop tables, indexes or views using the following functions.
create-table name description &key database
Creates a table called name and defines its columns and other properties with description . The description argument is a list of lists of attribute names followed by type information. For example:
(create-table [manager]
'(([id] (char 10) not-null )([salary] integer)))
is equivalent to the following SQL:
CREATE TABLE MANAGER
(ID CHAR(10) NOT NULL,SALARY INTEGER)
drop-table name &key database
Deletes table name from database .
create-index name &key on unique attributes database
Creates an index called name on table on using attributes . For example:
(create-index [manager]
:on [emp]
:unique t
:attributes '([ename] [sal]))
drop-index name &key database
Deletes index name from database .
create-view name &key column-list as with-check-option database
Creates a view called name using the query as and the optional column-list and with-check-option .
This example creates the view manager
with the records in the employee table whose job title is MANAGER
.
(create-view [manager]
:as [select [*] :from [emp] :where
[= [job] "MANAGER"]])
drop-view name &key database
Deletes view name from database .