Results 1 to 3 of 3
  1. #1
    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

  2. #2
    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

  3. #3
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •