bawse
bawse

Reputation: 230

List the names of items that had bids of $50 that did not sell, via relational algebra

I have the following relational database schema:

schema

I want to write the following query in relational algebra without using inequalities, disjunctions or conjunctions in the selection operator:

List the names of items that had bids of $50 that did not sell.

I have come up with the following:

π iname (σ price=50 ((ITEM ⨝ BID) - π iid (SALE)))

Upvotes: 2

Views: 1441

Answers (1)

Revolucion for Monica
Revolucion for Monica

Reputation: 3296

Your attempt is almost good.

I don't know the dimensions of your tables when one does the subtraction. One should always have the same dimension:

πinameprice=50((ITEM⨝BID) - πiid(ITEM⨝SALE)))

Upvotes: 2

Related Questions