Re: standard and easy way to do schema design

From: <Summercoolness_at_gmail.com>
Date: Wed, 15 Aug 2007 15:44:30 -0700
Message-ID: <1187217870.973433.165760_at_q3g2000prf.googlegroups.com>


On Aug 15, 2:59 pm, Neo <neo55..._at_hotmail.com> wrote:
> > a simple way to do database schema design.
> > user can type in the movie name and zipcode,
> > return all the theaters showing that movie
> > and at what time, for theaters in THAT zipcode.

So let's say the problem is just that simple, without needing zipcode related information (such as the name of the district)...

We can write

Movies

   id
   title
   showtimes and in which theaters >>>>>>>    duration
   description

Theaters

   id
   name
   zipcode
   phone number
   address line 1
   address line 2
   movies showing there and their showtimes >>>>>>>>

and we put the ">>>>>>>>" for things that are "multiple items". (indicated by us writing it in plural, such as showtimes) and for any ">>>>>>>>" line, we will need to create a separate table, if that table doesn't already exist.

and for those ">>>>>>>>" lines, we will simply remove them from the original table.

so in our case, we create a new table

Showings

   movie_id
   theater_id
   movie start time

and remove those ">>>>>>>>" lines in the original tables "Movies" and "Theaters".

and that will complete the basic task? (assuming no future function is needed). Received on Thu Aug 16 2007 - 00:44:30 CEST

Original text of this message