I'm sorry to say this. But the small screenshot snippet alone demonstrates the bad quality of LibreOffice documentation. That project has consumers and fans but the knowledgable community is very thin.
To answer your question for the built-in HSQLDB (you may use other types of databases as well):
menu:Tools>SQL:
- Code: Select all Expand viewCollapse view
DROP TABLE "PaymentTypes" IF EXISTS;
CREATE CACHED TABLE "PaymentTypes"(
"ID" INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 0) NOT NULL PRIMARY KEY,
"Name" VARCHAR_IGNORECASE(50) NOT NULL)
CREATE UNIQUE INDEX "uniqName" ON "PaymentTypes"("Name");
hit [Excecute...]
Then menu:View>RefreshTables.
I added an additional index on the names so you can not enter 2 equal names.
The field type is VARCHAR_IGNORECASE so "bank" and "Bank" are considered as equal values.
According to the warning in your LibreOffice documentation, the columns are in wrong order. In fact the order of columns and rows does not mean anything since you can easily retrieve any rows and any column in any order.
For your list box you need:
SELECT "Name","ID" FROM "PaymentTypes" ORDER BY "Name"
which picks the second column before the first and orders the rows by name.
Auto-fields should be created manually for new, empty tables. This is a tiny little bit of work and saves you a lot of trouble.