Spliting one table into two while keeping relationship

Discussion in 'MySQL' started by jaanFX, Feb 1, 2016.

  1. #1
    Hey guys,
    I have a mysql table that has a list of songs with album name, so basically I want to split this table into two tables, one with only album name and one with song name. Table with song name will include ID of the album name.
    Current table: music
    id album song url
    ---------------------------------------------
    1 hello song title 1 song1.mp3
    2 hello song title 2 song2.mp3

    from this i want one table called: album
    id album
    1 hello

    2nd table called: song
    id album_id song url
    ----------------------------------------------
    1 1 song title 1 song1.mp3
    2 1 song title 2 song2.mp3

    How can I do that purely from MySQL command via phpMyAdmin?
     
    jaanFX, Feb 1, 2016 IP