Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

SQL

Introduction to SQL

This chapter provides a brief introduction to working with relational databases. You'll learn
about their structure, how to talk about them using database lingo, and how to begin an
analysis using simple SQL commands to select and summarize columns from database
tables.

Got It!
1. Welcome to the course!

Hi, and welcome to Introduction to SQL for Data Science! Most of the world's data
live in databases, so learning how to access and unlock insights from these data is
an essential skill for every data scientist. SQL, or ess-que-el, is the native language
for interacting with databases and is designed for exactly this purpose. This course
will give you a basic introduction to SQL. We hope you enjoy it.

2. Let's practice!

Now let's get started!

Exercise
Onboarding | Tables
The DataCamp interface for SQL courses contains a few unique features you should
be aware of.

For this course, you'll be using a database containing information on almost 5000
films. To the right, underneath the editor, you can see the data in this database by
clicking through the tabs.

From looking at the tabs, who is the first person listed in the people table?
Instructions
50 XP

Possible Answers

Kanye West

Biggie Smalls


50 Cent

Jay Z

Onboarding | Errors
If you submit the code to the right, you'll see that you get two types of errors.

SQL errors are shown below the editor. These are errors returned by
the SQL engine. You should see:

syntax error at or near "'DataCamp <3 SQL'" LINE 2: 'DataCamp <3 SQL' ^

DataCamp errors are shown in the Instructions box. These will let you know in plain
English where you went wrong in your code! You should see:

You need to add SELECT at the start of line 2!


Fixed:
Onboarding | Multi-step Exercises
The following multi-step exercise allows you to practice a new concept through
repetition. Check it out!

Beginning your SQL journey


Now that you're familiar with the interface, let's get straight into it.

SQL, which stands for Structured Query Language, is a language for interacting with
data stored in something called a relational database.

You can think of a relational database as a collection of tables. A table is just a set of
rows and columns, like a spreadsheet, which represents exactly one type of entity.
For example, a table might represent employees in a company or purchases made,
but not both.

Each row, or record, of a table contains information about a single entity. For
example, in a table representing employees, each row represents a single person.
Each column, or field, of a table contains a single attribute for all rows in the table.
For example, in a table representing employees, we might have a column containing
first and last names for all employees.

The table of employees might look something like this:

You might also like