Sreedhar.a wrote:
Hi Lokesh,

Thanks for your suggestions.

My proble is assigning a unique record for each record in a table.

The database table name MUSIC.

I have 3 columns Artist Album and Tracks.

Artist1 Album1  Track1
Artist2 Album2  Track2
Artist3 Album2  Track3

I need to assign a unique id value for each item in the row.

Your data model is extremely awkward because you're trying to model entities as columns rather than table rows. "Artist," "album" and "track" are all distinct entities and should each have their own tables. You really need four tables: an "artist" table that contains a unique identifier for each artist, as well as any attributes that relate to the artist (e.g. year formed), an "album" table that contains a unique identifier for the album, along with any attributes that describe the album (date released, producer, etc.), a "tracks" table that describes each track, with a unique identifier and any track-specific information (was it done as a video? released as a single?) and, finally, a "tracklist" table that pairs up albums with tracks.

You need artist identifiers to be unique (you could in fact use artist names, since copyright rules require that such names be unique). You also need album names to be unique, but only within artist groups (you're not going to have the *same* artist release two albums with the same name). You need track names to be unique within artists, but not otherwise (quick, name two boybands whose first singles had the same names*).

You'll want to use joins to relate the four tables.

* Both the Jackson 5 and N'Sync had first singles titled "I Want You Back" Two completely different songs.

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to