Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2009
    Posts
    2

    Unanswered: Database table query

    Hi

    I am having trouble with designing a database. I am construction my tables and can't seem to understand the correct way to proceed. Basically my databse is for a company that has approx 150 vehicles. Every vehicle has to have an annual MOT inspection.

    My table will have a next annual MOT inspection date field and a last MOT inspection date.

    However, I am unsure of the best and most logical way to store data relating to MOT inspections for the previous years.

    Once an MOT inspection has been completed, I will update the database so that the next MOT inspection date is correct and the previous MOT date will need to be transferred to an archive table of some sort.

    Hope you can help.

  2. #2
    Join Date
    Dec 2007
    Location
    London, UK
    Posts
    741
    CREATE TABLE VehicleMOTHistory
    (RegistrationNumber VARCHAR(20) NOT NULL
    REFERENCES Vehicles (RegistrationNumber),
    MOTIssueDate DATETIME NOT NULL,
    MOTExpiryDate DATETIME NOT NULL
    /* ... other columns? */,
    PRIMARY KEY (RegistrationNumber,IssueDate)
    );

  3. #3
    Join Date
    Apr 2009
    Posts
    2
    Thanks for the help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •