1、题目

    题目 - 图1

    1. #第一题
    2. select city_id,count(clue_id),avg(price)
    3. from tbl_clue
    4. where date(created_at)="2016-6-7"
    5. GROUP BY city_id
    6. ORDER BY count(clue_id) DESC
    7. #第二题
    8. select city_name,count(clue_id),avg(price)
    9. from tbl_clue INNER JOIN tbl_city
    10. on date(created_at)="2016-6-7" and tbl_clue.city_id=tbl_city.city_id
    11. GROUP BY tbl_clue.city_id
    12. ORDER BY count(tbl_clue.clue_id) DESC
    13. #第三题