I have a table that contains all the parts a particular car Model requires:
CarBuild -id -model -partId
So to get all the parts for a model you would do:
select * from CarBuild where model=f150
The CarProgress has the cars currently being manufactured and what parts have been installed.
CarProgress -model -partId
How can i query all the car progress cars that are missing parts grouped by model?
I have the below query so far, should I be doing an left outer join?
select * from carprogress cp inner join carbuild cb on cp.model = cb.model
If someone could explain to me their solution that would be ideal.
The following recommendations will help you in your SQL tuning process.
You'll find 3 sections below:
ALTER TABLE `CarBuild` ADD INDEX `carbuild_idx_model_f150` (`model`,`f150`);
SELECT * FROM CarBuild WHERE CarBuild.model = CarBuild.f150