When creating a database either externally or through java code, we must create an attribute Primary key
Autoincrement
called _id
.
With which, if I have in my relational database a id_producto
in a called table Productos
and I want it to id_producto
be as well Primary key
and Autoincrement
I can't since the attribute _id
is already Primary key
with which the one Primary key
of the table would be composed.
How can this be managed?
It is not possible to create multiple primary keys on a table.
Use a unique index has the same behavior as a primary key:
If I'm not mistaken, this is not possible with
SQLite
however, you can create aUNIQUE INDEX
which is essentially the same as a Primary key