in Databases
1,132 views
0 votes
0 votes
Product(maker, model, type)

PC(model, speed, ram, hd, price)

Laptop(model, speed, ram, hd, screen, price)

Find those manufacturers of at least two different computers (PC’s or laptops) with speeds of at least 3.0

is my query correct?

select maker from Product NATURAL JOIN PC where speed>=3 AND count(distinct model)>=2

UNION

select maker from Product NATURAL JOIN Laptop where speed>=3 AND count(distinct model)>=2
in Databases
by
1.1k views

4 Comments

but in ur query it cannot take count 1 for both the case. U took "count(distinct model)>=2"
0
0
it'll be very complicated then
0
0
I got this
0
0

1 Answer

1 vote
1 vote
Select maker from Product , PC, Laptop where $(PC.speed>=3)OR(Laptop.speed>=3)$ and count model$>=2$

1 comment

You are doing cartesian product of the three relations and also using common attribute 'model' without specifying the relation name using dot operator.
0
0

Related questions