An Introduction to SQL
Tags: sql, beginners
Published: 2022-10-02 23:07:29

## Introduction to SQL
So, what exactly is SQL? The name SQL is an acronym for Structured Query Language, but is sometimes referred to as "Sequel". SQL is a database querying language used to extract, insert, delete and create records inside relational database management systems or RDBMS.  Although SQL has many more operations that can be performed, we will stick with the basics as this is meant to be an introduction to the language. 

## What is a database?

According to [oracle.com](https://www.oracle.com/za/database/what-is-database/), a database is an organized collection of structured information, or data, typically stored electronically in a computer system. A database is usually controlled by a database management system (DBMS). Data is most typically organized in rows and columns which are then put into separate tables in order to make querying them effective. Over the years, databases have evolved substantially from a simple tree-like model that only allowed a one-to-many relationship. Some of the newer, more flexible types of database are relational databases, object-oriented databases, and most recently cloud databases and self-driving databases.


![Example of a Database Structure](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/05ienurx2d697t8j7exe.png)

## What is SQL and why is it used?

Back in the days before SQL, before the internet, databases used to be kept as actual files in file cabinets. I'm sure its not difficult to imagine how tedious it would be to have to go through a plethora of files in filing cabinets, and manually have to compile the data you wanted as well as transforming it. This is part of the job of SQL. As mentioned above, SQL is used to query databases of potentially millions of pieces of data and return only  the relevant information the searcher has specified. Databases can not only contain millions of data entries, but also can have multiple different fields for each entry. This is where SQL can come in handy by returning only the values specified by the person querying the database. For example, if you wanted to query a database of soccer players, but wanted the data returned to be filtered in some way(such as height, name, or weight), SQL could return just that information.

## A brief history of SQL

According to Chad Brooks of businessnewsdaily.com,
> The SQL programming language was developed in the 1970s by IBM researchers Raymond Boyce and Donald Chamberlin. The programming language, known then as SEQUEL, was created following Edgar Frank Codd’s paper, “A Relational Model of Data for Large Shared Data Banks,” in 1970.

Since its development, according to W3 Schools, SQL has become a standard of the American National Standards Institute (ANSI) in 1986, and of the International Organization for Standardization (ISO) in 1987. The most recent version for SQL was published in 1992 by ANSI.

## Basic SQL syntax

Depending on the SQL database you're using, you may or may not need to use the semicolon character. This is because commands in SQL can sometimes span several lines, and some programs require the semicolon to signify the end of a command. As far as case sensitivity goes, SQL as a language is not case sensitive, but uppercase is most frequently used for command lines. There are different versions or dialects of the SQL language, but in order to be compliant with ANSI standards, they all support the major commands. These commands include:

- SELECT
The select keyword in SQL retrieves information from one or more than one database table

- UPDATE
The update keyword allows you to update information within a database

- DELETE
Allows you to delete information from database(s)

- INSERT
Allows you to insert information into database(s)

- WHERE
"WHERE" is used to filter data and return records that meet the chosen condition

Example of "SELECT", "FROM", and "WHERE" taken from w3schools.com:
`SELECT column1, column2, ...
FROM table_name
WHERE condition;`

On the "SELECT" line of the code example above, the column to be queried is chosen. "FROM" is used to choose which particular table you are trying to access. The "WHERE" condition can be set to return a particular ID associated with the data, or other constraints as mentioned in the intro of this post.

## Popular SQL Databases in 2022

There are many SQL databases, but three of the most popular, according to [DB-Engines](https://db-engines.com/en/ranking) are:

-  Oracle:

Oracle is the most widely used SQL database currently, however it is not seen as beginner friendly because the user may need a large amount of SQL knowledge to use the database effectively.

-  MySQL:

MySQL is a mostly open source, free-to-use database(Commercial license is required to use for businesses). It is also considered beginner friendly as anyone can download and begin to use MySQL in a short period of time. One of the drawbacks of using MySQL is that it lacks an efficient debugging tool relative to paid databases.

-  Microsoft SQL Server:

Microsoft SQL Server has a good source of documentation online, and boasts that it is the most secure database engine over the last 10 years.

## What jobs use SQL?

As I'm sure you would expect, software developers hit the top of this list because SQL is so useful for using data from databases to make graphs or keep statistics on web pages and on apps. However, SQL seems to be used widely by many different jobs. Some of these include business analysts, data scientists, financial consultants and many more professions. 

## Conclusion

All in all, SQL is an extremely versatile querying language, and can be used to do a multitude of different things. It is used for many different things from sports statistics to customer databases to finance. If this blog post has grabbed your interest, I have included a couple videos below that I found to be good introductions to the SQL language.



 










_Helpful Videos_
[Learn Web Code: MySQL for beginners](https://youtu.be/Yw3NNvqk-2o)
[Basic Intro/Explanation to SQL](https://www.youtube.com/watch?v=27axs9dO7AE)



**Sources**
[Business News Daily](https://www.businessnewsdaily.com/5804-what-is-sql.html)
[Wikipedia](https://en.wikipedia.org/wiki/SQL)
[NIST Gov](https://www.itl.nist.gov/div897/ctg/dm/sql_info.html)
[W3 Schools](https://www.w3schools.com/sql/sql_intro.asp)
[Top Databases 2022](https://towardsdatascience.com/top-databases-to-use-in-2022-what-is-the-right-database-for-your-use-case-bb8d3f183b21#:~:text=2.-,MySQL,need%20to%20purchase%20a%20license.)
[DB-Engines Current Rankings](https://db-engines.com/en/ranking)
[Microsoft SQL Server Info](https://www.microsoft.com/en-us/evalcenter/evaluate-sql-server-2022#Description)