SQL 101: Everything You Need to Know to Get Started

Learn SQL with Udemy

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


SQL, or Structured Query Language, is the standard language for manipulating and retrieving data from databases. In this post, we will provide you with an understanding of how to write SQL code and perform basic operations such as create, insert, select, update, and delete data from a database.

Create Database and Table

Before we start working with data, we first need a place to store it: in SQL, this is called a database. We use the CREATE DATABASE command, followed by the name we want to give to our database.

After creating our database, we need to create a table within it. We use the CREATE TABLE command to do so.

This command creates a table called Employees with four columns: ID, Name, Age, and Salary.

Insert Data

To insert data into our table, we use the INSERT INTO command. This command requires the name of the table, the column(s) where the data will be inserted, and the actual data.

Select Data

To retrieve data from our table, we use the SELECT command. This command requires the names of the columns you want to retrieve, and the table where those columns are located.

This command will return the names and ages of all employees in the Employees table.

Update Data

If you want to amend data within your table, you would use the UPDATE command. This command requires the name of the table, which column’s data will be updated and to which new data, and a WHERE clause (to specify which rows will be updated).

Delete Data

Lastly, the DELETE command allows you to remove data from your table. This command requires the name of the table and a WHERE clause (to specify which rows will be deleted).

With these basic codes, you now have a good foundation to start exploring more complex SQL queries. Remember, practice makes perfect! So go ahead and start working on your data with these fundamental SQL codes. Happy coding!

Leave a Comment