Tagged Questions
1
vote
1answer
113 views
does last_insert_id() returns correct result when writes from multiple sessions?
I have a table in which there is a combination of 4 columns that will act as a unique key.
Instead of using a composite primary key, I want to keep an id column as the primary key. This field is on ...
1
vote
1answer
342 views
SQL - double column used from primary key with autoincrement
I am user the following as primary key in the SqlDB:
I am doing the Index as Autoincrement, but it is autoincremented in general not per user.
Example userid=1,index=1, then insert another for ...
5
votes
2answers
557 views
What Is The Point of a Primary Key?
Why do I need to have a primary key on my database for it to function correctly? In every tutorial I read, you need to make the id key the primary key. What does the primary key do differently than ...
1
vote
2answers
259 views
serial field issue
Q:
I use a serial as a datatype for my primary keys in my tables.
I insert a lot of data then truncate these data one after one many times to test the data entry.
My question is:
Is there any ...
3
votes
4answers
5k views
MySQL: Why is auto_increment limited to just primary keys?
I know MySQL limits auto_increment columns to primary keys. Why is this? My first thought is that it's a performance restriction, since there probably is some counter table somewhere that must be ...