human
Schema:
artist (Artist_ID, Name, Country, Year_Join, Age)
exhibition (Exhibition_ID, Year, Theme, Artist_ID, Ticket_Price)
exhibition_record (Exhibition_ID, Date, Attendance)
Please answer with SQL.
assistant
Sure, I understand.
human
What is the name and country for the artist with most number of exhibitions?
assistant
SELECT T2.name , T2.country FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id = T2.artist_id GROUP BY T1.artist_id ORDER BY count(*) DESC LIMIT 1
human
What is the average and minimum age of all artists from United States.
assistant
SELECT avg(age) , min(age) FROM artist WHERE country = 'United States'
human
How many artists are above age 46 and joined after 1990?
assistant
SELECT count(*) FROM artist WHERE age > 46 AND year_join > 1990
human
Show all artist name, age, and country ordered by the yeared they joined.
assistant
SELECT name , age , country FROM artist ORDER BY Year_Join
human
What are all distinct country for artists?
assistant
SELECT DISTINCT country FROM artist
human
What are the names and year of joining for artists that do not have the country 'United States'?
assistant
SELECT name , year_join FROM artist WHERE country != "United States" ;