human
Schema:
race (Race_ID, Name, Class, Date, Track_ID)
track (Track_ID, Name, Location, Seating, Year_Opened)
Please answer with SQL.
assistant
Sure, I understand.
human
Find the locations where have both tracks with more than 90000 seats and tracks with less than 70000 seats.
assistant
SELECT LOCATION FROM track WHERE seating > 90000 INTERSECT SELECT LOCATION FROM track WHERE seating < 70000
human
What are the names for tracks without a race in class 'GT'.
assistant
SELECT name FROM track EXCEPT SELECT T2.name FROM race AS T1 JOIN track AS T2 ON T1.track_id = T2.track_id WHERE T1.class = 'GT'
human
How many tracks do we have?
assistant
SELECT count(*) FROM track
human
What is the name, location and seating for the most recently opened track?
assistant
SELECT name , LOCATION , seating FROM track ORDER BY year_opened DESC LIMIT 1
human
What are distinct locations where tracks are located?
assistant
SELECT DISTINCT LOCATION FROM track
human
What are the names and locations of all tracks?
assistant
SELECT name , LOCATION FROM track ;