List:General Discussion« Previous MessageNext Message »
From:David Turner Date:March 25 2012 5:47pm
Subject:Re: OT: SQL Question
View as plain text  
Jeff,

I would use a join table, teacher_flights.

create table teacher_flights(
teacher_id int(11) not null,
flight_id int(11) not null,
primary key(teacher_id, flight_id));

Dave




>________________________________
> From: Mark Phillips <mark@stripped>
>To: Mysql List <mysql@stripped> 
>Sent: Friday, March 23, 2012 7:28 PM
>Subject: OT: SQL Question
> 
>My question is not specific to MySQL, even though I am using a MySQL db for
>this project. I have a servlet/jsp/MySQL web site in production, and there
>are about 2,000 records in the flights table. One of the foreign keys is
>teacher_id. Up to this point, there is a one to many relationship between
>teacher_id and the data in the flights table. I need to change the data
>model to allow for a many to many relationship between teacher_id and the
>data in the flight table. What is the best way to do this?
>
>Thanks,
>
>Mark
>
>
>
Thread
OT: SQL QuestionMark Phillips24 Mar
  • Re: OT: SQL QuestionMichael Dykman24 Mar
  • Re: OT: SQL QuestionDavid Turner25 Mar