I have the following tables: CREATE TABLE "projects" ( "projectID" TEXT PRIMARY KEY, "groupID" TEXT, "isPersonal" INTEGER NOT NULL CHECK(ispersonal in (0, 1)), "name" TEXT, "description" TEXT, "outcome" TEXT ); CREATE INDEX projects_groupID_idx ON projects(groupID);
CREATE TABLE "subprojects" ( "subprojectID" TEXT PRIMARY KEY, "projectID" TEXT, "parentID" TEXT, "name" TEXT, "description" TEXT, "outcome" TEXT ); CREATE INDEX subprojects_projectID_idx ON projects(projectID); CREATE INDEX subprojects_parentID_idx ON subprojects(parentID); ?The idea is that a project can have several subprojects. And a subproject can also have several subprojects. Is there a way to use a SQL statement to verify that the data is not corrupt? (Everything should be a tree.) Also is there a SQL command to verify the debt is not more as for example five?? -- Cecil Westerhof