Flat-File Relational Database 1

A website that displays a small amount of text information could be a candidate for a flat-file relational database (FFRD).

Like a traditional database, FFRD data is stored in tables with rows and columns. The tables use primary and foreign keys and are linked through one-to-one, one-to-many, and many-to-many relationships. Records are character-delimited text files.

The following example shows an application for organizing a quarterly magazine. There are three table - the Articles table, the Writers table and the Publications table

Click to see Demo
 flat-file relational database logo

Table Structure


The Writers table has a one-to-many relationship with the Articles table because each writer can provide multiple articles. The Publications table also has a one-to-many relationship with the Articles table because each publication contains multiple articles.

The Publications and Writers tables have a many-to-many relationship.

Files

 top level file structure
Top-level folder:
 data folders for cat's magaine application

Publications folder:
 files in publications folder

Inc Folder:
 contents of inc folder


View Code

This application provides 7 web pages:
The Functions file creates the database structure.
Two delimiters have been chosen: 'XYX' and 'XXX'.
Contents of the Publications file with delimiter separated fields.