next up previous contents
Next: Which employee earns Up: Simple Queries Previous: Simple Queries

Edna earns which salary?

 

Just a simple query.

ENG: edna earns which salary
SYN: (s(np(propn(edna)))(vp(v(earns))(np(det(which))(n(n(salary))))))
 PT: `salary:fv1 and `earn:fv1:`edna
FOL: salary(fv1)&earn(`edna,fv1)
URC: {fv1;[*,*,fv1,*]:emp&[`edna,*,fv1,*]:emp}
DRC: {fv1:emp![sal];[*,*,fv1,*]:emp&[`edna,*,fv1,*]:emp}
OP1: {fv1:emp![sal];[`edna,*,fv1,*]:emp}
TRC: {fv1!sal;fv1:emp;
      exists(tuple1:emp,tuple1!name=edna&tuple1!sal=fv1!sal)}
OP2: {fv1!sal;fv1:emp;
      exists(tuple1:emp,tuple1!name=edna&tuple1!sal=fv1!sal)}
OP3: {fv1!sal;fv1:emp;exists(sk1:emp,sk1!name=edna&sk1!sal=fv1!sal)}
SQL: SELECT DISTINCT fv1.sal FROM emp fv1 
      WHERE EXISTS(SELECT * FROM emp sk1 
       WHERE (sk1.name='edna' AND sk1.sal=fv1.sal));

|sal                 |
|--------------------|
|            $2000.00|
|--------------------|
(1 rows)



Chris Fox, September 1995