This gets the song_id and the number of sales of the three most purchased songs: --------------------------------------------------------------------- SELECT `music_purchased`.`song_id`, COUNT(`song_id`) AS 'sales' FROM `music_purchased` GROUP BY `song_id` ORDER BY COUNT(`song_id`) DESC LIMIT 0,3; this gets the name of the song knowing the song_id: --------------------------------------------- SELECT `song_title` FROM `music_table` WHERE `song_id`=ID;