Question: Find the number of rooms for different block code?
Schema: create table room (blockfloor varchar, blockcode varchar, PRIMARY KEY (blockfloor)); create table block (blockcode varchar, blockfloor varchar, PRIMARY KEY (blockcode))
SQL: select count(*), t1.blockcode from block as t1 join room as t2 on t1.blockfloor = t2.blockfloor and t1.blockcode = t2.blockcode group by t1.blockcode