I know that transitive-closure concept is used for storing tree structures data. This concept also used to retrieve hierarchical data in very efficient and quickly with minimum complex query.
In SQLite Query browser, I have tried these queries:
CREATE TABLE category (
id INTEGER NOT NULL PRIMARY KEY,
name VARCHAR(255),
parent_id INTEGER,
FOREIGN KEY (parent_id) REFERENCES category (id)
);
CREATE VIRTUAL TABLE category_closure USING transitive_closure (
tablename="category",
idcolumn="id",
parentcolumn="parent_id"
);
I am able to create table using query no. 1 but query no. 2 is not working.
Can someone provide specific example in Android using SQLite?