Database General

    From The Document Foundation Wiki
    Other languages:

    Foreword

    The video shows how a ″Database General″ works in LibreOffice and links to this page here, which provides further information and details.

    Link to the Video

    Link to the Video (in German [DE]):

    Datenbank Allgemein This video is in Work!

    Database General

    A database should record data securely (input).

    The data should be able to be processed as easily as possible (processing).

    Data should be able to be output according to different criteria as a display in a form or as output in a report (output).

    Data may also need to be passed on in electronic form.

    Spreadsheets have basic functions of databases.

    However, for large amounts of data and complex processing, a database is appropriate.

    It is worthwhile to think in advance, i.e. before you start to build something (spreadsheet or database), how you want to proceed.

    The database model is a good basis for this.

    What is a database?

    A database, also called a database system, is a system for electronic data management.

    The essential task of a database is to store large amounts of data efficiently, free of contradictions and permanently and to make available required subsets in different, need-fair representation forms for users and application programs.

    The focus in this description is on the relational database.

    DatabaseWikipedia logo v3.svg

    Essential requirement

    There is no redundancy, see:

    In the database development as well as in data structures of programs it applies, Redundancies as completely as possible to avoid, since these can lead to a higher memory requirement and to inconsistencies.

    Redundancies are therefore counted as anomalies.

    Redundancy_(information_theory)Wikipedia logo v3.svg

    Relational database

    A relational database is used for electronic data management in computer systems and is is based on a table-based relational database model.

    The basis of the relational database concept is the relation.

    Relational_databaseWikipedia logo v3.svg

    Database model

    A database model is the theoretical basis for a database and determines, in which structure data is stored in a database system.

    Database_modelWikipedia logo v3.svg

    Spreadsheet or database - Calc or Base ?

    An example

    This small example is intended to show how a simple database model works and why data processing with a database makes sense.

    Let's assume you have three parcels of land, on each of which you have an apartment building whose apartments are all rented out.

    • Parcel 1 has 5 apartments
    • Parcel 2 has 7 apartments
    • Parcel 3 has 11 apartments

    You want to manage the apartments.

    The main statement is:

    A parcel/house can have multiple apartments.

    Data in a spreadsheet

    In a spreadsheet, the context would be set as follows, example parcel 1:

    Post code: 12345|Ort: Spreadsheethausen|Street/Hnr: Zellenstraße 14||Flat registration number: SZ-W1|Number of rooms: 3|Rental price: 700,00|Incidental expenses: 200,00|Tenant: Meier, Stefan|Last move in: 01.03.2016|
    Post code: 12345|Ort: Spreadsheethausen|Street/Hnr: Zellenstraße 14||Flat registration number: SZ-W2|Number of rooms: 4|Rental price: 900,00|Incidental expenses: 300,00|Tenant: Müller, Kurt|Last move in: 01.07.2016|
    Post code: 12345|Ort: Spreadsheethausen|Street/Hnr: Zellenstraße 14||Flat registration number: SZ-W3|Number of rooms: 2|Rental price: 600,00|Incidental expenses: 150,00|Tenant: Schneider, Erich|Last move in: 01.01.2015|
    Post code: 12345|Ort: Spreadsheethausen|Street/Hnr: Zellenstraße 14||Flat registration number: SZ-W4|Number of rooms: 2|Rental price: 600,00|Incidental expenses: 150,00|Tenant: Schulze, Wolfgang|Last move in: 01.02.2014|
    Post code: 12345|Ort: Spreadsheethausen|Street/Hnr: Zellenstraße 14||Flat registration number: SZ-W5|Number of rooms: 4|Rental price: 900,00|Incidental expenses: 300,00|Tenant: Kleinmann, Edith|Last move in: 01.03.2017|
    

    The first part of each record would be redundant to the other.

    Therefore, we should use a database for this purpose.

    Data in a database

    When using a database, we do not want to have redundancy, the data should only occur once.

    For this purpose we create two tables.

    The table "Parcels" should have the following fields:

    • Post code
    • Ort
    • Street/Hnr

    that should be enough for a start.

    Of course, all important data for the parcel or house can be determined here.

    Property value, property tax, insurance, etc.

    Since there is a house on each parcel that has several flats, we create a flat table.

    The table "Apartment" should have the following fields:

    • Flat registration number
    • Number of rooms
    • Rental price T
    • Incidental expenses T
    • Tenant
    • Last move in

    This should also be sufficient for now.

    These two tables can be/are linked in the database via a so-called 1:n relationship [1] (they are in relation).

    Through this relationship it is now possible to assign several flats to each parcel/house.

    Theoretically, as many as desired. The 1:n relationship ensures that all data occur only once.

    [1] spoken: one to n relationship

    1:n-relationship:

    Schematic representation of the 1:n relationship in the database

    Source of error?

    The biggest source of error for a database is usually the person entering the data.

    For example, different spellings or typing errors can lead to data no longer being easily found.

    Let's take the name Müller as an example.

    Entries in the database are e.g.: ″Müller″, ″Müler″, ″Muller″.

    Therefore, appropriate specifications for the different input fields may have to be made for the person(s) who are to make entries.

    Further sources

    https://documentation.libreoffice.org/en/english-documentation/

    in German: https://wiki.documentfoundation.org/DE/Doku/Allgemein/01_Einf%C3%BChrung#Base_.28Datenbank.29

    in German: https://wiki.documentfoundation.org/DE/Doku/Allgemein/08_GettingStartedBase#Eine_Datenbank_planen

    in German: https://wiki.documentfoundation.org/DE/Doku/Allgemein/08_GettingStartedBase#Eine_Datenbank_erstellen

    Further Informations

    Documentation / Manuals

    Here you will find the Documentation / Manuals:

    Documentation / Manuals

    Any questions?

    For questions on this topic go to:

    Ask.LibreOffice

    Get Involved

    Join us today and help us to make it even better!

    Get Involved

    LibreOffice is Free Software and is made available free of charge.

    Your donation, which is purely optional, supports our worldwide community.

    If you like the software, please consider a Donation.