If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > Three tables having access to one?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-20-03, 00:45
dwstudent2003 dwstudent2003 is offline
Registered User
 
Join Date: Oct 2003
Posts: 3
Talking Three tables having access to one?

I'm creating a web portal for a business. I have three different tables for owners, customer, and employees. I also have a table called events where I will be storing event information. I want all the users(owners, customers, and employees) to have access to this table. What would be the best what of designing this? I also have the same question about the pricing.


Employees------
--------
Customers--------------- Events
--------
Owners --------

Thanks,
DW
Reply With Quote
  #2 (permalink)  
Old 10-20-03, 08:17
andrewst andrewst is offline
Moderator.
 
Join Date: Sep 2002
Location: UK
Posts: 5,171
Re: Three tables having access to one?

I don't follow: what has the fact that different types of users need to have access to table Events got to do with the design of that table?

If what you mean is that an Event may be associated with any one of Employees, Customers and Owners then you can either have 3 foreign keys and a check constraint to enforce the rule that only 1 is applicable for any Event, or you can have a "supertype" table e.g. "People" like this:

Employees -- 1:1 -- People
Customers -- 1:1 -- People
Owners -- 1:1 -- People

People -- 1:M -- Events
__________________
Tony Andrews
http://tinyurl.com/tonyandrews
Reply With Quote
  #3 (permalink)  
Old 10-20-03, 11:02
dwstudent2003 dwstudent2003 is offline
Registered User
 
Join Date: Oct 2003
Posts: 3
Talking

The problem is I'm creating a site that allows owners, customers, and employees to logon to a web site. Each table has the username, password and users personal information. The owners can give the customers or employees access to the calendars (event table). I'm wondering how I can have a 1 to many relationship with the owner table and the employee & customer table and still allow the owners to grant permissions to the event table? I'm a novice at db design when it comes to relating it to a web application. Can someone help.

Thanks,
DW
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On