Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Table Design re one-to-one relationships

Status
Not open for further replies.

lmcc007

Technical User
May 7, 2009
164
US
I am having trouble with this db because I want to throw everything into one table because of the one-to-one relationship with Event table. I’ve been taught that every subject should have its own table.

The purpose of this db is to keep track of all the media, applications, release forms, and so on distributed.

My difficulties are with Media and Meeting tables. Sometimes media will be sent out prior to meeting and sometimes the media is given at the meeting or an extra copy (courtesy copy) is provided to the company. I don’t want to count it twice if an original was given and then a courtesy copy was given. If a rep cold-call ABC and send them media prior to meeting, and then when meeting give them a courtesy copy I don’t want media to be counted as two. It should be like one original and one copy. I don’t want it to appear as though the reps have been hounding this company and sending media to the same company over and over again for the same contract.


Here’s how it suppose to work:

1. Choose a company name from Company table

2. Click a button on the form to create an Event

3. Enter the Date and time. If the Event Type is 59, then meeting form will open, or

4. If the Event Type is 58, then media form will open so I can say what I sent and so on.

Attached is the db so far.

Any suggestions on the setup and relationships?
 
A lot of people are reluctant to download someone's database and take a look. It takes time, and there could be other issues. Took get a better response from more people, take the time and post your table structure. This FAQ provides the code needed to post your table structure into a thread. Or if you want to hand-jam it into the thread it describes a good format:
Faq700-6905.
 
Okay, here it goes:

DocumentTables

Company
CompanyID dbLong PrimaryKey Indexed
CompanyName dbText Indexed Required
CompanyWebsite dbMemo
CompanyComment dbText
CompanyPhone dbText
CompanyExtension dbText
CompanyPhone2 dbText
CompanyExtension2 dbText
CompanyPhone3 dbText
CompanyExtension3 dbText
CompanyFax dbText
CompanyFaxExtension dbText

Contract
ContractID dbLong PrimaryKey Indexed
EventID dbLong Indexed Required
CompanyID dbLong ForiegnKey Indexed Required
ContractSubmitted dbText Required
ContractReferenceSent dbBoolean
ContractPhotosSent dbBoolean
ContractApplication dbBoolean
ContractReleaseForm dbBoolean
ContractNumber dbLong Required
ContractReferredBy dbText
ContractSiteNumber dbLong
ContractFee dbText
ContractLength dbText
ContractDescription dbMemo
ContractAttached
JobTitleID dbLong ForiegnKey Indexed

Event
EventID dbLong PrimaryKey Indexed
CompanyID dbLong ForiegnKey Indexed Required
EventDate dbDate
EventBeginTime dbDate
EventEndTime dbDate
EventTypeID dbLong ForiegnKey Indexed Required
EventDescription dbText
EventFollowUP dbBoolean
EventFollowUpDate dbDate
EventStatus_Lkp dbText

EventNote
EventNoteID dbLong PrimaryKey Indexed
EventID dbLong ForiegnKey Indexed Required
EventNoteData dbMemo

Meeting
MeetingID dbLong PrimaryKey Indexed
EventID dbLong ForiegnKey Indexed Required
CompanyID dbLong ForiegnKey Indexed Required
ContractSubmitted dbText Required
MeetingReferenceGiven dbBoolean
MeetingPhotosGiven dbBoolean
MeetingApplication dbBoolean
MeetingReleaseForm dbBoolean
JobTitleID dbLong ForiegnKey Indexed

tlkpEventType
EventTypeID dbLong PrimaryKey Indexed
EventTypeName dbText Indexed Required
EventTypeDescription dbText

tlkpJobTitle
JobTitleID dbLong PrimaryKey Indexed
JobTitleName dbText Indexed

DocumentRelations

Name: CompanyContract
Table: Company
Foreign Table: Contract
PK: CompanyID FK:CompanyID

Name: CompanyEvent
Table: Company
Foreign Table: Event
PK: CompanyID FK:CompanyID

Name: CompanyMeeting
Table: Company
Foreign Table: Meeting
PK: CompanyID FK:CompanyID

Name: EventEventNote
Table: Event
Foreign Table: EventNote
PK: EventID FK:EventID

Name: EventMeeting
Table: Event
Foreign Table: Meeting
PK: EventID FK:EventID

Name: tlkpEventTypeEvent
Table: tlkpEventType
Foreign Table: Event
PK: EventTypeID FK:EventTypeID

Name: tlkpJobTitleContract
Table: tlkpJobTitle
Foreign Table: Contract
PK: JobTitleID FK:JobTitleID

Name: tlkpJobTitleMeeting
Table: tlkpJobTitle
Foreign Table: Meeting
PK: JobTitleID FK:JobTitleID
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top