Hi there,
First post - found the site yesterday. Great resource.
I am beginning work on a PHP/MySQL backend for a relatives small business.
The business is a building company, doing maintenance jobs & renovations.
Im a bit rusty with my design, having not undertaken something like this since uni, and have a few questions mainly about relationships.
So far I have the following tables.
Clients
Employees
Jobs
quotes
each job = one client, each client = many jobs
each job = one employee, each employee = many jobs
each quote = one job(or not, if the quote is declined and never becomes a job)
each job = one quote (or not, if the job was undertaken without requiring a quote)
quote table has the same relationship to clients & employees as job table also.
if I have the job table with FK's for clientID & employeeID, is this sufficient, or do i need new tables like "clientJob" with only 2 fields clientID & jobID - this part I am unsure of(ie why these tables are required rather than FK's in the job table)
My second design dilemma at present is the quoting - it seems silly to have a quote table that almost mimics the job table. (ie, the relationships will be duplicated), but I think that adding quote related fields to the job table will get very messy for searches later on..
As I said im pretty rusty, and this isnt a paid job, I do this in my spare time after work, but I still would like to get it right conceptually before I start any scripts.
Any thoughts? All replies appreciated
Cheers