I'm creating a web application that will let you create and manage projects, but when it came to generate the database and tables I wondered if there was something wrong by making a database for users (myapp_users), so each table will be each user and a column will represent a project.
Asked
Active
Viewed 41 times
1
-
For more succinct and better answers than mine see: [Database efficiency - table per user vs. table of users](http://stackoverflow.com/questions/7544544/database-efficiency-table-per-user-vs-table-of-users) – Jim Sep 02 '13 at 15:58
1 Answers
0
Yes there is something wrong with this. The ghost of Edgar F. Codd will haunt you and your database will be unscalable and unmaintainable.
If you ever find the need for X tables per item and items are arbritrary then these probably need a table to themselves.
In this case you would have a users
table with all the information for specific users in each row and a projects
table that can link to the users
table.
This lets you use the DB as it's intended and makes it easier to do things like count users or get a list of all projects given a specific user (plus changing a users name just requires updating a row rather than renaming a table).

Jim
- 22,354
- 6
- 52
- 80