SQL Crash Course: A Beginner’s Guide to Relational Databases

Learn SQL with Udemy

For an instructor lead, in-depth look at learning SQL click below.


Welcome to the SQL Crash Course where we will dive into the world of relational databases. If you’re a beginner with little to no experience with SQL or databases, don’t worry, by the end of this guide, you’ll have a solid foundation of SQL basics and you’ll be able to create, query, and manipulate data stored in a relational database.

What is SQL?

SQL, or Structured Query Language, is a language designed to manage data held in a relational database management system (RDBMS). It has a variety of functions including querying data, updating data, inserting data, creating and modifying databases and tables, and setting permissions on tables, procedures, and views.

Setting up a database

Let’s start by setting up a sample database which we will use throughout the course. Below is a query to create a database named ‘student_db’.

Creating Tables

Once our database is set up, we can create some tables. Here is an example of creating a ‘students’ table with four columns – ‘id’, ‘first_name’, ‘last_name’, and ’email’.

Inserting data

With a table in place, we can start inserting data into it. Let’s add three different students to our ‘students’ table.

Querying data

What good is a database if we can’t retrieve the data, right? We use SELECT query for this purpose. For example, to get all the data from the ‘students’ table, we would use the following query:

In SQL, * is a wildcard character that represents ‘all’. So, SELECT * means select all columns. If we wanted to select only certain columns, we could replace * with the column names, separated by commas. For example, if we wanted to select only first name and email, our query would look like this:

Wrapping Up

This is the tip of the iceberg when it comes to SQL, but with these basics, you can already do a lot. Practice creating your own databases and tables, inserting data, and writing queries, and you’ll be well on your way to becoming proficient in SQL! In the next section, we will cover more advanced topics like JOINs, aggregate functions, subqueries, and more. So, stay tuned!

Leave a Comment