SQL, The Language of Databases

Leonides Lemus
3 min readJun 3, 2021

--

What is SQL?

SQL stands for Structured Query Language and it is used to communicate to a relational database management system(RDBMS), a database that stores data in tables that can have relationships with other data tables. SQL allows you to manage data in a database. With it, we can write commands to store, retrieve, manipulate, or delete data.

SQL’s History

SQL is a very old concept starting in the 1970s by IBM. It was first created by IBM researchers Donald D. Chamberlin and Raymond F. Boyce to use Codd’s model of relational databases. SQL was originally called SEQUEL but later had to be changed due to copyright. Today SQL is the known as the standard language for RDBMS.

The Four Basic Functions of SQL

There are four major operations that you can do with databases. They are create, read, update, and delete. It is also know in the software development world as CRUD for short. SQL has a corresponding function for each of these operations.

Insert

The insert function corresponds to the CRUD operation create. This allows you to create new data and store it inside of your database. An example of the SQL syntax is as follows:

INSERT INTO Customers (CustomerName, ContactName, Address, City, PostalCode, Country)
VALUES ('Cardinal', 'Tom B. Erichsen', 'Skagen 21', 'Stavanger', '4006', 'Norway');

And the new data would appear at the bottom of table like this:

Select

The select function corresponds to the CRUD operation read. This allows you to get back data stored inside of your database. You can ask for a whole table or just an individual column. An example of the SQL syntax is as follows:

SELECT CustomerName, City FROM Customers;

This will return back the name and cities column from the customers table

Update

The update function is easy to remember because it corresponds to the update operation in CRUD. Update allows you to manipulate and change existing data inside of the database. An example of the SQL syntax for this function is:

UPDATE Customers
SET ContactName = 'Alfred Schmidt', City= 'Frankfurt'
WHERE CustomerID = 1;

This updates the customer table by setting a different name and city to the customer with the ID of 1. The new table will look like this:

Delete

The delete function is also easy to remember because it corresponds to delete in CRUD. The delete function allows you to remove data from your database permanently. An example of the delete syntax looks like this:

DELETE FROM Customers WHERE CustomerName='Alfreds Futterkiste';

This deletes the customer that has ‘Aldreds Futterkiste’ as the name from the customer table. The table will now look like:

--

--