Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Q 3 : Nested Query ( 5 pt ) : Given the same relational schema above. You should only use nested query: NationalPark ( pid

Q3: Nested Query(5 pt): Given the same relational schema above. You should only use nested query:
NationalPark(pid, name, state, year,rating, entry_fee)
BelongTo(pid, tid ?(), loc)
Hiking(t.tid, name, length, rating)
LocIn(d,cid,loc)
Campsite(cid, name, fee, rating)
Answer the nested SQL query for the following questions:
(a) Juan plans to visit all national parks in Texas, he plans to only visit the parks that have a trail with a rating greater than 4, and ALL the campsites are cheap enough (less than $10 per night) so that he can afford them. Could you help him figure it out (You should return a table that consists of park name: (name))
(b) Jose also plans to visit national parks after this semester. He is Juan's best friend. He plans to visit the national parks where ALL the trails have a rating greater than 3. Juan and Jose plan to meet at some national parks to hike a trail together. Is it even possible? Please write an SQL query that can verify your answer and explain it.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Seven Databases In Seven Weeks A Guide To Modern Databases And The NoSQL Movement

Authors: Eric Redmond ,Jim Wilson

1st Edition

1934356921, 978-1934356920

More Books

Students also viewed these Databases questions