using autoincrement id
Posted: Sun Mar 06, 2011 9:12 am
I am wondering if it is recommended to use autoincrement fileds even if I don't need it?
As for example I have tables users, companies and employees. Inside table employees are user that joined a company.
The structure of table employees is as the following:
fieldId | companyId | userId | levelAccess
In this case filedId is just autoincrement without any value, it is just for the my record and it could be just without.
So should I remove fieldId from the table?
This was just one example of table where I don't need autoincrement id. I hear one time from somebody that he use autoincrement id in all tables. That is why I put it, but I am not sure if this has any sense.
As for example I have tables users, companies and employees. Inside table employees are user that joined a company.
The structure of table employees is as the following:
fieldId | companyId | userId | levelAccess
In this case filedId is just autoincrement without any value, it is just for the my record and it could be just without.
So should I remove fieldId from the table?
This was just one example of table where I don't need autoincrement id. I hear one time from somebody that he use autoincrement id in all tables. That is why I put it, but I am not sure if this has any sense.