sql数据库入门_我作为数据分析师为您撰写了此入门sql学习文章

sql数据库入门

SQL (Structured Query Language) has more than decades of history. SQL may not sound fancy as Python or R, two more modern popular programming languages, it has always been a part of the requirement for being a data analyst.

SQL(结构化查询语言)已有数十年的历史。 SQL听起来可能不像Python或R(这两种现代流行的编程语言)那么花哨,但它一直是成为数据分析师的要求的一部分。

Below is a job requirement for a data analyst. As you can see strong experience with SQL is a necessity for this post.

以下是数据分析师的工作要求。 如您所见,有必要具备SQL方面的丰富经验。

From which company?

从哪家公司?

Image for post

Tesla. Proficient in SQL gives you a higher chance to be a part of many big companies. And On Linkedin, there are over 7100 results with “SQL Data Analyst” in the US.

特斯拉。 精通SQL,可以为您提供更多加入许多大公司的机会。 在Linkedin上,美国的“ SQL Data Analyst”结果超过7100个。

Image for post

I believe these pictures are already convincing how crucial SQL is. With years of experience coding SQL, I am here to coach you on how to use SQL on a data analyst level. Since this article is for people without any prior knowledge, I will thoroughly explain everything. Moreover, I will only cover the querying and analysis parts. Therefore there will be no insert into/update/delete/alter table …statements. All statements begin with “Select”.

我相信这些图片已经说服了SQL的重要性。 凭借多年SQL编码经验,我在这里为您提供有关如何在数据分析师级别使用SQL的指导。 由于本文适用于没有任何先验知识的人,因此我将彻底解释所有内容。 此外,我将仅介绍查询和分析部分。 因此,不会在表中插入/更新/删除/更改表。 所有语句均以“选择”开头。

Let’s begin.

让我们开始。

Image for post
Photo by AltumCode on Unsplash
AltumCodeUnsplash拍摄的照片

The dataset demonstrated is from Student Alcohol Consumption in Kaggle (Link). The schema name is “dataset” and the table name is “student_mat”

演示的数据集来自Kaggle的“学生饮酒量”( 链接 )。 模式名称是“数据集”,表名称是“ student_mat”

基本-选择语句 (The basic — select statement)

To query record from a table, you need to tell which column is necessary from which table. Therefore in every SQL statement for querying, you must provide such information in the statement. The basic statement is

要从表中查询记录,您需要告诉哪个表中的哪一列是必需的。 因此,在每个要查询SQL语句中,您都必须在语句中提供此类信息。 基本声明是

SELECT * FROM dataset.student_mat;

There are four parts to this statement. The first part is a keywordselect that is used to select records from a database. The second part is the select clause, *.This part is to input which column you want to query. * represents to query all columns from a table. The third part is another keywordfrom and the last part is the from clause,dataset.student_mat.The last part is to input the name of the table. dataset is the name of a schema. A schema is a collection of tables, views, etc. You can think of a schema as a group of tables and datasetis the name of this group. student_matis the table name. There is a semicolon ;at the end of this statement to indicate that the statement is ended. (Although in some SQL database systems ending with a semicolon is not required, here I will just include it.) We can interpret this SQL statement as “To query all columns from the table “student_mat” in schema “dataset”.” One thing to remember is that keyword is case insensitive. Therefore selectis equivalent to SELECT or Select.

该声明分为四个部分。 第一部分是关键字select ,用于从数据库中选择记录。 第二部分是select子句* 。这部分用于输入要查询的列。 *

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值