I am working from this database, its one of the first I have tried building:
http://sqlfiddle.com/#!2/38ef8
When I try to add this line:
Insert Into country (name) values ('US');
It says Field ‘id’ doesn’t have a default value. Am I doing my primary key correctly? I have seen people using “auto_incrment” on their primary key like this example:
http://sqlfiddle.com/#!2/c807a/2
Is that what I should be using?
If you didn’t specify
PRIMARY KEYcolumn asAUTO_INCREMENTthen you have to give values manually, for example:It’s up to you wheter use
AUTO_INCREMENTor not. There are many reasons to do it and many not to do it: