CREATE VIRTUAL TABLE (FTS5)
CREATE VIRTUAL TABLE (FTS5) is a SQL statement in the SQLite Specific category. SQLite: creates a full-text search virtual table. FTS5 supports fast text search with ranking. The syntax is CREATE VIRTUAL TABLE fts_table USING fts5(col1, col2);. It returns fTS virtual table. A typical example: CREATE VIRTUAL TABLE articles_fts USING fts5(title, body); INSERT INTO articles_fts VALUES ('SQL Guide', 'This article covers SQL basics...'); SELECT * FROM articles_fts WHERE articles_fts MATCH 'SQL'; -- Full-text search across all columns SELECT *, rank FROM articles_fts WHERE articles_fts MATCH 'SQL' ORDER BY rank; -- Results with relevance ranking A close relative is AUTOINCREMENT (SQLite), which sQLite: unlike AUTO_INCREMENT in MySQL, only INTEGER PRIMARY KEY columns auto-increment. AUTOINCREMENT guarantees unique increasing IDs. A close relative is ROWID / _ROWID_, which sQLite: every row has an implicit 64-bit ROWID. INTEGER PRIMARY KEY becomes an alias for ROWID. A close relative is ATTACH DATABASE, which sQLite: connects another database file to the current connection, allowing cross-database queries.