I have a MySQL db which needs to be exported to a CSV file. Google told me about a lot of examples for doing this, but all the examples are for exporting just a single table.
Could anyone please help with exporting some data in a particular way (given below)?
The database is like this:
artist
- id
- name
album
- id
- name
title
- id
- artist_id <- FK
- album_id <- FK
- name
title has FK fields which point to artist name and album name.
How can do the export so that the output csv file looks like this:
column1 (artist), column2 (album), column3 (title)
John, The Latest, First Song
John, Work in progress, Nice song
John, California, Oh SF
Luke, My Songs, One Song
Luke, My Songs, Two Song
Luke, Collected Works, Magnum Opus
Tom, My works, I song
Tom, My works, II song
Tom, My works, III song
TIA.

SQL yogorphpmyadmin?