How to create a relational database?

Discuss the database features
Post Reply
fossiltx
Posts: 1
Joined: Sun Dec 01, 2019 4:36 pm

How to create a relational database?

Post by fossiltx »

I'm trying to create a relational data base so I can keep track of individual wells and the income from each of them. I have no problem creating the tables. However, I can't seem to get the relations to work. The well name will have lots of Production Dates. Can someone help me get thru this? Do I need another field?

Table for well info:

ID (PK)
ID Number
Well Name
Operator
Location
County
State
Interest
Type
Book
Page
Date Acquired
Date Sold
Owner Number
Notes:

Table for Income:

ID Number (PK)
Date Production
Rec Date
Gross Gas Rev
Gas Taxes
Liquids Gr Rev
Liquids tax
Other Deductions
Gross Oil Rev
Gross Oil Tax
Operating
Other Income
Net MCF
Net BBLS Oil
Gross $/MCF
Gross $/BBL
Intangible Expense
Tangible Expense
Leasehold

Title Edited (was "HELP!!!"). A descriptive title for posts helps others who are searching for solutions and increases the chances of a reply (Hagar, Moderator).
Open Office 4.1.7 on Mac OS 10.15.1
UnklDonald418
Volunteer
Posts: 1544
Joined: Wed Jun 24, 2015 12:56 am
Location: Colorado, USA

Re: How to create a relational database?

Post by UnklDonald418 »

It appears that for each well there will be multiple entries in the Table for Income
In that case, to establish a relationship between the two tables, the Table for Income will need another Integer field to serve as a Foreign Key. That field will contain the PK value from from the associated record in the well table.
If your problem has been solved, please edit this topic's initial post and add "[Solved]" to the beginning of the subject line
Apache OpenOffice 4.1.14 & LibreOffice 7.6.2.1 (x86_64) - Windows 10 Professional- Windows 11
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: How to create a relational database?

Post by John_Ha »

If reading the 565 pages LibreOffice Base Guide doesn't help then buy a program to do what you want. LO and AOO Base are very similar.

"Designing" a database when you don't know what you are doing is a recipe for great unhappiness in the future.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: How to create a relational database?

Post by Villeroy »

Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Post Reply