我有個問題!我真的不知道怎么解釋,所以我來說明一下!我知道如何在 SQL 上制作具有這種形狀的表格:var data = { "news" :[ { "title" : "I am the title 1", "number of views" : 28, "text" : "Here is the text", "date of publication" : "13 March" }, { "title" : "I am the title 2", "number of views" : 57, "text" : "Here is the text", "date of publication" : "24 May" ] }, { "title" : "I am the title 3", "number of views" : 74, "text" : "Here is the text", "date of publication" : "27 May" } ]};現在我希望能夠創建一個具有這種形狀的表格:var data = { "staff member" :[ { "First name" : "John", "Last name" : "Doe", "schedules" : [ "Friday : 14h - 22h", "Saturday : 10h - 19h", "Sunday : 10h - 19h" ] }, { "First name" : "Amelia", "Last name" : "Doe", "schedules" : [ "Friday : 18h - 23h", "Saturday : 9h - 17h", "Sunday : 8h - 20h" ] } ]};看到不同?對不起,如果它有點混亂,但我真的不知道該怎么稱呼它!我認為這可以通過創建另一個表并找到自己的名字、姓氏和時間表的通用 ID 來完成。但一定有更簡單的方法,對吧?所以我的問題很簡單,這可能嗎?如果是這樣,如何?我是用 JSON 做的,但現在我想切換到 MySQL,我不知道該怎么做!
使用數組創建 SQL 表
慕蓋茨4494581
2021-11-13 10:24:14