SQLite Forum

Index question 2
Login
The index is not scoped to a table.  You do not CREATE or DROP and index within a table namespace, but within a global namespace.

That is, you create an index with `CREATE INDEX <name> ON <table> ...` and drop an index with `DROP INDEX <name>`.  

If the index name were scoped within a the table namespace you would have to specify the table name when you dropped it, as in `DROP INDEX <name> ON <table>` or `DROP INDEX <table>.<index>`.  But this is not the definition of the SQL Language.  SQL puts the index name in the global (database) namespace. (trigger names, index names, table names, stored procedure names, view names, and type names (I might be missing a few) are all in the same database scope.