Jump to content

Stuck on Relationships for a Database Please Help


artisticre

Recommended Posts

I have a night club website that wants a database done.  There are two tables, one for Events and one for Venue.  Each venue could have many events but each event would have one venue.  Could someone look at my tables to see if the relationships are correct?  Also, could someone suggest a way that might optimize these tables as much as possible? 8)

 

Events

event_id (PK)

eventtype

eventdate

eventtime

eventinfo

 

 

Venue

venue_id (PK)

name

address

city

state

zip

clubtype

phone

musictype

info

featured

event_id

 

since each event has only one venue, the event would have the venue_id, not vice versus. also, date and time can be in one field:

 

Events

event_id (PK)

eventtype

eventdatetime

eventinfo

venue_id

 

Venue

venue_id (PK)

name

address

city

state

zip

clubtype

phone

musictype

info

featured

Thanks for the reply.  When I insert into these tables, which table would I insert into first?

 

 

 

 

 

 

 

Hi

 

Would move the many relationship key:-

 

Events

event_id (PK)

eventtype

eventdate

eventtime

eventinfo

venue_id

 

 

Venue

venue_id (PK)

name

address

city

state

zip

clubtype

phone

musictype

info

featured

 

All the best

 

Keith

Well, you should only have one row in Venues per venue. Most places would have this table populated already. Either way though, the venue must exist, so you can get it's id, before you can insert the event int the events table.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.