sql没有足够的值

数据科学 (DATA SCIENCE)

SQL is a powerful language. SQL is a part of most of the tech stacks you’ll work with. For a developer, the use of SQL might be limited to inserting and retrieving data in the database, but for data analysts, data scientists and data engineers, it is usually much more than that. SQL gives you direct access to the database — there’s a whole lot of analytics that can be done right there — without getting data out of the database and loading it into pandas or PySpark. Obviously, what you can do within the database is limited because of the resources.

SQL是一种强大的语言。 SQL是您将使用的大多数技术堆栈的一部分。 对于开发人员而言,SQL的使用可能仅限于在数据库中插入和检索数据,但是对于数据分析人员,数据科学家和数据工程师而言,SQL的用途远不止于此。 SQL使您可以直接访问数据库-可以在此处直接进行很多分析-无需将数据从数据库中取出并加载到pandas或PySpark中。 显然,由于资源的原因,您在数据库中可以执行的操作受到限制。

From what I have observed over the years, people who work with a statistical programming language like R, Julia or Python tend to do almost everything in that language whereas some of the stuff can be actually done more efficiently with SQL at times. Apart from the basic selects, inserts, updates, joins and subqueries, there are a lot of advanced features of SQL which can be used for data analysis that we don’t exploit often enough.

根据我多年来的观察,使用诸如R,Julia或Python之类的统计编程语言的人往往会使用该语言来执行几乎所有操作,而有些事情实际上有时可以用SQL更有效地完成。 除了基本的选择,插入,更新,联接和子查询外,还有很多SQL的高级功能可用于数据分析,但我们很少利用这些功能。

There’s a post on KDNuggets which says that it’s the last guide that you’d need for data analysis. Although it’s a well written guide but I think that it definitely is NOT the last guide you’d need for data analysis. You’ll need to know more. I’d say that the Medium post you’re reading right now is also not the last guide you’ll need to be great at SQL. This just talks about a few neglected, underused but powerful features of SQL. Let’s go ahead and go over some of them.

KDNuggets上有一篇文章,说这是您进行数据分析所需的最新指南 。 尽管这是一本写得很好的指南,但我认为它绝对不是您进行数据分析所需的最后指南。 您需要了解更多。 我想说的是,您现在正在阅读的中级帖子也不是您精通SQL的最新指南。 此处仅讨论了一些被忽略,未充分利用但功能强大SQL功能。 让我们继续研究其中的一些。

分层查询 (Hierarchical Queries)

Enterprise relational databases like Oracle had started supporting storage and retrieval of hierarchical data long time ago. Before MySQL 8 was released, MySQL was probably one of the few databases which didn’t support a straightforward way of querying hierarchical data. I have had to refer this article by Mike Hillyer many times over the last couple of years while implementing hierarchical storage in MySQL. It’s a great read.

像Oracle这样的企业关系数据库很久以前就开始支持分层数据的存储和检索。 在发布MySQL 8之前,MySQL可能是少数几个不支持直接查询分层数据的数据库之一。 在MySQL中实施分层存储时,最近几年我不得不多次引用Mike Hillyer的文章 。 这是一本好书。

Hierarchical data is everywhere if you think about it — categories and sub-categories and further subcategories of products, organizational hierarchy, animal and plant species, family trees and so on. Normal SQL features aren’t enough to query hierarchical data efficiently as it would result in a lot of subqueries (and confusion). In MySQL 5.7 or earlier, you’d use something called session variables to do hierarchical queries and in MySQL 8 or later and in other databases, you’d use recursive common table expressions.

如果您考虑一下,分层数据无处不在-产品的类别和子类别以及其他子类别,组织层次结构,动植物种类,家谱等。 普通SQL功能不足以有效地查询分层数据,因为它会导致大量子查询(和混乱)。 在MySQL 5.7或更早的版本中,您将使用称为会话变量的内容进行分层查询,而在MySQL 8或更高版本中以及其他数据库中,则将使用递归公用表表达式。

Hierarchical data is everywhere — product categories & subcategories, organizational hierarchies, family trees etc.

层次结构数据无处不在-产品类别和子类别,组织层次结构,族谱等。

I’ll give you some context on this. An ex-colleague called me up one day and asked me about how to run a hierarchical query on MySQL 5.7 — until this version MySQL did not support common table expressions. So, here’s what the query would look like. Let’s now talk about CTEs

sql没有足够的值_您还没有足够使用的4种高级SQL功能相关推荐

  1. sql like 多个值_用于数据分析的8个SQL技术

    介绍 SQL是数据科学专业人员军械库中的一个关键齿轮.这是经验之谈,如果你还没有学会SQL,你就不能指望在分析或数据科学领域取得成功. 为什么SQL如此重要? 随着我们进入新的十年,我们生产和消费数据 ...

  2. sql动态sql给变量复值_在动态SQL中使用变量

    sql动态sql给变量复值 Before we delve into these SQL concepts, note that I like to do all my development in ...

  3. sql server datetime取年月_快速定位数据库性能问题,RDS推出慢SQL统计分析

    在使用云的过程中,哪些指标最重要,是安全.弹性,还是计算能力? 其实这些都很关键.除此之外,云最重要的就是数据库了.数据库的性能直接关系到系统执行的效率和稳定性,更与业务紧密相关.如果数据库出现性能问 ...

  4. sql登录名和用户名_通过分配角色和权限来移动或复制SQL登录名

    sql登录名和用户名 This article speaks to, how to copy SQL Logins on the new server with Server Level roles ...

  5. mybatis delete返回值_面试:谈谈你对MyBatis执行过程之SQL执行过程理解

    前言 在了解了MyBatis初始化加载过程后,我们也应该研究看看SQL执行过程是怎样执行?这样我们对于Mybatis的整个执行流程都熟悉了,在开发遇到问题也可以很快定位到问题. 更重要的,在面试中遇到 ...

  6. sql 找到最近的值_数据分析——SQL查询(常用函数)

    SQL入门推荐书籍--<SQL必知必会>.猴子的live课程--<从零开始学SQL> [基本SQL查询语句] select 选择输出字段 from 摘自某表 as 取别名(如果 ...

  7. 没有足够的值_孙悟空唯一一次没有搬救兵,玉帝如来却主动出手是什么时候?...

    (蜗牛看西游第4611期) 文/蜗牛 孙悟空在取经路上干的最多的事就是搬救兵,只要让他知道这个妖怪的主子是谁,不出半个小时猴子就能把这个神仙请到妖怪的面前.但是,有时候还是有一些特殊情况的,这种情况叫 ...

  8. 没有足够的值_元丰通宝值多少钱吗?市场价值如何?有没有足够的收藏空间?...

    元丰通宝是宋代神宗年间发行的,那么你知道现在元丰通宝值多少钱吗?市场价值如何?有没有足够的收藏空间?宋代虽然没有强大的军事实力,但其国内经济水平得到了发展,在许多朝代都处于领先地位.在元丰通宝的铸造过 ...

  9. 没有足够的值_了解食物的GI值,让你的减脂效率翻倍

    减肥的朋友一定听说过升糖指数,身边了解一些减脂的朋友也一定告诉你:这个食物GI低适合减肥的你,那个食材GI高,减肥就别吃了."是的,减肥是要吃升糖指数低的食物,但为什么呢?很多人就不是很了解 ...

最新文章

  1. Unity Note 1
  2. python培训就业班口碑排行榜-Python就业班培训多少钱?老男孩Python收费标准
  3. linux下=号与==号
  4. Ubuntu 16.04下Caffe-SSD的应用(四)——ssd_pascal.py源码解读
  5. js中闭包的概念和用法
  6. uC/OS-II源码分析(二)
  7. C/C++初学者快速提升?
  8. 【离散数学】代数系统的同态(同构)
  9. 设计模式之单例模式8种实现方式,其三:懒汉式(线程不安全)
  10. 百练(九~十二)题解
  11. java字典类_Java字典类
  12. u8系统计算机上启动不了,用友erp u8装好后为何启动不了
  13. 哪些专业软件可以测试cpu,常用的正经CPU测试软件有哪些
  14. HMC5883L手册总结与经验分析 详解
  15. 《Machine Learning in Action》—— 剖析支持向量机,单手狂撕线性SVM
  16. python - 作业13:打地鼠小游戏(附代码)
  17. 基于关联规则(Apriori)+协同过滤(collaborative filtering)实现电影推荐系统
  18. windows服务器无法安装net3.5 提示:无法通过windows功能控制面板自动安装或卸载windows server角色和功能服务器
  19. 做柜员还是程序员_放弃月薪2万的程序员,被爸妈喊回家干公务员,看到工资悔不当初...
  20. 基本数据结构——线性结构(列表/无序表)

热门文章

  1. android 智能锁,Android-BLE-Lock 智能门锁客户端实践
  2. 2019新年聚, 拔牙第二天
  3. Flask全栈开发教程
  4. 用GitChat赚钱的6种方法
  5. 【Python入门教程】第72篇 读取CSV文件
  6. 1584.连接所有点的最小费用(Kruskal算法) | 1697. 检查边长度限制的路径是否存在(并查集)
  7. ClickHouse系列--Too many partitions for single INSERT block (more than 100)
  8. ChatGPT绘本故事,引领孩子探索神奇世界!
  9. Redis | 慢查询
  10. 2022山东省安全员A证特种作业证考试题库及模拟考试