TIP: Click on subject to list as thread! ANSI
echo: public_domain
to: Paul Edwards
from: Paul Markham
date: 1993-12-18 21:52:18
subject: Short Wave Database

Paul,



Here is my design for your shortwave database.



Station Table

-------------

    Station ID

    Station Name

    Country

    .

    anything else to do with the station

    .



Schedule Table

--------------

    Schedule ID

    Station ID

    Start Date

    End Date



Broadcast Table

---------------

    Broadcast ID

    Schedule ID

    Start Time

    End Time

    Week Days



Week days can be stored in a number of possible ways. The information for
all the days could be stored on the one broadcast record, either in a
character field with each bit representing a day, or an array of characters
with a flag in each occurrence. The other option is to store the
information in a seperate table and have one record for each day as such:



Day Table

---------

    Broadcast ID

    Day



For this application, I think storing the days on the Broadcast table is the best.



Frequency Table

---------------

    Frequency ID (actually, this field isn't really needed)

    Broadcast ID

    Frequency

    Language



The language field can also be stored in a number of different ways:



1) a text field with the actual language being used, eg English, German, Russian



2) an ID field which can then be used to index into a table of languages



3) a short code to identify the language, eg ENG, GER, RUS. This can then
be looked up in a table and expanded. We use this techinque a lot at work.





The ID fields are an inportant part of this design. They uniquely identify
the records and provide the links between tables. Usually the ID field is a
number that is just incremented each time a new record is added. At the
mimimun, the ID must be unique for each record in a table, but they can be
unique across all tables if it's easier. For instance:



Unique within the same table:



    station 1

        schedule 1

            broadcast 1

                frequency 1

                frequency 2

            broadcast 2

                frequency 3

        schedule 2

            broadcast 3

    station 2



Unique across all tables:



    station 1

        schedule 2

            broadcast 3

                frequency 4

                frequency 5

            broadcast 6

                frequency 7

        schedule  8

            broadcast 9

    station 10



Obviously, you will need to store the last used ID number(s) somewhere.



Since the records are fairly short, and the number are likely to be small,
it may be possible to store the whole database in memory, even under
MS-DOS. This would improve the performace of your program quite a lot.



The messages that get sent to you could be in a format like:



STATION=Voice of Gondwanaland

    DATE=19940101-19940131

        TIME=21:00-22:00

            FREQUENCY=123.45 English

            FREQUENCY=678.90 Gondwanese

        TIME=22:00-23:00

            FREQUENCY=987.65 German

            FREQUENCY=432.10 Russian

    DATE=....



etc.





Paul



--- GoldED/2 2.42.G1114

* Origin: Its life Jim, but not as we know it (3:711/934.1)
SEEN-BY: 635/514 711/809 934
@PATH: 711/934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.