台灣房屋仲介平台交流論壇

標題: 58同城深圳商铺出租分析 [打印本頁]

作者: admin    時間: 2023-10-18 14:25
標題: 58同城深圳商铺出租分析
5 商區均價和占比排名

起首把district為深圳的行的district改成對應的行政區名,把district為空的行的district改成‘其他’

  1. update tongchengshoprental set district=case when location in ("龙华新區",
  2. "宝安",
  3. "龙岗區",
  4. "南山",
  5. "罗湖",
  6. "福田",
  7. "布吉",
  8. "坪山新區",
  9. "大鹏新區",
  10. "盐田",
  11. "光亮新區"
  12. ) then location when district = ''  then '其他' else district end;
複製代碼

然後把district為‘布吉’的行的district改成‘龙岗區’:

  1. update tongchengshoprental set district=case when district = '布吉' then '龙岗區' else district end;
複製代碼

然後把區的名字格局同一為两個字:

  1. update tongchengshoprental set district=case when district like '%區%' then left(district, 2) else district end;
複製代碼

接下来的数据洗濯主如果三步,把每平米天天房錢乘以30获得每平米每個月房錢;從面积中提掏出数字;去掉每平米天天房錢小于0.5的分歧理数据。

先建立一個從字符串中提取数字的函数:

  1. CREATE  FUNCTION `GetDeciNum`( Varstring VARCHAR ( 50 ) ) RETURNS varchar(30) CHARSET utf8
  2. DETERMINISTIC
  3. BEGIN
  4. DECLARE
  5. v_length INT DEFAULT 0;
  6. DECLARE
  7. v_Tmp VARCHAR ( 50 ) DEFAULT '';
  8. SET v_length = CHAR_LENGTH( Varstring );
  9. WHILE
  10. v_length > 0 DO
  11. IF
  12. (
  13. ASCII( mid( Varstring, v_length, 1 ) ) > 47
  14. AND ASCII( mid( Varstring, v_length, 1 ) ) < 58
  15. OR ASCII( 音波拉皮 ,mid( Varstring, v_length, 1 ) ) = 46
  16. ) THEN
  17. SET v_Tmp = concat( v_Tmp, mid( V娛樂城推薦,arstring, v_length, 1 ) );
  18. END IF;
  19. SET v_length = v_length - 1;
  20. END WHILE;
  21. RETURN REVERSE( v_Tmp );
  22. END
複製代碼

然後建立一個知足以上三個前提的新视图:

  1. CREATE VIEW tongchengshoprental_new AS SELECT
  2. title,
  3. url,
  4. true_month_price,
  5. true_day_price,
  6. true_day_price * 30 AS true_price_per_month,
  7. true_area,
  8. type,
  9. STATUS,
  10. district,
  11. location,
  12. address,
  13. tags
  14. FROM
  15. (
  16. SELECT
  17. title,
  18. url,
  19. CONVERT ( month_price, DECIMAL ( 10, 2 ) ) true_month_price,
  20. CONVERT ( day_price, DECIMAL ( 10, 2 ) ) true_day_price,
  21. CONVERT ( GetDeciNum ( area ), DECIMAL ( 10, 2 ) ) true_area,
  22. type,nba即時比分,
  23. STATUS,
  24. 瘦身燃脂丸,district,
  25. location,
  26. address,
  27. tags
  28. FROM
  29. tongchengshoprental
  30. ) tmp
  31. WHERE
  32. true_day_price > 0.5
複製代碼

新视图tongchengshoprental_new成果以下:

現實举行阐發的表

表布局以下:

1 出租总價、面积、每平米每個月代價的最大最小值和均匀值

  1. select max(true_month_price), min(true_month_price), avg(true_month_price) from tongchengshoprental_new
複製代碼

出租总價的最大最小值和均匀值

出租总價的均匀值為130985,中位数為13000,均匀值比中位数大不少

  1. select max(true_area), min(true_area), avg(true_area) from tongchengshoprental_new
複製代碼

出租面积的最大最小值和均匀值

出租面积的均匀值為338.73平米,中位数為75平米

每平米每個月代價的最大最小值和均匀值

每平米每個月代價的均匀值為527.53,中位数為142.2

2 每一個區的代價均匀值和数目占比是几多

  1. SELECT
  2. district,
  3. concat( round( count( 1 ) / ( SELECT count( 1 ) FROM tongchengshoprental_new ) * 100, 2 ), '%' ) '占比',
  4. round(avg( true_price_per_month ), 2) '均匀房錢(元/月*平方米)'
  5. FROM
  6. tongchengshoprental_new
  7. GROUP BY
  8. 1
  9. ORDER BY
  10. 除蟎洗面乳,3 DESC;
複製代碼

深圳每一個區的商店出租均匀房錢排行

罗湖和宝安均匀房錢排前两位,坪山和大鹏排最後两位

  1. SELECT
  2. district '行政區',
  3. concat( round( count( 1 ) / ( SELECT count( 1 ) FROM tongchengshoprental_new ) * 100, 2 ), '%' ) '占比',
  4. round(avg( true_price_per_month ), 2) '均匀房錢(元/月*平方米)'
  5. FROM
  6. tongchengshoprental_new
  7. GROUP BY
  8. 1
  9. ORDER BY
  10. count( 1 ) DESC;
複製代碼

深圳每一個區的商店出租占比排行

南山和龙岗占比最高,大鹏和盐田占比最低

3 每種商店类型的占比和均價




歡迎光臨 台灣房屋仲介平台交流論壇 (http://bbs.zhanwang.com.tw/) Powered by Discuz! X3.3