jennyek2000
Programmer
How could I relate this table in the database?
I have a Jobs table which stores information about engineering jobs and each job has a unique number which is the key. This is linked to a documents table through a one to many relationship, and each job has a number of documents of different types. Each document has a unique reference number which consists of the job number, the document size, the document type and a number which identifes the document within the job. This number depends on the type of the document and the number of that type within the job. E.g. a document which is a sketch has the numbers 1001-1010, with the first document in the job of this type allocated the number 1001:
JOBS(JobNumber (KEY), JobType, Client, Description)
DOCUMENTS (JobNumber (FK), Number, Reference (KEY), DocumentType, Document Size)
In order to determine the Number of the document at any time, I need some sort of number lookup table as follows:
NUMBERLOOKUP (DocumentType, CurrentNumber, NumberLimit)
But I havent a clue how to link this to the database. There should be a record for each document type within each job, Remembering that each job has a number of documents of different types and each type has a specific range of numbers.
SOrry if this is confusing.
Thanks,
Jenny
I have a Jobs table which stores information about engineering jobs and each job has a unique number which is the key. This is linked to a documents table through a one to many relationship, and each job has a number of documents of different types. Each document has a unique reference number which consists of the job number, the document size, the document type and a number which identifes the document within the job. This number depends on the type of the document and the number of that type within the job. E.g. a document which is a sketch has the numbers 1001-1010, with the first document in the job of this type allocated the number 1001:
JOBS(JobNumber (KEY), JobType, Client, Description)
DOCUMENTS (JobNumber (FK), Number, Reference (KEY), DocumentType, Document Size)
In order to determine the Number of the document at any time, I need some sort of number lookup table as follows:
NUMBERLOOKUP (DocumentType, CurrentNumber, NumberLimit)
But I havent a clue how to link this to the database. There should be a record for each document type within each job, Remembering that each job has a number of documents of different types and each type has a specific range of numbers.
SOrry if this is confusing.
Thanks,
Jenny