Re: Table Structure
| From: | Ignatius Reilly | Date: | Thu, 08 May 2003 18:16:31 +0000 |
| Subject: | Re: Table Structure | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-27592@lists.php.net to get a copy of this message | ||
You may want to use a entity supertype/subtype design.
Google or check:
http://www.pgro.uk7.net/meil1.htm
HTH
Ignatius
____________________________________________
----- Original Message -----
From: "shaun" <shaun@mania.plus.com>
To: <php-db@lists.php.net>
Sent: Thursday, May 08, 2003 8:07 PM
Subject: [PHP-DB] Table Structure
> Hi,
>
> I have the following tables in my database. A user could be of type Staff,
> Client or Administrators. A client could have many reps. Only staff,
> administrators and reps can log in to the system. I would appreciate your
> comments on this model. Have i modelled this correctly, or should i have a
> seperate table for each user?
>
> Thanks for your help
>
>
> # ---------- MySQL dump ----------
> #
> # Table structure for table 'WMS_Rep'
> #
> CREATE TABLE WMS_Rep (
> Rep_ID int(11) DEFAULT '' NOT NULL auto_increment,
> User_ID int(11) DEFAULT '0' NOT NULL ,
> Rep_Name varchar(40) DEFAULT '' NOT NULL ,
> Rep_Username varchar(20) DEFAULT '' NOT NULL ,
> Rep_Password varchar(20) DEFAULT '' NOT NULL ,
> Rep_Location varchar(40) DEFAULT '' NOT NULL ,
> PRIMARY KEY (Rep_ID,User_ID)
> );
>
> #
> # Table structure for table 'WMS_User'
> #
> CREATE TABLE WMS_User (
> User_ID int(11) DEFAULT '' NOT NULL auto_increment,
> User_Username varchar(20) DEFAULT '' NOT NULL ,
> User_Password varchar(20) DEFAULT '' NOT NULL ,
> User_Name varchar(100) DEFAULT '' NOT NULL ,
> User_Type int(11) DEFAULT '1' NOT NULL ,
> User_Email varchar(70) ,
> User_Location varchar(40) ,
> PRIMARY KEY (User_ID)
> );
>
> # ----------- Dump ends -----------
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>