News Tutorials

Datalore: 使用 SQL 进行深刻分析的 5 种技术

DataGrip 和 Datalore 团队向您问好!

您可能已经使用 DataGrip 有一段时间了,也许您已经掌握了 SQL 和数据库。 但是,如果您的数据洞见可以到达更广泛的受众,并帮助您推动公司的发展呢?

如今,人们对见解深刻的分析有巨大需求,能够讲述全面数据故事的人在市场上非常受重视。

阅读这篇博文,了解可以用来提升您的 SQL 分析技能的 5 种现代技术!

1. 将 SQL 与 Python 结合在一个界面中

SQL 非常适用于检索数据和计算基本统计数据,而 Python 在您需要深入、灵活的探索性数据分析时大有用武之地。 如果您在一个工具中可同时使用两种编程语言,会怎样?

在 JetBrains,我们将 DataGrip 的 SQL 引擎与 Datalore 的交互式功能相结合,在 Python Notebook 中引入了原生 SQL 支持。

现在,您可以直接在 Datalore 的编辑器中添加 SQL 单元,并从 SQL 数据源查询数据。 查询结果会自动传输到 pandas DataFrame,您可以继续在 Python 中无逢处理数据集。

Python 有几十个用于数据分析的软件包。 如果您刚入门,建议您从学习用于表数据分析的 pandas 和用于呈现精美交互式可视化效果的 Plotly 开始。

在Datalore中打开教程

Datalore Community 用户可以获得 30 天的 SQL 单元免费试用。 对于 Professional 和 Enterprise 用户,该功能没有任何限制。

2. 使用 Markdown 描述查询结果

您是否曾经回到一段时间之前写的 SQL 脚本,并心想“我到底想在这里做什么”?

Datalore 中的 Notebook 就像您的代码的 Google 文档。 您可以执行 SQL 查询,使用文本、图片和 Markdown 很好地记录您的代码和输出。 只需添加一个新的 Markdown 单元,使用标题创建一个结构,并使用目录在 Notebook 中导航。

瞧! 您获得了一个全面的数据故事,几乎已经可以分享了…

3. 使用精美的图表丰富查询结果

在 Datalore 中,点击鼠标就可以可视化查询结果:只需点击 SQL 单元输出中的 Visualize(可视化)选项卡,就可以得到一堆开箱即用的绘图选项。 您可以无缝过渡到图表单元,以获得多层次的图和其他选项。

如果您想进一步定制您的可视化效果,可以将其导出到 Python 代码单元,或者您可以使用选择的任何 Python 软件包从头开始创建可视化效果。

在Datalore中尝试

4. 与您的团队实时协作处理 SQL 查询

世界上越来越多的人开始远程工作,从您的同事那里得到面对面帮助变得越来越难。

借助 Datalore,您和您的队友可以跳到同一个 Notebook 中,一起实时编辑代码! 

共享 Notebook 非常简单 – 您只需要发送一个链接或电子邮件邀请。 您还可以指定访问权限,允许您的队友编辑 Notebook 或只能查看。

共享 SQL 分析结果的最常见方式是什么? 其中可能包括发送带有结果表的消息、创建 PowerPoint 幻灯片,或在电子表格中使用图表展示数据。

但我们知道可以通过一种更有效的方式共享您的分析结果。 您可以将您的 Notebook 变成报告。

在 Datalore 中,只需点击 Publish(发布)按钮,Notebook 就会变得通过链接可用,甚至对没有 Datalore 帐户的人也是如此。 您还可以隐藏任何不必要的代码,使您的 Notebook 看起来整洁。

现在,您可以将您在这里学到的所有提示付诸行动,分享一个精美的数据故事。

交互式报告仅在 Enterprise 方案中提供,如果您想在贵公司尝试交互式报告,请申请试用。

看看共享的静态报告是什么样子:

在Datalore中打开静态报告

您是否很想尝试所有这些功能? 如果是这样,请注册 Datalore Community,一个完全免费的版本。如果您想将数据保存在本地部署环境中,也可以考虑使用 Datalore Enterprise

我们希望这些提示对您有用。 不要忘记在关注 JetBrains 中国微博和微信公众号(ID: JetBrainsChina)来获取更多信息!

DataGrip 和 Datalore 团队

英文博文原作者:

Sue

Alena Guzharina

Discover more

News Tutorials

Datalore: 5 Techniques for Insightful Analytics With SQL

Greetings from the DataGrip and Datalore teams!

You may have already been using DataGrip for a while, and perhaps you’ve mastered SQL and databases. But what if your data insights could reach a wider audience and help you drive your company’s growth?

Nowadays there is huge demand for insightful analytics, and people who can tell comprehensive data stories are extremely valued on the market.

Read this blog post to learn about 5 modern techniques you can use to upgrade your SQL analytics skills! 

1. Combine SQL with Python in one interface

SQL is extremely good for data retrieval and calculating basic statistics, whereas Python comes into its own when you need in-depth, flexible exploratory data analysis. What if you could use both programming languages inside one tool?

At JetBrains, we have combined the power of DataGrip’s SQL engine with the interactive features of Datalore and introduced native SQL support inside Python notebooks.

Now you can add SQL cells right inside Datalore’s editor and query data from an SQL datasource. The query result is automatically transferred to a pandas DataFrame and you can continue seamlessly working on the dataset in Python.

Python has dozens of packages for data analytics. If you are just starting out, we recommend you start by learning pandas for table data analytics and Plotly for beautiful interactive visualizations.


Open tutorial in Datalore

Datalore Community users get a 30-day free trial for SQL cells. For Professional and Enterprise users the feature is unlimited.

2. Describe query results with Markdown

Have you ever come back to an SQL script you wrote some time ago and thought “what the heck was I trying to do here?”.

Notebooks in Datalore act like google docs for your code. You can execute SQL queries and document your code and outputs nicely with text, images, and Markdown. Just add a new Markdown cell, create a structure with headings, and navigate through the notebook using a table of contents.

Et voilà! You have a comprehensive data story that is almost ready to be shared…

3. Enrich query results with beautiful charts

Visualizing query results can be done with the click of a mouse in Datalore: just click the Visualize tab in the SQL cell output to get a bunch of out-of-the-box plotting options. You can seamlessly transition to Chart cells for multi-layered plots and other options.

If you want to further customize your visualization, you can export it to a Python code cell, or you can create visualizations from scratch using any Python package of your choice.


Try it in Datalore

4. Collaborate with your team on SQL queries in real-time

As the world increasingly goes remote, it might be hard to get face-to-face help from your colleagues when you really need it. 

With Datalore, you and your teammates can hop into the same notebook and edit code together in real-time! 

Sharing a notebook is easy — you just need to send a link or an email invitation. You can also specify the access rights, allowing your teammates either to edit the notebook or only to view it.

What are the most common ways to share SQL analytics results? They might include sending a message with a resulting table, assembling powerpoint slides, or presenting data with charts in spreadsheets.

But we know a more effective way to share your analytics results. You can turn your notebooks into reports.

In Datalore you can just hit the publish button and the notebook will become available via link, even for people who don’t have Datalore accounts. You can also hide any unnecessary code to make your notebooks look clean. 

Now you can put all the tips you have learned here into action and share a beautiful data story.

Interactive reports are only available on the Enterprise plan, please request a trial if you want to try interactive reports at your company.

Check out at how the shared static reports look:


Open static report in Datalore

Are you excited to try out all these features? If so, register for Datalore Community, which is completely free, or consider using Datalore Enterprise if you want to keep your data on-premises.

We hope that these tips were helpful. Don’t forget to follow Datalore and DataGrip on Twitter for more!

The DataGrip and Datalore teams

Discover more