If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Audits and Foreign keys

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-24-03, 19:13
ypx5269 ypx5269 is offline
Registered User
 
Join Date: Sep 2003
Posts: 35
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
Reply With Quote
  #2 (permalink)  
Old 10-24-03, 19:38
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,525
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?


__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 10-25-03, 05:33
ypx5269 ypx5269 is offline
Registered User
 
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
Reply With Quote
  #4 (permalink)  
Old 10-25-03, 08:00
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,525
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
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #5 (permalink)  
Old 10-25-03, 11:24
ypx5269 ypx5269 is offline
Registered User
 
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On