Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2003
    Posts
    35

    Unanswered: Audits and Foreign keys

    Hi,

    I am creating a course booking system. Having database experience but not with mySql i have been reading that mySql does not support foreign keys, which was bit of a surprise for a database. How can this be implemented in mySql.

    Another question which I am unable to answer is how do you ensure that a query that asks "what customer have taken what courses in the last 12 months" returns the customers and courses if you have deleted the course months ago.

    Thanks,

    Mark

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    mysql does support foreign keys, but for special INNODB database types only

    consult the mysql.com site for more info

    as for your second question, the answer is, you can't

    that was easy, wasn't it?


    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Sep 2003
    Posts
    35
    I am not convinced that you cannot have some sort of archiving. From what I know a lot of medium to large sized companies use mySql and I can't imagine them staying in business long not being abe to run reports for marketing purposes. These are basic queries that you would want ay db to be able to perform.

    Mark

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    sorry mark, if my answer sounded flippant

    yes, if you archive the records, you can report on them

    however, you did say "... if you have deleted the course months ago"

    no database can report on records that have been deleted


    rudy
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  5. #5
    Join Date
    Sep 2003
    Posts
    35
    Hi Rudy,

    I wasn't very clear with what i was trying to achieve. On my ERD I have a BOOKING LINE table which will contain all booking info of courses for a particular company. I don't have a pk:fk relationship with the COURSE table. This has been achieved through COURSE VENUE, VENUE, tables. I think I am right in saying that a course can be deleted from the COURSE table but the BOOKING LINE table will still contain all the courses a particular customer went on. This table will grow until it has to be archived off. So queries could be run of the BOOKING LINE table.

    Many thanks,

    Mark

Posting Permissions

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