hello fellow campers
i am stuck
Does anyone know how i can change my major_id from 2 to 1?
i could fix it with
UPDATE majors SET major_id = 1;
It really doesnt have to start at one once you populate the database it just starts where it left off so if it starts at two or a hundred its the same thing. If you use it as a foreign key it will still find the same data that you reference.
actually you’re looking for
UPDATE majors SET major_id = 1 WHERE major_id = 2
But since there is only one record your statement will run just fine.
And like cmar said, it doesn’t matter if there are numbers not used in between some of your ids, the engine (assuming the primary key field is sequential/serial) will just keep track of the last number and continue incrementing +1 from there.
Yes there was only one row. Previously i mades an other mistake thats why it started with 2.
Thanks for the replies.