Find the makers of the PCs that have speed not less than 450MHz. Result set: Maker.
My Query -
SELECT maker FROM product
WHERE model IN ( SELECT model FROM pc WHERE speed > 450 ) AND type = 'PC'
Output -
however i tried by adding DISTINCT
in my query and its giving the desired output, but there is some logical error in my query as it is not passing the system.
DB Schema -
SELECT * FROM product --
SELECT * FROM pc --
you can use JOIN
SELECT DISTINCT b.maker
FROM PC a
INNER JOIN Product b
ON a.model = b.model
WHERE speed >= 450
Or simply this too works,
Select distinct Product.maker from Product, PC
where Product.model = PC.model
and PC.speed >= 450
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.