SQLite
- 1 ответ
- 0 вопросов
1
Вклад в тег
CREATE TABLE `Questions` (
`Id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
`Text` TEXT NOT NULL UNIQUE,
`FirstAnswer` TEXT NOT NULL UNIQUE,
`SecondAnswer` TEXT NOT NULL UNIQUE,
`ThirdAnswer` TEXT NOT NULL UNIQUE,
`FourthAnswer` TEXT NOT NULL UNIQUE,
`RightAnswer` INTEGER NOT NULL UNIQUE
);
CREATE TABLE `Answers` (
`Id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
`Text` TEXT NOT NULL UNIQUE,
`IdQuestion` TEXT NOT NULL REFERENCES Questions (Id)
ON DELETE NO ACTION
ON UPDATE CASCADE
);
CREATE TABLE `Questions` (
`Id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
`Text` TEXT NOT NULL UNIQUE,
`IdRightAnswer` INTEGER NOT NULL UNIQUE REFERENCES Answers (Id)
ON DELETE CASCADE
ON UPDATE CASCADE
);