tags:

views:

46

answers:

4

for example:

<SELECT statement> ::=  
    [WITH <common_table_expression> [,...n]]
    <query_expression> 
    [ ORDER BY { order_by_expression | column_position [ ASC | DESC ] } 
  [ ,...n ] ] 
    [ COMPUTE 
  { { AVG | COUNT | MAX | MIN | SUM } ( expression ) } [ ,...n ] 
  [ BY expression [ ,...n ] ] 
    ] 
    [ <FOR Clause>] 
    [ OPTION ( <query_hint> [ ,...n ] ) ] 
<query_expression> ::= 
    { <query_specification> | ( <query_expression> ) } 
    [  { UNION [ ALL ] | EXCEPT | INTERSECT }
        <query_specification> | ( <query_expression> ) [...n ] ] 
<query_specification> ::= 
SELECT [ ALL | DISTINCT ] 
    [TOP expression [PERCENT] [ WITH TIES ] ] 
    < select_list > 
    [ INTO new_table ] 
    [ FROM { <table_source> } [ ,...n ] ] 
    [ WHERE <search_condition> ] 
    [ <GROUP BY> ] 
    [ HAVING < search_condition > ] 

whats the language called?

+3  A: 

It's the Backus-Naur Form, actually the Extended Backus-Naur Form.

pmr
A: 

Since the example you provide uses "optional" brackets [...] it is actually Extended Backus Naur Form.

aioobe
+1  A: 

This is not a language, but a formal description of syntax (in this case for SQL select statements) in BNF (Backus-Naur Form).

Oded
Actually the BNF is defined through a context-free grammar and in turn is a language itself.
pmr
@pmr - But can you program with it ;)
Oded
A: 

That looks a bit like a BNF definition of part of SQL.

High Performance Mark