makhlo
03-31-2007, 03:27 PM
Hey everybody,
I am new to sql and have a problem to find the solution for this exercise: Find out the makers that sale PCs but not laptops.
The database scheme consists of four relations:
Product(maker, model, type)
PC(code, model, speed, ram, hd, cd, price)
Laptop(code, model, speed, ram, hd, screen, price)
Printer(code, model, color, type, price)
My own query:
select distinct maker from product, pc
where product.model = pc.model
and type in('pc','printer')
The problem is that i also get the makers who sells pc and laptops.
Thnx for any help,
I am new to sql and have a problem to find the solution for this exercise: Find out the makers that sale PCs but not laptops.
The database scheme consists of four relations:
Product(maker, model, type)
PC(code, model, speed, ram, hd, cd, price)
Laptop(code, model, speed, ram, hd, screen, price)
Printer(code, model, color, type, price)
My own query:
select distinct maker from product, pc
where product.model = pc.model
and type in('pc','printer')
The problem is that i also get the makers who sells pc and laptops.
Thnx for any help,