SELECT t1.id, t1.maker FROM car_makers AS t1 JOIN model_list AS t2 ON t1.id = t2.maker GROUP BY t1.id HAVING COUNT(*) >= 2 INTERSECT SELECT t1.id, t1.maker FROM car_makers AS t1 JOIN model_list AS t2 ON t1.id = t2.maker JOIN car_names AS t3 ON t2.model = t3.model GROUP BY t1.id HAVING COUNT(*) > 3
Manakah pembuat mobil yang menghasilkan setidaknya 2 model dan lebih dari 3 pembuat mobil?Sebutkan ID dan pembuatnya.
CREATE TABLE car_makers (id VARCHAR, maker VARCHAR); CREATE TABLE model_list (maker VARCHAR, model VARCHAR); CREATE TABLE car_names (model VARCHAR)