Grammar for SimpleDB's Subset of SQL
<Field> |
:= IdTok |
<Constant> |
:= StrTok | IntTok |
<Expression> |
:= <Field> | <Constant> |
<Term> |
:= <Expression> = <Expression> |
<Predicate> |
:= <Term> [ AND <Predicate> ] |
|
|
<Query> |
:= SELECT <SelectList> FROM <TableList> [ WHERE <Predicate> ] |
<SelectList> |
:= <Field> [ , <SelectList> ] |
<TableList> |
:= IdTok [ , <TableList> ] |
|
|
<UpdateCmd> |
:= <Insert> | <Delete> | <Update> | <Create> |
<Create> |
:= <CreateTable> | <CreateView> | <CreateIndex> |
|
|
<Insert> |
:= INSERT INTO IdTok ( <FieldList> ) VALUES ( <ConstList> ) |
<FieldList> |
:= <Field> [ , <FieldList> ] |
<ConstList> |
:= <Constant> [ , <ConstList> ] |
|
|
<Delete> |
:= DELETE FROM IdTok [ WHERE <Predicate> ] |
|
|
<Update> |
:= UPDATE IdTok SET <Field> = <Expression> [ WHERE <Predicate> ] |
|
|
<CreateTable> |
:= CREATE TABLE IdTok ( <FieldDefs> ) |
<FieldDefs> |
:= <FieldDef> [ , <FieldDefs> ] |
<FieldDef> |
:= IdTok <TypeDef> |
<TypeDef> |
:= INT | VARCHAR ( IntTok ) |
|
|
<CreateView> |
:= CREATE VIEW IdTok AS <Query> |
|
|
<CreateIndex> |
:= CREATE INDEX IdTok ON IdTok ( <Field> ) |
|
This page has been viewed 2612 times.