SQL Grammar

Product Specifics / SAP HANA Cloud

Introduction

Following is a list of the styles we standardize to make SQL grammar easy and fast to read for users. To see examples of how these styles look in documentation, visit the SAP HANA Cloud SQL Reference Guide.

Syntax Section

Likely the most complex feature of a statement or function topic, the main syntax block is an abbreviated Backus-Naur Form (BNF) that gives the layout of the statement and its clauses.

We do this because full BNF representations can be several pages long, and difficult to follow because they exhaustively iterate through all possibilities. By compacting the grammar enough to fit at the top of a topic, we deliver an at-a-glance understanding of the structure of the grammar.

Other styles that we apply—for example, consistent bracketing, casing, whitespace, and indenting—convey even more information to users about:

Here is a list of conventions we apply:

Example 1: CREATE INDEX Statement (found here)

CREATE [ <index_type> ] INDEX <index_name> ON <table_name>                     ( <column_name_order_entry>[, <column_name_order_entry> [,...])                      [ <global_index_order> ]                      [ <fillfactor> ]                      [ NOWAIT ]                      [ ONLINE ]                      [ <load_unit> ]                     

Syntax Elements

Permissions Section

Examples Section

Make sure that your examples follow the SQL Notation guidelines listed above.

Also, use copy, pastable, and runnable examples, not fictitious ones for inspiration. If necessary, ask the engineers for simple and runnable examples. However, if the example looks too long or complicated to include, just switch excerpts from a working one. For example, when you have to create a remote source to show how to use options on a remote source. In either case, be sure to apply the style guidelines to the examples, with the exception of the white-spacing guidelines.

SQL/SQLScript Announcement Process

SQL Announcement emails alert downstream stakeholder teams (like UA) that a change to the SQL and/or SQLScript grammar has been merged to the codeline. For information about the process, go to SQL/SQLScript Announcement Process.

Support

If you have any feedback or questions, reach out to Laura Nevin and Aaron Patkau.