How many assets have fault logs?
select count ( * ) from ( select * from assets as t1 join fault_log as t2 on t1.asset_id = t2.asset_id group by t1.asset_id having count ( * ) > = 1 )
How many of those 9 assets have 2 parts?
select count ( * ) from ( select t1.asset_id, t1.asset_details from assets as t1 join asset_parts as t2 on t1.asset_id = t2.asset_id group by t1.asset_id having count ( * ) = 2 intersect select t1.asset_id, t1.asset_details from assets as t1 join fault_log as t2 on t1.asset_id = t2.asset_id group by t1.asset_id having count ( * ) > = 1 )
Out of those 2 which has less than 2 fault logs?
select t1.asset_id, t1.asset_details from assets as t1 join asset_parts as t2 on t1.asset_id = t2.asset_id group by t1.asset_id having count ( * ) = 2 intersect select t1.asset_id, t1.asset_details from assets as t1 join fault_log as t2 on t1.asset_id = t2.asset_id group by t1.asset_id having count ( * ) < 2