Dev-tools下面的查询>资源> WebSql给出了错误,如果我逐个粘贴语句,它就会成功运行。那些交易支持ny dev-tools还是我遗漏了什么?我想加载一些数据并在websql中使用它。手动创建查询将花费很多时间。以下只是测试数据
BEGIN TRANSACTION;
CREATE TABLE topic (topic_id TEXT PRIMARY KEY NOT NULL, topic_name TEXT UNIQUE NOT NULL, "topic description" TEXT);
INSERT INTO "topic" VALUES('IV','Interview','This quiz contains questions asked during most interviews.');
INSERT INTO "topic" VALUES('AN','Angularjs','Questions relating to Angularjs');
INSERT INTO "topic" VALUES('JQ','Jquery','Questions relating to Jquery');
INSERT INTO "topic" VALUES('XT','Extra','Extra questions.');
INSERT INTO "topic" VALUES('XP','Expert','This is the fourth stage.');
INSERT INTO "topic" VALUES('AD','Advance','This is the third stage.');
INSERT INTO "topic" VALUES('IM','Intermediate','This is the second stage.');
INSERT INTO "topic" VALUES('BG','Beginner','You should start here.');
CREATE TABLE question (question_id INTEGER PRIMARY KEY, question_code TEXT UNIQUE, question TEXT NOT NULL, option1 TEXT NOT NULL, option2 TEXT NOT NULL, option3 TEXT, option4 TEXT, hint TEXT);
INSERT INTO "question" VALUES(1,'BG0101','quetion quetion quetion quetion quetion quetion quetion1','option1','option2','option3','1000','hint1');
INSERT INTO "question" VALUES(2,'BG0102','quetion quetion quetion quetion quetion quetion quetion2','option1','option2','option3','0100','hint2');
INSERT INTO "question" VALUES(3,'BG0103','quetion quetion quetion quetion quetion quetion quetion3','option1','option2','option3','0010','hint3');
INSERT INTO "question" VALUES(4,'BG0104','quetion quetion quetion quetion quetion quetion quetion4','option1','option2','option3','0001','hint4');
INSERT INTO "question" VALUES(5,'BG0105','quetion quetion quetion quetion quetion quetion quetion5','option1','option2','option3','1100','hint5');
INSERT INTO "question" VALUES(6,'BG0106','quetion quetion quetion quetion quetion quetion quetion6','option1','option2','option3','0110','hint6');
INSERT INTO "question" VALUES(7,'BG0107','quetion quetion quetion quetion quetion quetion quetion7','option1','option2','option3','0011','hint7');
INSERT INTO "question" VALUES(8,'BG0108','quetion quetion quetion quetion quetion quetion quetion8','option1','option2','option3','1001','hint8');
INSERT INTO "question" VALUES(9,'BG0109','quetion quetion quetion quetion quetion quetion quetion9','option1','option2','option3','1010','hint9');
INSERT INTO "question" VALUES(10,'BG0110','quetion quetion quetion quetion quetion quetion quetion10','option1','option2','option3','0101','hint10');
INSERT INTO "question" VALUES(11,'BG0111','quetion quetion quetion quetion quetion quetion quetion11','option1','option2','option3','1110','hint11');
INSERT INTO "question" VALUES(12,'BG0112','quetion quetion quetion quetion quetion quetion quetion12','option1','option2','option3','0111','hint12');
INSERT INTO "question" VALUES(13,'BG0113','quetion quetion quetion quetion quetion quetion quetion13','option1','option2','option3','1011','hint13');
INSERT INTO "question" VALUES(14,'BG0114','quetion quetion quetion quetion quetion quetion quetion14','option1','option2','option3','1101','hint14');
INSERT INTO "question" VALUES(15,'BG0115','quetion quetion quetion quetion quetion quetion quetion15','option1','option2','option3','1111','hint15');
INSERT INTO "question" VALUES(16,'BG0116','quetion quetion quetion quetion quetion quetion quetion16','option1','option2','option3','0011','hint16');
INSERT INTO "question" VALUES(17,'BG0117','quetion quetion quetion quetion quetion quetion quetion17','option1','option2','option3','1001','hint17');
INSERT INTO "question" VALUES(18,'BG0118','quetion quetion quetion quetion quetion quetion quetion18','option1','option2','option3','1010','hint18');
INSERT INTO "question" VALUES(19,'BG0119','quetion quetion quetion quetion quetion quetion quetion19','option1','option2','option3','0101','hint19');
INSERT INTO "question" VALUES(20,'BG0120','quetion quetion quetion quetion quetion quetion quetion20','option1','option2','option3','1000','hint20');
CREATE TABLE answer (question_id INTEGER REFERENCES question (question_id) ON DELETE CASCADE ON UPDATE CASCADE, question_code TEXT REFERENCES question (question_code) ON DELETE CASCADE ON UPDATE CASCADE, answer TEXT, answer_code INTEGER, "explain" TEXT);
INSERT INTO "answer" VALUES(1,'BG0101','remove if not needed',1000,'explian1');
INSERT INTO "answer" VALUES(2,'BG0102','remove if not needed',100,'explian2');
INSERT INTO "answer" VALUES(3,'BG0103','remove if not needed',10,'explian3');
INSERT INTO "answer" VALUES(4,'BG0104','remove if not needed',1,'explian4');
INSERT INTO "answer" VALUES(5,'BG0105','remove if not needed',1100,'explian5');
INSERT INTO "answer" VALUES(6,'BG0106','remove if not needed',110,'explian6');
INSERT INTO "answer" VALUES(7,'BG0107','remove if not needed',11,'explian7');
INSERT INTO "answer" VALUES(8,'BG0108','remove if not needed',1001,'explian8');
INSERT INTO "answer" VALUES(9,'BG0109','remove if not needed',1010,'explian9');
INSERT INTO "answer" VALUES(10,'BG0110','remove if not needed',101,'explian10');
INSERT INTO "answer" VALUES(11,'BG0111','remove if not needed',1110,'explian11');
INSERT INTO "answer" VALUES(12,'BG0112','remove if not needed',111,'explian12');
INSERT INTO "answer" VALUES(13,'BG0113','remove if not needed',1011,'explian13');
INSERT INTO "answer" VALUES(14,'BG0114','remove if not needed',1101,'explian14');
INSERT INTO "answer" VALUES(15,'BG0115','remove if not needed',1111,'explian15');
INSERT INTO "answer" VALUES(16,'BG0116','remove if not needed',11,'explian16');
INSERT INTO "answer" VALUES(17,'BG0117','remove if not needed',1001,'explian17');
INSERT INTO "answer" VALUES(18,'BG0118','remove if not needed',1010,'explian18');
INSERT INTO "answer" VALUES(19,'BG0119','remove if not needed',101,'explian19');
INSERT INTO "answer" VALUES(20,'BG0120','remove if not needed',1000,'explian20');
CREATE TABLE image (question_id INTEGER REFERENCES question (question_id) ON DELETE CASCADE ON UPDATE CASCADE, img_src TEXT);
CREATE TABLE user (topic_id TEXT REFERENCES topic (topic_id) ON DELETE CASCADE ON UPDATE CASCADE, attempt INTEGER, score INTEGER);
CREATE UNIQUE INDEX question_code ON question (question_code);
COMMIT;