
20-05-2007, 09:36
|
|
|
|
חבר מתאריך: 10.05.07
הודעות: 9
|
|
1- DBMS : MySql
2-TASK
Find the pairs of PC models having similar speeds and RAM. As a result,
each resulting pair is shown only once, i.e. (i, j) but not (j, i).
Result set: model with higher number, model with lower number, speed, and RAM.
3-SQL (Self Join)
select p.model, c.model, c.speed, c.ram
from pc p, pc c
where p.speed = c.speed
AND p.ram= c.ram
And p.model != c.model
4-RESULTS
model model speed ram
1233 1232 500 64
1233 1121 750 128
1232 1233 500 64
1121 1233 750 128
1260 1232 500 32
1232 1260 500 32
5-TODA
|