How to Create SQL Views in LibreOffice Base

Creating reusable virtual tables—commonly known as SQL views—in LibreOffice Base allows users to encapsulate complex queries, simplify reporting, and establish persistent data abstractions across forms and reports. This article covers the primary built-in features and external database management tools used to generate and maintain SQL views within the LibreOffice Base environment.

1. The Native View Design Interface (GUI)

LibreOffice Base includes an integrated graphical interface for constructing views without manually writing SQL code.

2. Direct SQL Command Execution

For complex logic, subqueries, or engine-specific functions that the graphical designer cannot parse, LibreOffice Base provides direct SQL execution.

3. Converting Queries to Views

Base allows converting standard user queries into database-level views.

4. External Database Management Tools (Split/External Databases)

When LibreOffice Base is used as a front-end connected via JDBC or ODBC to external relational systems (such as PostgreSQL, MySQL/MariaDB, or SQLite), external SQL tools can be used to generate views that Base consumes:

Views created in these external tools are automatically imported into LibreOffice Base upon refreshing the connection, functioning as native virtual tables for forms, queries, and reports.