SQLite基础学习 互动版

说明:

  SQLite 的indexed by子句 就是利用索引来对数据库进行操作,这样能加快速度。

语法:

SELECT|DELETE|UPDATE column1, column2...
INDEXED BY (index_name)
table_name
WHERE (CONDITION);

实例:

  在student中创建一个索引。

create index student_index on student(ADDRESS);

  就像下面这样使用就可以:

sqlite> select * from student indexed by student_index where ADDRESS='shenzhen';
ID          NAME        AGE         ADDRESS
----------  ----------  ----------  ----------
5           honghong    17          shenzhen
7           tingting    23          shenzhen