【发布时间】:2019-09-22 08:33:55
【问题描述】:
我正在设置在线测试的 mcq 试卷。所以存储问题和选项的表格有这样的字段:
question_id -PRIMARY KEY ,question_description varchar(1000),option_a -varchar(100),option_b -varchar(100) ,option_c -varchar(100),option_d -varchar(100),answer -(int)
我要提出的问题是
Q) a and b volumes of solutions of concentration x% and y% respectively by volume are mixed to form a new solution of resultant concentration z%. If it is known that z is less than the average of x and y, then:
1) a>b if x>y 2) a>b if x<y 3) a<b if x>=y 4) a<b if x<y
所以当我将它插入表格时,选项没有以正确的方式出现。它是这样来的:
Q) a and b volumes of solutions of concentration x% and y% respectively by volume are mixed to form a new solution of resultant concentration z%. If it is known that z is less than the average of x and y, then:
1) a>b if x>y 2) a>b if x 3) a=y 4) a
为什么会出现这种输出?
1)a>b 如果 x>y
2)a>b 如果 x 3)a=y
4)a
插入语句是这样的:
INSERT INTO table_name(question_description,option_a,option_b,option_c,option_d,answer)
VALUES('Q) a and b volumes of solutions of concentration x% and y% respectively by volume are mixed to form a new solution of resultant concentration z%. If it is known that z is less than the average of x and y, then:','a>b if x>y ','a>b if x<y ','a<b if x>=y ','a<b if x<y ','1');
select 语句是这样的(这是第 5 个问题)
SELECT * from table_name WHERE question_id = '5';
【问题讨论】:
-
请添加您的插入语句。以及您的选择语句。
-
如何插入数据?以及如何显示/查看它?
-
鉴于缺少的部分都包含在 标签中,我建议这是关于您如何在前端和后端之间传递参数的问题。如果它们作为 xml 传递,则有一个嵌套标签
<y 3) a<b if x>,然后是一个以<b if x<y开头的未终止标签 -
@P.Salmon 在这里我在问题中添加了我的插入语句和选择语句。请帮帮我
-
你在mysql端的insert或者select都没有问题。你在哪里展示查询输出?
标签: mysql database sql-insert