In PetShop, why account information is splitted into three tables: Account, Profile,SignOn? RRS feed

  • Question

  • there is no parent-child relation between them, so it is not becuause of normalization. In fact, the Account, Profile,SignOn tables can be expressed in just one table, the Account table.


    there are other similar case in PetShop : Item & Inventory , Category & BannerData


    My guess is that it is use to demonstrate that when Representing Data with Custom Business Entity Components, "

    You should not map one business entity to each database table; typically a business entity will have a schema that is a denormalization of underlying schemas".



    Your opinons are greatly appreciated.







    Sunday, January 27, 2008 6:15 AM

All replies

  • Your poste is very vague. It sounds like your database tables are using some relations (hopefully), which would connect certain data to other tables in your database.


    What is your problem exactly?


    Monday, January 28, 2008 8:29 AM
  • sorry for the vagueness.


    I mean in the MS PetShop, i don't quite understand its database model. In the database model, the account information is splitted into three tables : Account, Profile and SignOn. But i think all the account information can be stored in just one table, i don't understand why it's splitted into three tables.



    thanks for your help.
    Monday, February 4, 2008 10:34 AM
  • If they can be expressed in one table, as you say, then there would be a relationship between the data in the tables now wouldn't there?


    I would suspect that there is either no relationship between the data, in which case the data belongs in separate tables, or, there is the possibility for a one-to-many relationship. For example, can an account have multiple profiles? Is this something that might be added in the future?


    When architecting a database design consideration is often given to what type of enhancements might be requested in future versions.






    Monday, February 4, 2008 2:00 PM
  • The Profile table has columns: UserID, LangPref, FavCategory, MyListOpt, BannerOpt.

    The Account table has columns: UserID,Email,FirstName,LastName,Address,Phone,..., with UserID as PK.

    The SignOn table has columns: UserName,Password, UserName as PK. UserID & UserName actually contain the same data, that is, the user id. So, the relationship between Profile & Account tables are one-to-one.


    The relationship between Profile & Account tables is the same as that of between Account & SignOn. There is no way for an account to have multiple profiles.

    Saturday, February 23, 2008 7:57 AM