For a given database

```
Product(maker, model, type)
PC(code, model, speed, ram, hd, cd, price)

```

The question is:
*Find the printer makers which also produce PCs with the lowest RAM and the highest-speed processor among PCs with the lowest RAM. Result set: maker.*

Lets split the query!

* *Find the printer makers which also produce PCs*

> 
> SELECT DISTINCT maker from product Group By maker,type HAVING type
>  IN('Printer','PC') 
> 
> 
> 

I think this is wrong because IN('Printer','PC') is like as OR not AND

* *PCs with the lowest RAM*

> 
> SELECT model,speed FROM pc WHERE ram=(SELECT MIN(ram) FROM pc) as lowestRam
> 
> 
> 

* *the highest-speed processor among PCs with the lowest RAM*

> 
> 
> ```
> WHERE
> lowestRam.speed=(SELECT MAX(speed) FROM pc WHERE ram=(SELECT MIN(ram) FROM pc))
> 
> ```
> 
> 

query itself!

```
SELECT DISTINCT maker FROM
(SELECT DISTINCT model,speed FROM pc WHERE ram=(SELECT MIN(ram) FROM pc)) as lowestRam
INNER JOIN product 
ON product.model=lowestRam.model
WHERE
lowestRam.speed=(SELECT max(speed) FROM pc WHERE ram=(SELECT MIN(ram) FROM pc))
Group By maker,type HAVING type IN( 'Printer' ,'PC')

```

Unfortunately when I submit the query on checking site, it produces 1 extra incorrect result :(

Question comes from [Link](http://www.sql-ex.ru/learn_exercises.php?LN=25).
There are 2 steps of query verification. The 2nd step shows only the difference between user and correct result :(