Re: Customer user and factory user in the same table
From: Jerry Stuckle <jstucklex_at_attglobal.net>
Date: Sun, 11 Aug 2019 16:18:14 -0400
Message-ID: <qipt66$o0s$2_at_jstuckle.eternal-september.org>
>
> I thought like what happen in Facebook so in this social network you
> must join like a user and after it you can make/enable a "page"!
>
> I thought to create a user table to store all users, in this case I can
> check date of birth (>18), email, profile image, etc. and I thought to
> create another table named factories where I can store details like web
> page, address of the factory, etc.
>
> A third table named factory_user will be connected by a foreign key to
> the users table and to the factories table, in this case I could add "n"
> users for a factory because more than one user could be in the owner's
> crew!
>
>
> I think you have my same idea, both are users also a factory's owner,
> they are stored in users table but I think I should have just three
> tables like you can see here below:
>
> users
> ------------------------
> id_user name Factory
> 1 Peter Yes
> 2 John Yes
> 3 David No
>
> factories
> ----------------------------
> id_factory name
> 1 Restaurant A
> 2 Restaurant B
> 3 Restaurant C
>
> factory_users
> --------------------------------------------
> id_factory_user FK_factories FK_users
> 1 1 2
> 2 1 1
> 3 2 1
>
>
> Like what I said above I think we had same idea!
>
> Regards.
> ^Bart
Date: Sun, 11 Aug 2019 16:18:14 -0400
Message-ID: <qipt66$o0s$2_at_jstuckle.eternal-september.org>
On 8/11/2019 6:28 AM, ^Bart wrote:
>> Customer users and factory users are not the same thing so should not >> be in the same table.
>
> I thought like what happen in Facebook so in this social network you
> must join like a user and after it you can make/enable a "page"!
>
> I thought to create a user table to store all users, in this case I can
> check date of birth (>18), email, profile image, etc. and I thought to
> create another table named factories where I can store details like web
> page, address of the factory, etc.
>
> A third table named factory_user will be connected by a foreign key to
> the users table and to the factories table, in this case I could add "n"
> users for a factory because more than one user could be in the owner's
> crew!
>
>> I would have four tables. A user table with userid, password and >> anything else common to both types. Then a customer_user table with >> specific customer-user specific information and a foreign key leading >> back to the user table.
>
> I think you have my same idea, both are users also a factory's owner,
> they are stored in users table but I think I should have just three
> tables like you can see here below:
>
> users
> ------------------------
> id_user name Factory
> 1 Peter Yes
> 2 John Yes
> 3 David No
>
> factories
> ----------------------------
> id_factory name
> 1 Restaurant A
> 2 Restaurant B
> 3 Restaurant C
>
> factory_users
> --------------------------------------------
> id_factory_user FK_factories FK_users
> 1 1 2
> 2 1 1
> 3 2 1
>
>> And since you may have more than one owner of a factory, have a >> factory-user table with information specific to that factory and a >> link table joining the user and factory-user tables.
>
> Like what I said above I think we had same idea!
>
> Regards.
> ^Bart
OK, if the factory user has the same fields as a customer such as birth date, that would work. Your first post seemed to indicate that it did not.
[Quoted] I guess it depends on if a factory user is always a person or could be a company.
-- ================== Remove the "x" from my email address Jerry Stuckle jstucklex_at_attglobal.net ==================Received on Sun Aug 11 2019 - 22:18:14 CEST