I'm building a job database with simple invoicing. I have one table called
JOBS and one called INVOICES. In INVOICES there's a foreign key column
called job_id referencing INVOICES to JOBS.job_id.

in a simplified way it looks like this:
(there are a lot of other columns of course)

--------

table JOBS (
job_id int not null auto_increment,
jobname char(30),
primary key job_id
)

and

table INVOICES (
invoice_id int not null auto_increment,
job_id int(11),
foreign key job_id,
primary key invoice_id
)

--------

Would this make sense if in the future I want to find out:

#1 which jobs have and have not been invoiced
#2 what invoices are linked to specific job

What would the MySQL statement look like? I've tried to find out but I'm not
sure if the relations between both tables make sense at all ...

thanks for any help! K:)
 



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to