Skip to Content
Oracle SQL: the Essential Reference
book

Oracle SQL: the Essential Reference

by David C. Kreines
September 2000
Intermediate to advanced
418 pages
11h 5m
English
O'Reilly Media, Inc.
Content preview from Oracle SQL: the Essential Reference

1.1. Lexical Conventions

SQL statements are composed of commands, variables, and operators, which are described in detail in this and subsequent chapters. A SQL statement is constructed from:

  • Characters A through Z (or the equivalent from your database character set)

  • Numbers 0 through 9

  • Spaces

  • The following special characters: + - * = ? ! @ ( ) _ . , < > | $ #

Oracle strongly discourages the use of # and $.

Other characters, such as &, are also used in SQL statements, but may be intercepted and interpreted by SQL*Plus if you are using that tool. See Chapter 6 for more information.

A SQL statement can contain one or more of the following items anywhere a single space can occur:

  • Tab

  • Carriage return

  • Multiple spaces

  • Comments

Certain components of SQL statements (such as variable names and strings) may contain other characters, as long as they are enclosed in double quotes.

The following two SELECT statements, for example, are evaluated in exactly the same way by Oracle and both return the same result set:

SELECT ename,empno,sal FROM scott.emp WHERE sal>500;

SELECT ename, 
       empno, sal
FROM   scott.emp
WHERE  sal > 500;

SQL is generally not case-sensitive, so case is not significant except in literals, which are enclosed in quotes.

Be aware that a variable name enclosed in double quotes will ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Oracle Database 12c The Complete Reference

Oracle Database 12c The Complete Reference

Kevin Loney, Bob Bryla
Oracle SQL Developer

Oracle SQL Developer

Ajith Narayanan, Susan Harper
Oracle PL/SQL for DBAs

Oracle PL/SQL for DBAs

Arup Nanda, Steven Feuerstein

Publisher Resources

ISBN: 1565926978Catalog PageErrata