Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
让我们说两个陈述:
CREATE TABLE words ( ID INTEGER PRIMARY KEY, word VARCHAR(25) ); CREATE INDEX idx_word ON words(word);
我可以在架构定义中设置索引吗?(我不想设置word为主键)我正在研究 Sqlite 和 Mysql。
word
是的。
word varchar(25), key (word)
你也可以说index (word)——它们是同义词。如果要命名密钥,可以说
index (word)
key `key_name` (word)
CREATE TABLE句法
CREATE TABLE