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 of the artist who joined latest?
assistant
SELECT name FROM artist ORDER BY year_join DESC LIMIT 1
human
How many artists do we have?
assistant
SELECT count(*) FROM artist
human
Show all artist names and the year joined who are not from United States.
assistant
SELECT name , year_join FROM artist WHERE country != 'United States'
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
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
Count the number of artists who are older than 46 and joined after 1990.
assistant
SELECT COUNT( * ) FROM artist WHERE age > 46 AND year_join > 1990 ;