Keys and Referential Integrity in LibreOffice Base

LibreOffice Base manages relational data by utilizing primary keys, foreign keys, and referential integrity rules to structure tables and preserve data consistency. By leveraging its integrated database engines—primarily Firebird or embedded HSQLDB—Base ensures that each record is uniquely identifiable and that relationships across different tables remain valid during data entry, updates, and deletions.

Primary Keys in LibreOffice Base

A primary key uniquely identifies each record in a database table, preventing duplicate entries and null values in the designated key column.

Foreign Keys and Relationships

Foreign keys establish links between separate tables by referencing the primary key of another table, creating parent-child relationships (such as one-to-many or one-to-one).

Referential Integrity Controls

Referential integrity prevents orphaned records by ensuring that a foreign key value always points to an existing primary key value in the parent table. When defining a relationship in the Relation Properties dialog, LibreOffice Base provides rules for handling updates and deletions: