Table schema:
CREATE TABLE table_name_40 (floors INTEGER, city VARCHAR, rank VARCHAR)

Question: What is the average number of floors for buildings in mecca ranked above 12?
SQL: SELECT AVG(floors) FROM table_name_40 WHERE city = "mecca" AND rank < 12