Coursera SQL for Data Science | Quiz答案, Week1

本文分享了Coursera上UCD的SQL for Data Science课程第一周的内容,包括数据模型、关系型数据库和事务模型的概念,以及Quiz和Coding题目的解答,涉及数据分析师、数据科学家等角色在SQL中的应用。

最近开始初步学习SQL,在Coursera上找到了UCD的SQL for Data Science,个人感觉挺细致的,适合入门学习。这节课的视频里概念题很多,所以在这里把关键概念知识点和做过的Quiz和Coding题分享出来,希望同行者一起进步~

Week 1: Selecting & Retrieving Data with SQL

接 Week2: Coursera SQL for Data Science | Quiz答案, Week2_Spectre23c的博客-优快云博客

接 Week3: Coursera SQL for Data Science | Quiz答案, Week3_Spectre23c的博客-优快云博客

接 Week4: Coursera SQL for Data Science | Quiz答案, Week4_Spectre23c的博客-优快云博客

目录

Keypoints

Module 1 Quiz

Module 1 Coding Questions

Keypoints

Data Models, Part 1: Thinking About Your Data

Databases: A container (usually a file or set of files) to store organized data; a set of related information

Tables: A structured list of data or a specific type

Column: A single field in a table - all tables are made up of one or more columns

Row: A record in a table

Data Models, Part 2: The Evolution of Data Models

Data Modeling: ~organizes and structures information into multiple, related tables; can represent a business process or show relationships between business processes; should closely represent the real world

Evolution of Data Models:

1960 Hierarchical, 1969 Network, 1970 Relational, 1976 Entity Relationship, 1978 Semantic, 1985 Object-Oriented, 1990 Extended Relational, 2009 NoSQL

NoSQL: A mechanism for storage and retrieval of unstructured data modelled by means other than tabular relations in relational databases

Data Models, Part 3: Relational vs. Transactional Models

Relational Model: Allows for easy querying and data manipulation in an easy, logical and intuitive way.

Transactional Model: Operational database-insurance claims within a healthcare database

Entity, Attribute, Relationship - 1 to 1, 1 to many, many to many

ER Diagrams: Primary Keys, Foreign Keys,

ER diagram Notation:

Chen: 1 M, M N, 1 1

Crow’s Foot Notation: line

UML Class Diagram Notation: 1.1 1., 1. 1.*, 1.1 1.1

Coding: SELECT Statement, Creating Tables, Creating Temporary Tables, Adding Comments to SQL

Module 1 Quiz

我印象中Coursera上的Quiz题目顺序可能会随机生成,这里按照我遇到的罗列下来:)

Question 1: Select the jobs below that may use SQL in their work (select all that apply).

A. Data Analyst

B. Data Scientist

C. Backend Developer

D. DBA

E. QA Engineer

Answer: ABCDE

Question 2: How does a data scientist and DBA differ in how they use SQL?

A. DBA’s are the only ones who merge datasets together.

B. Data scientists only query the database and don’t create tables.

C. DBAs manage the database for other users.

D. Data scientists don’t write complex queries.

Answer: C

Question 3: Which of the following statements are true of Entity Relationship (ER) Diagrams?

A. They usually are represented in a visual format.

B. They identify the Primary Keys

C. They speed up your querying time.

D. They are usually a representation of a business process.

E. They show you the relationships between tables.

F. They only represent entities in the diagram.

Answer: ABDE

Question 4: Select the query below that will retrieve all columns from the customers table.

Answer:

SELECT *

FROM customers

Question 5: Select the query that will retrieve only the Customer First Name, Last Name, and Company.

Answer:

SELECT

FirstName

,LastName

,Company

FROM customers

Question 6: The ER diagram below is depicting what kind of relationship between the EMPLOYEES and CUSTOMERS tables?

A. One-to-one

B. One-to-many

C. Many-to-one

D. Many-to-many

Answer: B

Question 7: The data model depicted in the ER diagram below could be described as a _______________.

A. Star Schema

B. Relational Model

C. Transactional Model

Answer: B

Question 8: When using the "CREATE TABLE" command and creating new columns for that table, which of the following statements is true?

A. You can create the table and then assign data types later

B. You must insert data into all the columns while creating the table

C. You must assign a data type to each column

Answer: C

Question 9: Look at the values in the two columns below. Based on the values in each column, which column could potentially be used as a primary key?

A. Column 1

B. Column 2

C. Column 1 OR Column 2

Answer: A

Question 10: In order to retrieve data from a table with SQL, every SQL statement must contain? A. WHERE

B. SELECT

C. CREATE

D. FIND

Answer: B

Module 1 Coding Questions

Question 1:Retrieve all the records from the Employees table.

Code:

SELECT *

From Employees;

What is Robert King's mailing address?

Answer:590 Columbia Boulevard West, Lethbridge, AB, CANADA T1K 5N8

Question 2:Retrieve the FirstName, LastName, Birthdate, Address, City, and State from the Employees table.

Code:

SELECT FirstName ,

LastName ,

BirthDate ,

Address ,

City ,

State

From Employees;

Which of the employees listed below has a birthdate of 3-3-1965?

Answer: Steve

Question 3: Retrieve all the columns from the Tracks table, but only return 20 rows.

Code:

SELECT *

From Tracks

Limit 20;

What is the runtime in milliseconds for the 5th track, entitled "Princess of the Dawn"? 

Answer: 375418

R is one of the most popular, powerful data analytics languages and environments in use by data scientists. Actionable business data is often stored in Relational Database Management Systems (RDBMS), and one of the most widely used RDBMS is Microsoft SQL Server. Much more than a database server, it’s a rich ecostructure with advanced analytic capabilities. Microsoft SQL Server R Services combines these environments, allowing direct interaction between the data on the RDBMS and the R language, all while preserving the security and safety the RDBMS contains. In this book, you’ll learn how Microsoft has combined these two environments, how a data scientist can use this new capability, and practical, hands-on examples of using SQL Server R Services to create real-world solutions. How this book is organized This book breaks down into three primary sections: an introduction to the SQL Server R Services and SQL Server in general, a description and explanation of how a data scientist works in this new environment (useful, given that many data scientists work in “silos,” and this new way of working brings them in to the business development process), and practical, hands-on examples of working through real-world solutions. The reader can either review the examples, or work through them with the chapters. Who this book is for The intended audience for this book is technical—specifically, the data scientist—and is assumed to be familiar with the R language and environment. We do, however, introduce data science and the R language briefly, with many resources for the reader to go learn those disciplines, as well, which puts this book within the reach of database administrators, developers, and other data professionals. Although we do not cover the totality of SQL Server in this book, references are provided and some concepts are explained in case you are not familiar with SQL Server, as is often the case with data scientists.
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值