Ok theory is this should be quite a simple design, but I'd like to check with those in the know. I have some XML data I'm wanting to insert into a MySQL database.
There are two types of xml file, channels.xml and xx.xml (where xx is the channel id)
channels.xml has entries like this (it's basically a listing of all the tv channels available and their id)
So the corresponding xml file for this channel would be 2008.xml, which has entries like so
So based on this information I plan to have the following tables
CHANNELS
CHANNELID | CHANNELNAME
GENRE
GENREID | GENRENAME
PROGRAMMES
PROGRAMMEID | CHANNELID | GENREID | PROGTITLE | SUBTITLE | EPISODE | YEAR | DIRECTOR | PERFORMERS | PREMIERE | FILM | REPEAT | SUBTITLES | WIDESCREEN | NEWSERIES | DEAFSIGNED | BNW | STARRATING | CERTIFICATE | DESCRIPTION | CHOICE | DATE | STARTTIME | ENDTIME | DURATION
Should I normalise out into further tables or does that sound ok?
There are two types of xml file, channels.xml and xx.xml (where xx is the channel id)
channels.xml has entries like this (it's basically a listing of all the tv channels available and their id)
PHP:
<CHANNEL>
<CHANNELNAME>Five USA</CHANNELNAME>
<CHANNELID>2008</CHANNELID>
</CHANNEL>
So the corresponding xml file for this channel would be 2008.xml, which has entries like so
PHP:
<PROGRAMME>
<CERTIFICATE></CERTIFICATE>
<DURATION>360</DURATION>
<STARTTIME>06:00</STARTTIME>
<DATE>27/09/2010</DATE>
<SUBTITLE></SUBTITLE>
<FILM>false</FILM>
<PERFORMERS></PERFORMERS>
<WIDESCREEN>false</WIDESCREEN>
<ENDTIME>12:00</ENDTIME>
<SUBTITLES>false</SUBTITLES>
<REPEAT>false</REPEAT>
<EPISODE></EPISODE>
<PREMIERE>false</PREMIERE>
<BNW>false</BNW>
<STARRATING></STARRATING>
<PROGTITLE>Teleshopping</PROGTITLE>
<DIRECTOR></DIRECTOR>
<YEAR></YEAR>
<DEAFSIGNED>false</DEAFSIGNED>
<CHOICE>false</CHOICE>
<NEWSERIES>false</NEWSERIES>
<DESCRIPTION>A chance to buy goods from the comfort of home.</DESCRIPTION>
<GENRE>Consumer</GENRE>
</PROGRAMME>
So based on this information I plan to have the following tables
CHANNELS
CHANNELID | CHANNELNAME
GENRE
GENREID | GENRENAME
PROGRAMMES
PROGRAMMEID | CHANNELID | GENREID | PROGTITLE | SUBTITLE | EPISODE | YEAR | DIRECTOR | PERFORMERS | PREMIERE | FILM | REPEAT | SUBTITLES | WIDESCREEN | NEWSERIES | DEAFSIGNED | BNW | STARRATING | CERTIFICATE | DESCRIPTION | CHOICE | DATE | STARTTIME | ENDTIME | DURATION
Should I normalise out into further tables or does that sound ok?
Last edited: