doombey,
For the top ten query I need the name, the artist and the hits.
I decided to change the database again.
album
alb_id
art_id
alb_name
alb_hits
artist
art_id
art_name
art_count
band
band_id
art_id
albums.art_id = artist.art_id AND artist.art_id = band.bad_id
ex:
album table
1, 3, album A, 500
2, 1, album B, 498
3, 2, album C, 854
artist table
1, John Doe, 1
2, James Doe, 1
3, Doe Brothers, 2
band table
3, 1
3, 2
On the average query I can join the albums table with the artists table and this will give me all the info I need. If I need to find related albums for the doe brothers I can query the band table and find the artists that make it up, in this case John and James.
It is similar to khaldryck idea but I took out the art_alb table which was making the querys three lines long.
The top ten query is now very easy.
SELECT * FROM album, artist WHERE album.art_id = artist.art_id ORDER BY alb_hits LIMIT 0, 10