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
Show all exhibitions.
assistant
SELECT * FROM exhibition;
human
What is the average ticket price?
assistant
SELECT AVG ( ticket_price ) FROM exhibition;
human
Which exhibitions have a ticket price higher than the average?
assistant
SELECT * FROM exhibition WHERE ticket_price > ( SELECT AVG ( ticket_price ) FROM exhibition );
human
What are the themes and artist names for the exhibitions with a ticket price higher than the average?
assistant
SELECT T1.theme , T2.name FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id = T2.artist_id WHERE T1.ticket_price > ( SELECT AVG ( ticket_price ) FROM exhibition ) ;