SQL

Equipping you with the essential data science skills to effectively manage relational databases by extracting, transforming, and loading your data.
Hours

8

Lessons

121

Quizzes

33

Assignments

59

Course description

SQL is one of the fundamental programming languages you need to learn to work with databases. When you are a data scientist in a company and you need data to perform your analysis, you usually have two options: extract it on your own or contact the IT team. Of course, the ability to extract your own data is an extremely valuable skill to have. In this course, we will teach you everything you need to know in terms of database management and creating SQL queries.

1

Introduction to Databases, SQL, and MySQL

Whether you are working in business intelligence (BI), data science, database administration, or back-end development, you will have to retrieve information from a server storing large amounts of data. To achieve this, you need SQL. The relational database management system we chose for this course is MySQL. We did that because MySQL is open-source, reliable, and mature. In one of the videos of this section, we will provide you with step-by-step guidance when you install MySQL Server and MySQL Workbench. The introductory part of this course pays significant attention to database theory. You will learn the meaning of terms like database, data table, data entity, record, field, relation, and more.

2

SQL Theory

In this section, we study the components of the Structured Query Language, SQL. We will focus on the following syntaxes: Data Definition Language (DDL), Data Manipulation Language (DML), Data Control Language (DCL), and Transaction Control Language (TCL). In addition, we will introduce you to the concept of using SQL Keywords.

3

Basic Database Terminology

We are sure that you will be many times more efficient and precise in producing your SQL queries if you are in good command of basic database terminology. At the end of the day, that's why SQL has been created: to help you store, retrieve, and manipulate data from relational databases. So, knowing exactly what a relational database is and understanding the meaning of terms like 'relational schema,' 'primary key,' 'foreign key,' 'unique key,' and 'entity relationships' is something that is crucial for giving you confidence and precision in your work with SQL.

4

Installing MySQL and Getting Acquainted with the Interface

In this section, we will provide you with step-by-step guidance on how to install MySQL Server and MySQL Workbench, the two components you need in order to start working with MySQL. Then, you'll need to set up a connection between Workbench and the server. Of course, we will show you how to do that, and then we will conclude by making a quick tour of the MySQL Workbench interface. What you will see in these lectures will be more than enough of a preparation for working with the software before you start coding in the next section.

5

First Steps in SQL

It is time to create your first database and make your first steps in SQL. In this section, we will introduce you to string, fixed- and floating-point, and other useful data types. You will learn how to create a database table and how to use such a table. Not only that, but we will also introduce the different types of constraints that can be assigned to tables (primary key, foreign key, unique key, default, not null, and other types of constraints)

6

MySQL Constraints

So far, you've been acquainted with crucial theoretical topics and fundamentals in coding in MySQL. In this section, both will come together to show you how primary keys, foreign keys, and unique keys are applied in practice through MySQL Constraints. Once you have mastered these three, we will continue with other types of constraints that you will encounter daily in your work, such as the DEFAULT Constraint and the NOT NULL Constraint.

7

SQL Best Practices

There are many ways you can write your SQL code, but there are only a few that are considered professional. In this part of the course, we will teach you how to write professional code and how to adhere to professional best practices. To reinforce what you have learned, we will wrap up this section with an easy-to-understand practical example.

8

Loading the Data

One of the best features of our SQL training is that it uses a real-life database – the “Employees” database. We will use it to manipulate data in MySQL in all lessons. In this chapter, you will download the SQL file and will run it in Workbench.

9

SQL SELECT STATEMENT

When doing analysis with SQL, regardless of whether in that moment you are working on the administration of your relational database, on a business intelligence analysis, or are doing some preliminary work in the data science field, you will be constantly dealing with the SQL SELECT Statement. We cannot stress enough how important it is to have completely internalized the structure of this particular SQL statement. That's why, in this section, we will make sure you will learn and practice all the fundamentals of the SELECT Statement. We won't let you proceed before you feel comfortable using it.

10

SQL INSERT Statement

Apart from delivering the segment of the data you need from your database through the SELECT Statement, SQL also gives you the chance to manipulate your data. The Data Manipulation Language, DML, is the part of the SQL syntax that contains the commands that will allow you to do that. In this section, we will focus on the INSERT Statement, which is obviously about inserting data to a table from your database.

11

SQL UPDATE Statement

Still on the subject of manipulating your data set, in this section we will focus on another DML Statement: the UPDATE Statement. Sometimes you won't need to insert new data, but you will want to correct or update some of the existing data in your database. That's why you have the UPDATE Statement, which is there just for that!

12

SQL DELETE Statement

A bit trickier than the SQL INSERT and UPDATE Statements is the SQL DELETE Statement. Yes, it definitely is about removing information from your data set, but you must be prudent when using it. First, you risk losing data that you might actually need, and second, you shouldn't confuse it with the DROP and TRUNCATE statements. This section is devoted to clarifying all these subject matters.

15

SQL Subqueries

Here, you will learn how to write subqueries, a key SQL tool for more advanced users. The section also includes a number of useful tips and tricks and aims to take your SQL skills to the next level.

16

SQL Self Join

Joins are one of the most powerful and frequently-used tools in SQL. This is a tool you will need when combining the information from two or more tables. After completing this section, you will be able to use inner, left, right, and cross joins.

17

SQL Views

The focus of this part of the course is the SQL View. A view in SQL is a virtual table whose contents are obtained from an existing table or tables. Using this, SQL Tools has several advantages that will all be discussed in this lecture.