Hello. Suppose there are two tables.
create table `houses` ( `id` int unsigned not null auto_increment, `address` varchar(100) not null, primary key(`id`) ); create table `doors` ( `id` int unsigned not null auto_increment, `house_id` int unsigned not null, `color` enum('green','red','yellow') not null, primary key(`id`) );
How to write a request to select, for example, all houses that have red doors and not having green ones.