MySQL Table Structure


#1

Hi,

I am trying to create two tables route_details, passenger_details to contain data as below. I am not able to understand how the both data base schema should be. Passenger details is one more table which comes attached depending on when date in travel_date field of route_details matches date in boarding_date_time field.

Also i am wondering if i write the below data as is and make a POST in MySQL API DOCS to route_details table, will the DF create 1 row in route_details table and 2 rows in passenger_details table?

[

{“route_num”:“33A”,
“travel_date”:“02-04-2016”,
“coach_num”:“KA-07-TT-747”,
“available_seats”:3,
“captain1_details”:“raju”,
“origin”:“Bangalore”,
“destination”:“Mumbai”,
“passenger_details”:[{
“pnr_number”:“254444”,
“title”:“Mr”,“name”:“Ravi P”,
“age”:17,“mobile”:“9988775858”,
“bording_date_time”:“2016-04-02 09:05 PM”
},
{
“pnr_number”:“254445”,
“title”:“Mr”,“name”:“Raju G”,
“age”:19,“mobile”:“9988778898”,
“bording_date_time”:“2016-04-02 09:05 PM”
},
]}

I am a hardware engineer, And don’t have much idea about mySQL or tables
Any help would be appreciated.
Thanks in Advance.
Ravi