Ask Your Question
0

Relational vs Flat DB?

asked 2015-07-28 23:00:57 +0200

Santacarl gravatar image

Hello all,

I'm a noob to LO Base. Can someone tell me if you can create a relational database on a stand alone computer or does it have to be created on a server? If it's possible to do on a stand alone is there a link some place on how to? I'm going through the Getting Started PDF and it walks you through creating a flat DB but not a relational one....

I apologize for asking such a dumb question....but I'm trying to learn and I suppose I have to walk before I run and understand some of the basic concepts first.......

Thanks for any help....I appreciate it very much.

edit retag flag offensive close merge delete

3 Answers

Sort by » oldest newest most voted
1

answered 2015-08-03 16:43:02 +0200

peterwt gravatar image

As @doug and others said there is no problem creating a Relational Database in LO Base. The difference between a Flat File and Relational Database is the way data is organised in the Database - there is no requirement to have different hardware or use a server for a Relational Database.

A flat file database has one Table in which all the data is stored. It is the equivalent of the manual card index where each card has all the data about the Data Subject.

In a Relational Database there are two or more Tables with the data about the Data Subject split into different categories to be stored in the Tables.

Take an example of a Company that carries out repairs of customer units and where some customers regularly send in units. I a Flat File Database the detailed customer details would be repeated time and time again where the same customer is involved. This is will create an unnecessary large file. In a Relational Database for the same situation you could divide the data into two groupings, that about the unit and that about the customer. This data is in two Tables say Repairs an Customers. The Customer Table would have all the details about each Customer such as contact, company, address etc. and an unique reference number for each customer such as CustomerID. That can be created automatically with an auto-increment integer field and be the Primary Key for the Table. The Repair Table would have all the details about the unit and a CustomerID integer field. This would have the CustomerID contained in the Customer Table. So in effect all the Customer Details in the Repair Table are represented by a single number reducing the amount of repeated data. These two Tables would have a Relational Link on the CustomerID Field.

It is not always appropriate to use the Relational Model. A Database of your Contacts would not have repeated information nor say of members of a club.

As has already been said it is advisable to spend some time thinking about the design of a database before creating it. Is there repeated data which would be best served with a Relational Model. Once you have started entering data it is difficult to change the design. It is better to put too much in at first as if you find later you do not need some of the data it is easy to delete fields.

edit flag offensive delete link more
0

answered 2015-07-29 06:01:48 +0200

JKEngineer gravatar image

The short answer is that you can use a local machine for a relational database, and that LO Base will do it. There's a good set of videos prepared by The Frugal Computer Guy on YouTube at Libre Office Base They start pretty much at the very beginning and go through set up, customization, switchboards, etc. I found them very helpful and I think you will as well.

edit flag offensive delete link more

Comments

Thanks JKEngineer.....that sounds exactly like what I'm looking for...... I'm peddling as fast as I can and need all the help I can find! LOL....

Santacarl gravatar imageSantacarl ( 2015-07-29 06:56:57 +0200 )edit

You're welcome. Have fun.
If you felt my response answered your question, please click the check mark.

JKEngineer gravatar imageJKEngineer ( 2015-07-29 18:11:44 +0200 )edit
1

answered 2015-07-28 23:30:30 +0200

doug gravatar image

The short answer is: it is not necessary to buy server hardware to run a small-scale relational database.

The quintessential "flat" database is a spreadsheet.

A relational database is like two spreadsheets where one column of data in each of the spreadsheets links up. Like a row in spreadsheet a is "students" and a row in spreadsheet b is students enrolled in a particular course. Column 1 in a may be a student number; likewise a column in b may identify a particular student was enrolled in a class, each row in b representing a person enrolled in the class by the same student number. By linking on "student id", you speed up the processing and avoid repetition of name, address, etc., which is all confined to the first table. You can enforce those relationships with FOREIGN KEYS, meaning if a student ID is changed in spreadsheet a, you can automatically cascade the change to the list of enrollees in spreadsheet b (or prevent the original change). That is a relational database. Substitute table for spreadsheet in the terminology, and you have a working understanding of the mechanics of how relational databases are structured.

To get started, I would suggest Chapter 3 of the Base user handbook (p 34), which compares spreadsheets to tables and explains relationships and FOREIGN KEYS.

Any computer can run a database service, meaning offer connections to a database. In practice, a database service is just another program running in the background on a computer, which can be contacted by other programs, often via IP address and port, from the same computer or a different computer, and that will accept commands and report results. LibreOffice Base internally deals with all of that complexity, and no separate server or database service is required. LibreOffice connects to its own HSQLDB v1.8 service. That said, if you decide to run a separate database service on whatever hardware you happen to have (laptop, desktop, whatever, local or remote), LibreOffice most likely has the capability (through connector software packaged with LO or separately) be able to connect to it.

That said, if the database must be always on or has many records (millions, billions, etc.), or many concurrent users, specific server hardware would improve your experience.

(if this answered your question, please accept the answer by clicking the check (image description) to the left)

edit flag offensive delete link more

Comments

Thanks Doug. I appreciate the feedback. I had seen the information in chapter 3 but it was a bit technical for a beginner....or at least this beginner. I was hoping to find something along the lines of the exercise scenario in the getting started module. It was on the order of a LO Base for dummies and just perfect to walk you through the process where as Chapter 3 of the Base user handbook seems more theoretical in nature and for me it was overwhelming.... I was hoping to find a how to..

Santacarl gravatar imageSantacarl ( 2015-07-29 04:18:50 +0200 )edit

This one seems ok. The principles of all relational databases are similar-- its about tables, columns, and relationships between them. Queries allow you to merge and search information in tables. Forms allow user-friendly access to input. Reports provide similar output. First, figure out the structure of the data. Second, decide data types in columns. Third, get/create data. Fourth, search/query.

doug gravatar imagedoug ( 2015-07-29 05:55:51 +0200 )edit

Also be sure to look up the use of "surrogate" keys in linking your data. This is where the "pointer" into a parent database is an arbitrary number (usually assigned sequentially) that never changes and which the user (even you) normally does not see. What a surrogate key accomplishes is to allow you to change ANY field in the table and have it flow through the rest of the database (and reports), including any short IDs that you assign to a record.

jcarls gravatar imagejcarls ( 2015-07-30 17:43:53 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2015-07-28 23:00:57 +0200

Seen: 1,236 times

Last updated: Aug 03 '15