On reconstucting my database I wonder this:
I had a table
Under the line the table holds not much more than the date.
This date I used as foreign - key
Where did I use it?
In quotes: e.g. stock-quotes hold a lot of date-information every day. These I addressed as foreign key and the pointed at the above table.
I wonder:
Is this a good idea at all?
Is the date with 32 bit (?) not the same as the foreign key in matters of performance and storage?
The disadvantage of the foreign-key construction is, that I need 2 tables instead of one. Every change may be harder.
My second table of a foreign key is:
"pointing at a Char(2)"
I had a list of two digit chars, which was not too long. At this list pointed a foreign key of other tables.
Would you recommend to generate a char(2) field instead of using a foreign key?
I'm trying to wrap my mind around that.
You do realize, with JDATUM being a Primary Key, you can only add one record per JDATUM (and since it's of Type "date") resp. per Day.
How is that supposed to work with Stock-Data?
Or is that table meant to be a "Calendar"-Table as a Master to a Child-Table, say "Transactions" (or whatever)?
In any case, i never use Date(Time) Columns as Primary or Foreign Key, since the memory-requirement is miniscule and just adds complexity
If i need a Date(Time) in a Child-Table ("Transactions") it's its own Field.
In subsequent Queries it would then be just another Field i can filter or Group by or whatever
EDIT: After reading and participating in your other Threads, maybe you should show us the relevant tables (CREATE-Table-Statements), their Columns, and their relations between them, AND SPECIFICALLY: What they are meant to REPRESENT
Maybe we can crack this nut better then.
Since you admitted, this is an "old" design" of your Database, and you admitted to a "lack" of Database-Knowledge......