human
Schema:
member (Member_ID, Card_Number, Name, Hometown, Level)
branch (Branch_ID, Name, Open_year, Address_road, City, membership_amount)
membership_register_branch (Member_ID, Branch_ID, Register_Year)
purchase (Member_ID, Branch_ID, Year, Total_pounds)
Please answer with SQL.
assistant
Sure, I understand.
human
Show the city and the number of branches opened before 2010 for each city
assistant
SELECT city , COUNT( * ) FROM branch WHERE open_year < 2010 GROUP BY city;
human
Which year were those branches opened?
assistant
SELECT open_year FROM branch WHERE open_year < 2010;
human
Cities that were opened before 2010 | Ah, I cannot understand. Do you mean cities that have branches opened before 2010? | Give me names of branches opened before 2010
assistant
SELECT name FROM branch WHERE open_year < 2010 ;