I have a Oracle object called Menu
which has a object type as an attribute.
menu type
Create Type Menu as Object(
beer REF beertype,
price float
)
beertype
Create Type beertype as object(
name char(20),
seller char(20)
)
table created using menu type
Create table Sells of Menu
table created using beertype
Create table beer of beertype
Now what I want to do is I want to write a select query which retrieves the name of the beer which has price more than 3.5.
I tried
SELECT beer.name
FROM Sells;
and
SELECT Sells.beer.name
FROM Sells;
Here's an example: test case first:
Query which selects beer name whose price is larger than 3.5:
Here's a nice article, if you want to read more: Using REF Values for Retrieval of Data Values