title: How to create a many to many relationship in SQLite DB
body: <p>Im trying to figure out how to create a many to many relationship between my train table, and station table. I know I need a intermediate table, which I created I feel like I'm going in a loop thinking about what to do. I'll have a link to the data that explains the relationships between my tables and my schema below. 
  The only columns I'm looking at in this data are: </p>
  
  <p>"GTFS_STOP_ID"(Id code for the Stop_Name), 
  "Stop_Name"(Name of train station), and 
  "Daytime Route"(which are the trains)</p>
  
  <p>-One train can have many stations, and one station can also have many trains which is why in the "Daytime Routes" column you can see multiple trains. (For ex. N, W for the first row) </p>
  
  <p>-How would I accurately depict relationships between these 3 columns in my csv, in my SQLITE database? </p>
  
  <p><a href="http://web.mta.info/developers/data/nyct/subway/Stations.csv" rel="nofollow noreferrer">Link to data(apologies for the csv in advance as it's the only thing I was able to find online</a></p>
  
  <pre><code>     cur.execute("""DROP TABLE IF EXISTS train""")
       cur.execute(
       """     CREATE TABLE train(
              pk INTEGER PRIMARY KEY AUTOINCREMENT,
              train_name VARCHAR
          );""")
  
      cur.execute("""DROP TABLE IF EXISTS station""")
      cur.execute(
      """     CREATE TABLE station(
              pk INTEGER PRIMARY KEY AUTOINCREMENT,
              stop_id VARCHAR,
              station_name VARCHAR
  
          );""")
  
      cur.execute("""DROP TABLE IF EXISTS train_station""")
      cur.execute(
      """     CREATE TABLE train_station(
              train_pk INTEGER,
              station_pk INTEGER,
              FOREIGN KEY (station_pk) REFERENCES station(pk)
              FOREIGN KEY (train_pk) REFERENCES train(pk)
  
          );"""
          )
  </code></pre>