{"student_name":"wc1","student_id":"383","class_id":"class_one","subject":"gaoshu","grade":"90"} {"student_name":"wc2","student_id":"384","class_id":"class_one","subject":"gaoshu","grade":"91"} {"student_name":"wc3","student_id":"385","class_id":"class_one","subject":"gaoshu","grade":"92"} {"student_name":"wc4","student_id":"386","class_id":"class_two","subject":"dawu","grade":"93"} {"student_name":"wc5","student_id":"387","class_id":"class_two","subject":"dawu","grade":"94"} {"student_name":"wc6","student_id":"388","class_id":"class_two","subject":"dawu","grade":"95"} {"student_name":"wc7","student_id":"389","class_id":"class_three","subject":"xiandai","grade":"96"} {"student_name":"wc8","student_id":"390","class_id":"class_three","subject":"xiandai","grade":"97"} {"student_name":"wc9","student_id":"391","class_id":"class_three","subject":"xiandai","grade":"98"} {"student_name":"wc10","student_id":"392","class_id":"class_four","subject":"gailv","grade":"99"} {"student_name":"wc11","student_id":"393","class_id":"class_four","subject":"gailv","grade":"100"} {"student_name":"wc12","student_id":"394","class_id":"class_four","subject":"gailv","grade":"101"}作为json对象的形式传入表table student_score_info ( student_name string, -- 学生姓名 student_id string, -- 学号 class_id string, -- 班级ID subject string, -- 科目名 grade int -- 科目成绩 )有问题吗
时间: 2023-07-02 10:22:49 浏览: 131
是的,这个JSON对象的形式传入表的方式也存在问题。与上一个问题相似,正确的方式是将每个学生的信息放在一个JSON对象中,每个JSON对象表示一个学生的信息,例如:
```
{"student_name":"wc1","student_id":"383","class_id":"class_one","subject":"gaoshu","grade":"90"}
{"student_name":"wc2","student_id":"384","class_id":"class_one","subject":"gaoshu","grade":"91"}
{"student_name":"wc3","student_id":"385","class_id":"class_one","subject":"gaoshu","grade":"92"}
{"student_name":"wc4","student_id":"386","class_id":"class_two","subject":"dawu","grade":"93"}
{"student_name":"wc5","student_id":"387","class_id":"class_two","subject":"dawu","grade":"94"}
{"student_name":"wc6","student_id":"388","class_id":"class_two","subject":"dawu","grade":"95"}
{"student_name":"wc7","student_id":"389","class_id":"class_three","subject":"xiandai","grade":"96"}
{"student_name":"wc8","student_id":"390","class_id":"class_three","subject":"xiandai","grade":"97"}
{"student_name":"wc9","student_id":"391","class_id":"class_three","subject":"xiandai","grade":"98"}
{"student_name":"wc10","student_id":"392","class_id":"class_four","subject":"gailv","grade":"99"}
{"student_name":"wc11","student_id":"393","class_id":"class_four","subject":"gailv","grade":"100"}
{"student_name":"wc12","student_id":"394","class_id":"class_four","subject":"gailv","grade":"101"}
```
每行包含一个学生的信息,用JSON对象表示,可以正确地被表读取和分析。
阅读全文