Ask a Question related to MySQL, Design and Development.
-
frizzle #1
Music System: Artists with multiple Genres
Hi group,
I have a small question:
I'm building a music site with lots of artists in them. Each artist can
belong to a certain genre of music: e.g. Rock, Pop, etc.
Artist table looks like: id, artist_name, genre_id, artist_info, etc.
Genre table looks like: id, genre_name
This way, in table artists, you can give an artist 1 Genre. But an
artist can be e.g. Rock AND Pop. How could i make a system that allows
multiple genres per artist? I don't wish to munually write them per
artist, because artists are also sortable by genre, and typo's would
mess things up.
Frizzle.
frizzle Guest
-
Proposed CPAN Module: Tk::Canvas::Music (renamed to Tk::Music)
Hi... It's been a while, but I'm getting back to thinking about this Tk::Music module... How do people want this to work... so far we have the... -
Multiple People, One system
I have several people that will be maintaining different areas of a site, using different keys. They may need to use 'general' systems from time to... -
Attn: Artists Contest
Attn: Webmasters,Flash Animators, Graphic Artists Rusty Clearwater and the Buttermilk Mountainfolk are currently looking for a webmaster,... -
Multiple versions on one system
Hello, I'm running a program that requires Reader version 3 to work fine. Unfortunately this version is somewhat out of date, so I also need... -
Revisited - Septembers Artists in residence
Cannot remember seeing a dedicated link for this, but having just popped over to see what was going on, I was surprised. I feel honoured to be... -
Phil Cairns #2
Re: Music System: Artists with multiple Genres
frizzle wrote:
This is a fairly classic problem: how to represent a many-to-many> Hi group,
>
> I have a small question:
> I'm building a music site with lots of artists in them. Each artist can
> belong to a certain genre of music: e.g. Rock, Pop, etc.
>
> Artist table looks like: id, artist_name, genre_id, artist_info, etc.
> Genre table looks like: id, genre_name
>
> This way, in table artists, you can give an artist 1 Genre. But an
> artist can be e.g. Rock AND Pop. How could i make a system that allows
> multiple genres per artist? I don't wish to munually write them per
> artist, because artists are also sortable by genre, and typo's would
> mess things up.
>
> Frizzle.
relationship in a database. A genre can have many artist, an artist can
belong to many genres. You need to introduce an intermediate table that
holds the relationship between artist and genre. It could look something
like this:
artistgenre:
artist_id INT,
genre_id INT
Pretty simple table, but it means that you can remove the genre_id from
your artist table, and manage the relationship between artist and genre
separately from your actual data. It also makes the "which artists
belong to this genre" and "which genre does this artist belong to"
queries really simple. Creating such an association is as simple as
inserting a record, and removing the relationship is just deleting one.
Phil.
Phil Cairns Guest
-
frizzle #3
Re: Music System: Artists with multiple Genres
Phil Cairns wrote:Thanks!> frizzle wrote:>> > Hi group,
> >
> > I have a small question:
> > I'm building a music site with lots of artists in them. Each artist can
> > belong to a certain genre of music: e.g. Rock, Pop, etc.
> >
> > Artist table looks like: id, artist_name, genre_id, artist_info, etc.
> > Genre table looks like: id, genre_name
> >
> > This way, in table artists, you can give an artist 1 Genre. But an
> > artist can be e.g. Rock AND Pop. How could i make a system that allows
> > multiple genres per artist? I don't wish to munually write them per
> > artist, because artists are also sortable by genre, and typo's would
> > mess things up.
> >
> > Frizzle.
> This is a fairly classic problem: how to represent a many-to-many
> relationship in a database. A genre can have many artist, an artist can
> belong to many genres. You need to introduce an intermediate table that
> holds the relationship between artist and genre. It could look something
> like this:
>
> artistgenre:
> artist_id INT,
> genre_id INT
>
> Pretty simple table, but it means that you can remove the genre_id from
> your artist table, and manage the relationship between artist and genre
> separately from your actual data. It also makes the "which artists
> belong to this genre" and "which genre does this artist belong to"
> queries really simple. Creating such an association is as simple as
> inserting a record, and removing the relationship is just deleting one.
>
> Phil.
I was afraid it was going to be like this: how would i use this in a
form, to manage the Genres with an artist.
If i'd use tickboxes it would be quite complicated witch the delete and
insert records. Etc.
Can you help me a step further?
Frizzle.
frizzle Guest
-
Frans #4
Re: Music System: Artists with multiple Genres
"frizzle" <phpfrizzle@gmail.com> wrote in message
news:1148936045.879502.95350@j73g2000cwa.googlegro ups.com...Not to be a smartass or anything, but it sounds to me like you would> Thanks!
> I was afraid it was going to be like this: how would i use this in a
> form, to manage the Genres with an artist.
> If i'd use tickboxes it would be quite complicated witch the delete and
> insert records. Etc.
> Can you help me a step further?
>
> Frizzle.
be well off to read some database tutorials or books to get you started.
Frans Guest
-
frizzle #5
Re: Music System: Artists with multiple Genres
Frans wrote:*cough* smartass *cough*> "frizzle" <phpfrizzle@gmail.com> wrote in message
> news:1148936045.879502.95350@j73g2000cwa.googlegro ups.com...>> > Thanks!
> > I was afraid it was going to be like this: how would i use this in a
> > form, to manage the Genres with an artist.
> > If i'd use tickboxes it would be quite complicated witch the delete and
> > insert records. Etc.
> > Can you help me a step further?
> >
> > Frizzle.
> Not to be a smartass or anything, but it sounds to me like you would
> be well off to read some database tutorials or books to get you started.
It's not like i don't know _anything_ about these matters, it's just
that sometimes i need a hint of what direction to think of ...
Frizzle.
frizzle Guest
-
Jerry Stuckle #6
Re: Music System: Artists with multiple Genres
frizzle wrote:
I don't think Frans was being a smartass. Rather, I think he was trying to be> Frans wrote:
>>>>"frizzle" <phpfrizzle@gmail.com> wrote in message
>>news:1148936045.879502.95350@j73g2000cwa.googleg roups.com...
>>>>>>>Thanks!
>>>I was afraid it was going to be like this: how would i use this in a
>>>form, to manage the Genres with an artist.
>>>If i'd use tickboxes it would be quite complicated witch the delete and
>>>insert records. Etc.
>>>Can you help me a step further?
>>>
>>>Frizzle.
>>Not to be a smartass or anything, but it sounds to me like you would
>>be well off to read some database tutorials or books to get you started.
>
> *cough* smartass *cough*
>
> It's not like i don't know _anything_ about these matters, it's just
> that sometimes i need a hint of what direction to think of ...
>
> Frizzle.
>
helpful.
You've asked some very basic database questions (like how to do many-to-many
links) which are answered in about any basic database book. I also think a
little studying on your part would go a long ways towards helping you understand
how to do things.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
[email]jstucklex@attglobal.net[/email]
==================
Jerry Stuckle Guest
-
frizzle #7
Re: Music System: Artists with multiple Genres
Jerry Stuckle wrote:My smartass-response to Frans wasn't intended to be that serieous. It> frizzle wrote:>> > Frans wrote:
> >> >> >>"frizzle" <phpfrizzle@gmail.com> wrote in message
> >>news:1148936045.879502.95350@j73g2000cwa.googleg roups.com...
> >>
> >>>Thanks!
> >>>I was afraid it was going to be like this: how would i use this in a
> >>>form, to manage the Genres with an artist.
> >>>If i'd use tickboxes it would be quite complicated witch the delete and
> >>>insert records. Etc.
> >>>Can you help me a step further?
> >>>
> >>>Frizzle.
> >>
> >>Not to be a smartass or anything, but it sounds to me like you would
> >>be well off to read some database tutorials or books to get you started.
> >
> > *cough* smartass *cough*
> >
> > It's not like i don't know _anything_ about these matters, it's just
> > that sometimes i need a hint of what direction to think of ...
> >
> > Frizzle.
> >
> I don't think Frans was being a smartass. Rather, I think he was trying to be
> helpful.
>
> You've asked some very basic database questions (like how to do many-to-many
> links) which are answered in about any basic database book. I also think a
> little studying on your part would go a long ways towards helping you understand
> how to do things.
>
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> [email]jstucklex@attglobal.net[/email]
> ==================
was only a response to the first part of his reaction (meant as a
joke). Sorry, i guess i'm no comedian.
Anyway, of course, i greatly appreaciate any help i get here, even if
they tell me to read upon things.
Frizzle.
frizzle Guest



Reply With Quote

