最近开始初步学习SQL,在Coursera上找到了UCD的SQL for Data Science,个人感觉挺细致的,适合入门学习。这节课的视频里概念题很多,所以在这里把关键概念知识点和做过的Quiz和Coding题分享出来,希望同行者一起进步~
Week 2: Filtering, Sorting, and Calculating Data with SQL
接 Week1:Coursera SQL for Data Science | Quiz答案, Week1_Spectre23c的博客-CSDN博客
接 Week3:Coursera SQL for Data Science | Quiz答案, Week3_Spectre23c的博客-CSDN博客
接 Week4: Coursera SQL for Data Science | Quiz答案, Week4_Spectre23c的博客-CSDN博客
目录
Keypoints
Basic Filtering with SQL
SELECT column_name, column_name
FROM table_name
WHERE column_name operator value;
=, <>, <, >, > =, < =, BETWEEN, IS NULL
Advanced Filtering with SQL
SELECT column_name, column_name
FROM table_name
WHERE column_name operator value;
IN Operator
WHERE column_name IN (x,y,z);
OR Operator
WHERE column_name = 'x' OR 'y';
AND Operator
WHERE (column_name = 'x' OR 'y' )AND z > 10;
NOT Operator
WHERE NOT column_name = 'x' AND NOT column_name = 'y' ;
Using Wildcards in SQL
Wildcards are only used with strings
Example:
%Pizza Grabs