edited by
265 views
0 votes
0 votes

Commodity items have some positive or negative changes in their prices each week. Each trading company picks a portfolio of commodity items, that is, they have one or more items and they own some non-zero quantity of each one. The database table for this problem consists of the following two relations:

Commodity(item-number int, price-change float, week int),
Owns(company-name text, item-number int, quantity float).

Write an SQL query which returns the item-numbers of commodities for which, in any given week, the price change is greater than or equal to that of all other items and there exists at least one company selling that item only. (i.e., not selling any other item) in that week.

edited by

Please log in or register to answer this question.

Related questions