Re: Table Schema
Date: Mon, 24 Mar 2008 13:57:45 -0800
Message-ID: <3u8gu31psf7g7jvscmp4vvjiku4ca0ik69@4ax.com>
I think i only need 2 table is enough
CREATE TABLE programs
(
programid int NOT NULL PRIMARY KEY,
programname nvarchar(200) NOT NULL,
... )
CREATE TABLE productioncrew
(
programid int NOT NULL REFERENCES programs,
firstname nvarchar(200) NOT NULL,
lastname nvarchar(200) NOT NULL,
role nvarchar(200) NOT NULL,
PRIMARY KEY (programid, firstname, lastname, role)
)
since my DB is only 6 tables like Schedules, TVStations, ChannelLineup, Programs, ProductionCrews and Genres
it's a very small DB and I dont' need all those ID things it's easy to do query with above
>
>Apparently you don't fully understand the nature of your data. Each
>program has a cast/crew, but members of one program's cast/crew could
>also be working on, or have worked on, any number of other programs.
>Possibly you should start with the people (cast/crew) and build a
>table for that data (for example CAST_CREW), assigning a CAST_ID to
>each person, which would be unique. Then you could build a table of
>your programs (TV_PROGRAMS), associating the relevant CAST_IDs to
>each. The role played would be contained in the table of program
>data, rather than being associated with the actor in the cast_crew
>table.
>
>I won't do any more for you as this appears to be homework. However,
>if you get confused, post what you have designed here and you'll
>likely get helpful pointers.
>
>
>David Fitzjarrell
Received on Mon Mar 24 2008 - 16:57:45 CDT