Session 5: Creating another Table and Joins in SQL

close up photo of programming of codes
Photo by luis gomes on Pexels.com

Session 5: Creating another Table and Joins in SQL. In the past 4 articles, we went over the basics of SQL and in this article, we are going to create another table so that we can work on joining the two tables.

Create Another Table

We created a table called training in the previous articles. Similar to that process we will create a table called student that will hold the students’ first name, last name, class_id.

CREATE TABLE student

(

class_id varchar(20),

FName varchar(30),

LName varchar(30)

)

Inserting Values in the Second ‘Student’ table

Now let’s insert values in the student table using the following query

INSERT INTO student (class_id, FName, LName)

VALUES

(001, ‘John’,’Smith’),
(002, ‘Jane’,’Carlton’)

View the Data in the Student Table by running the SQL Query

SELECT * FROM student;

This is what you will get

Results

This is the last article in the series of understanding the basics of SQL. Your journey won’t stop here. There are many resources that you can use to build upon this. Here are a couple.

Learn SQL

SQL for Data Analysis

Do comment below in the comments section to let me know how it’s going.