- Query 1: Currency Conversion
SELECT Istream(auction, DOLTOEUR(price), bidder, datetime)
FROM bid [ROWS UNBOUNDED];
- Query 2: Selection
SELECT Rstream(auction, price)
FROM Bid [NOW]
WHERE auction = 1007 OR auction = 1020 OR auction = 2001 OR auction = 2019 OR auction = 2087;
- Query 3: Local Item Suggestion
SELECT Istream(P.name, P.city, P.state, A.id)
FROM Auction A [ROWS UNBOUNDED], Person P [ROWS UNBOUNDED]
WHERE A.seller = P.id AND (P.state = `OR' OR P.state = `ID' OR P.state = `CA') AND A.category = 10;
- Query 4: Average Price for a Category
SELECT Istream(AVG(Q.final))
FROM Category C, (SELECT Rstream(MAX(B.price) AS final, A.category)
FROM Auction A [ROWS UNBOUNDED], Bid B [ROWS UNBOUNDED]
WHERE A.id=B.auction AND B.datetime < A.expires AND A.expires < CURRENT_TIME
GROUP BY A.id, A.category) Q
WHERE Q.category = C.id
GROUP BY C.id;
- Query 5: Hot Items
SELECT Rstream(auction)
FROM (SELECT B1.auction, count(*) AS num
FROM Bid [RANGE 60 MINUTE SLIDE 1 MINUTE] B1
GROUP BY B1.auction)
WHERE num >= ALL (SELECT count(*)
FROM Bid [RANGE 60 MINUTE SLIDE 1 MINUTE] B2
GROUP BY B2.auction);
- Query 6: Average Selling Price by Seller
SELECT Istream(AVG(Q.final), Q.seller)
FROM (SELECT Rstream(MAX(B.price) AS final, A.seller)
FROM Auction A [ROWS UNBOUNDED], Bid B [ROWS UNBOUNDED]
WHERE A.id=B.auction AND B.datetime < A.expires AND A.expires < CURRENT_TIME
GROUP BY A.id, A.seller) [PARTITION BY A.seller ROWS 10] Q
GROUP BY Q.seller;
- Query 7: Highest Bid
SELECT Rstream(B.auction, B.price, B.bidder)
FROM Bid [RANGE 1 MINUTE SLIDE 1 MINUTE] B
WHERE B.price = (SELECT MAX(B1.price)
FROM BID [RANGE 1 MINUTE SLIDE 1 MINUTE] B1);
- Query 8: Monitor New Users
SELECT Rstream(P.id, P.name, A.reserve)
FROM Person [RANGE 12 HOUR] P, Auction [RANGE 12 HOUR] A
WHERE P.id = A.seller;
The NEXMarkGenerator (in java) is