Relations:
Product(maker, model, type)
Laptop(Model, price, speed, ram, hd, screen)
PC(model, price, speed, ram, hd)
Printer(model,price, color, price)
I am trying to find pc’s who share both the same speed and same ram.
What I have tried:
SELECT model FROM pc WHERE pc.speed = pc.speed AND pc.ram = pc.ram;
This is again (If you have seen my list of questions from today), that this is the wrong syntax.
I want to compare each tuple in pc to each other tuple in pc and create a new relation based on a pc’s speed and ram sharing anothers.
Note that this will return two rows for every match…
A <-> BandB <-> A. If you want to prevent this, you can change your query to something like the following: