Page 1 of 1

How to create a relational database?

PostPosted: Mon Jan 25, 2021 7:09 pm
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).

Re: How to create a relational database?

PostPosted: Fri Jan 29, 2021 11:17 pm
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.