Cluelessly trying to replicate ms access db in lo base

Hello everyone,

I’ve been taking db classes recently at uni, but they’re using ms access. I’m running fedora on my main and educational computer, so I’m trying to replicate the same thing from Access in LibreOffice Base. The issue is that I’m clueless.

Below is combined screenshot of what I’m trying to replicate from Access and an error, that I keep getting each time I’m trying to make multiple primary/foreign key connections between my “Testing” table (Випробування) and “Varieties” table (Сорти).

The error:

SQL Status: S0011
Error code: -170

Primary or unique constraint required on main table: "Випробування" in statement [ALTER TABLE "Сорти" ADD  FOREIGN KEY ("Код_культури") REFERENCES "Випробування" ("Код_культури") ON UPDATE CASCADE  ON DELETE CASCADE ]

Any help/critic would be much appreciated!

Don’t know why you create a table with 4 keys.
Normal way is one primary key for a table, 2 keys for a table, which connects 2 other tables in n:m-relation.
For a action ON UPDATE you will need a update of a primary key, which is the only key. If you change a key, which is part of 4 keys, it isn’t the only value with this key. So you would destroy other connections when updating the key. GUI won’t support a connection of 2 tables, where both tables contain more than 1 key.

2 Likes