Native Relational Operations (Cont.)


Selection (Cont.)
Query: Find the products stored in Dallas that cost more than $0.50.

product
pid pname city quantity price
p01 comb Dallas 111400 0.50
p02 brush Newark 203000 0.50
p03 razor Duluth 150600 1.00
p04 pen Duluth 125300 1.00
p05 pencil Dallas 221400 1.00
p06 folder Dallas 123100 2.00
p07 case Newark 100500 1.00

PRODUCT where city='Dallas' and price>0.50
pid pname city quantity price
p05 pencil Dallas 221400 1.00
p06 folder Dallas 123100 2.00

Query: Retrieve all agents who have a percentage commission of at least 6%.

agent
aid aname city percent
a01 Smith New York 6
a02 Jones Newark 6
a03 Brown Tokyo 7
a04 Gray New York 6
a05 Otasi Duluth 5
a06 Smith Dallas 5

L := AGENT where percent>=6
L
aid aname city percent
a01 Smith New York 6
a02 Jones Newark 6
a03 Brown Tokyo 7
a04 Gray New York 6




      Sophia acted like she was my friend.    
      But then she stabbed me in the back (betray) and went out with my boyfriend.