On Wed, Apr 20, 2011 at 2:58 PM, Jonathan Allin
<jonat...@jonathanallin.com>wrote:

> The "Chinook" SQL script for creating the database contains many commands
> with brackets, eg
>
>
>
> DROP TABLE IF EXISTS [Album];
>
>
>
> What do the brackets do?


The [...] quote the identifier they contain, thus allowing the identifier to
be a keyword or to contain non-alphanumeric characters.

The [...] are not standard SQL.  Standard SQL to do the same thing would be
to enclose the identifier in double-quotes:  "Album".  The support for [...]
in SQLite for compatibility with MS Sql Server.  SQLite also supports
grave-accent quoting:  `Album` for compatibility with MySQL.


-- 
D. Richard Hipp
d...@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to