In my web application I will have three types of accounts.
- User: for using the web application for free
- Customer: for advertising and getting a Company Logo
- Admin: for editing and deleting stuff
Should all these three be in separate tables or in one with a column named “account_type” where i can mark it as User, Customer or Admin?
What are the pros and cons for both? Is there a best practice for this?
Thanks
In general, a
personcan be user, customer and admin — so, I would start with aPersontable with columnsIsCustomer,IsUser,IsAdmin. Later (for fast search) you may decide to add separate tablesAdmin,Customers,Userswith FK to thePersontable.EDIT:
A typical case may be:
In general, having separate tables for customers and admins should speed-up any admin/customer related query.