I am making a table in my data base:
Date:
Statement#:
Load#:
other stuff...
then fuel:
one statement can have multiple loads and each load can have multiple fuel entries
how do I make tables inside of tables?
thank you
Database table with multiple fields
Database table with multiple fields
Open Office 4.3.1, Windows 11
Re: database table with multiple fields
You should make multiple tables. One table would have the Date, Statement Number and perhaps other information. A second table would have the Load Number and a Foreign Key relationship between the Statement Number of the first table and the same Statement Number stored in the second table. Similarly, the third table would have the fuel information and a foreign key relationship with the Load Number. Every row of the second table would be associated with one row of the main table via the Statement Number. This is known as a 1:N relationship. There would also be a 1:N relationship between the Load Number table and the Fuel table.
In queries, you would join the first table to the Load Number table, requiring that the Statement Numbers match, to see all of the Load information associated with the selected Statement Numbers. Another join would be used to match Loads and Fuel information. I suggest you read a tutorial about a Normalized Database. It is well worth the effort to get the database design correct from the beginning.
In queries, you would join the first table to the Load Number table, requiring that the Statement Numbers match, to see all of the Load information associated with the selected Statement Numbers. Another join would be used to match Loads and Fuel information. I suggest you read a tutorial about a Normalized Database. It is well worth the effort to get the database design correct from the beginning.
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
Re: Database table with multiple fields
See Fuel consumption of cars and motorcycles from Board index ‹ Getting started ‹ Tutorials ‹ Base ‹ Database Examples
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
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice