Jump to content

Primary keys and Auto increment fields?


eduard
 Share

Recommended Posts

primary keys are used to idenitify a column. primary keys are unique so it cant have any duplicate value.if you set a column as auto increment it will increase the number by 1 every time you will insert a new row.

Edited by birbal
Link to comment
Share on other sites

primary keys are used to idenitify a column. primary keys are unique so it cant have any duplicate value.if you set a column as auto increment it will increase the number by 1 every time you will insert a new row.
Sorry, I don´t understand ´primary keys´! Can you give an example please?
Link to comment
Share on other sites

suppose you are making a user table. there is three field userid,name,agenow name can be same for many entries so it would be difficult to identify any particular user. so you need to a column which is unique for every entries. so to achieve this you can use primary key constrain to the userid column.

Link to comment
Share on other sites

suppose you are making a user table. there is three field userid,name,agenow name can be same for many entries so it would be difficult to identify any particular user. so you need to a column which is unique for every entries. so to achieve this you can use primary key constrain to the userid column.
Ok, thanks!
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...