数据可视化学习(二)------Excel或者ECharts的可视化实践(sakila数据库)

一,mysql加载Sakila样例数据库

  • 下载:http://downloads.mysql.com/docs/sakila-db.tar.gz
  • 解压:将解压的文件放入目录中
  • 在mysql中使用以下命令:
  • > source E:/sakila-schema.sql;(此处为自己的安装路径)
    
  •  >source E:/sakila-data.sql;(注意路径上的名称为英文,改成“\”)
    
  • select count(*) from custormer;显示几百条记录就说明导入成功了
    在这里插入图片描述在这里插入图片描述在这里插入图片描述

二,获取数据

  • 利用SQL语句,将customer_list表和payment表连接,从而得到各个城市每个消费者的消费额
  • select city,country from country,city,customer where country.country_id=city.country_id and city.city_id=customer.address_id;
    在这里插入图片描述
发布了14 篇原创文章 · 获赞 11 · 访问量 1990

猜你喜欢

转载自blog.csdn.net/weixin_44264744/article/details/89279362
今日推荐