Re: Need help with normalizing
From: Mike Sherrill <MSherrill_at_compuserve.com>
Date: Wed, 13 Nov 2002 09:41:39 -0500
Message-ID: <cu5tsuga890td0m69vpletm7skqa8mp9h8_at_4ax.com>
Date: Wed, 13 Nov 2002 09:41:39 -0500
Message-ID: <cu5tsuga890td0m69vpletm7skqa8mp9h8_at_4ax.com>
On Fri, 08 Nov 2002 02:04:57 GMT, "Seth Brewer" <fieury_at_hotmail.com> wrote:
>I'm building a menu database which eventualy will allow people to order a
>meal by date. Only certain meals will be available on certain dates, but
>certain meals may be available on many dates. To make things worse I want to
>have the main courses and sides in separate tables so that they can be mixed
>and matched many-to-many.
You need to record the fact each meal is available on specific dates. So a table of MEAL_AVAILABILITY seems to be in order.
Bare bones . . .
MEAL_AVAILABILITY
--
mainCourseID
sideID
dateAvailable
PRIMARY KEY (mainCourseID, sideID, DateAvailable) FOREIGN KEY (mainCourseID, sideID) REFERENCES MEALS (mainCourseID, sideID)
You'll have to flesh that out and translate that into your dbms's language.
-- Mike Sherrill Information Management SystemsReceived on Wed Nov 13 2002 - 15:41:39 CET