20091011_oracle_sql

 

Consider the following relational database schema. It is intended to represent who will eat what
kinds of sandwiches and the places which serve the various kinds of sandwiches. A sample
database instance is also given.

 

 table

Write SQL statements to retrieve the following information:
(i) places where Jones can eat (using a nested subquery).

 

SELECT ADDRESS FROM Locations WHERE LNAME IN
(SELECT LOCATION from sandwiches where FILLING in
(SELECT FILLING FROM tastes WHERE NAME = 'Jones'))


(ii) places where Jones can eat (without using a nested subquery).

 


(ii) for each location the number of people who can eat there.

發佈了31 篇原創文章 · 獲贊 0 · 訪問量 1萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章