2

My table have many duplicated entries, is it dangerous if I don't fix this? My table is structured like this:

Music_id | Music_title      | Music_author | Music_link
1          Look at me now     Chris Brown    
2          Look at me now     Jay-z        

This is just an example, but that is the table I have. Look at the Music title. There's duplicate entries already. Sometimes the music_title will reach 10 duplicates

So I plan to make a look up Music table

Music
id | music_title
1    Look at me now

My table
id | music | music_author | Music_link
1     1      chris brown   
2     1      jay-z

But my concern is, the 1 in the music field is also duplicated. Which is better anyway? I'm confused.

6

In this case, I would keep the single table and allow repeated song titles.

Lookup tables are used for finite sets (artist, status, city etc). Moving song titles to a lookup table will result in a lookup table nearly as large as the main table. If anything, artist should be a separate lookup table because this will be common attributes for several song entities.

A table will generally store an object or entity, in this case a song. The common attributes for a song can be moved to a lookup table, but song title isn't one of these common attributes. The same song title is usually a coincidence: you'd probably be better with "CoverOf" and "ReReleaseOf" columns to deal with these cases.

The fact of storing the same text in several rows isn't breaking any rules here because it isn't repeated text in the lookup sense

Also see: Proper Use of Lookup Tables

  • 1
    I agree with all. The only reason (I can think of) for having lookup table for the music title is if you want to run (more efficiently) queries that group by the music title. For example, if you have a trivial questions database and want to find the 10 most common song titles in the history of music. – ypercubeᵀᴹ Jan 2 '12 at 16:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.