0
votes

I was working upon sequences and since i am new to sequences I had few doubts:

  1. Whats the difference between Sequence and Auto Increment while using in MySQL.

  2. Can i add a sequence or alter a column and change its value to auto-increment or a sequence val if the column is already created in the table(its already a primary key but no auto increment is there) or do i need to drop that column and create it again.

  3. Can i add multiple sequences for a single table's different columns ?

All helping answers will be appreciated.

1
Did you mean to tag this under mysql? - Strawberry
auto_increment increment's the value by 1,while sequence value can be incremented by any value(i.e. user defined interval) - ashishmaurya
This question seems to be explicitly about MySQL. As such, the answer is easy. MySQL doesn't support sequences (as far as I know), unless you consider auto-incremented columns to be sequences. - Gordon Linoff

1 Answers

0
votes

Here are your answers.

Ans 1. MySQL doesn't support Sequence, so it provides the facility of Auto Incremnent.

Ans 2. Yes, without any doubt you can add the sequence or change the sequences value without dropping that column.

Ans 3. Yes. You can add multiple Sequrnces to a single table for different columns.