Home > SQL
SQL Basics
Querying Data
Filtering Data
Joining Tables
SQL Functions
Modifying Data
Defining Data
SQL Introduction
In this tutorial, we’re going to dig into SQL basics from the perspective of a total beginner. Let’s start by answering a few questions:
- What are Data and Information?
- What is Database?
- What is DBMS?
- What is SQL?
- How does SQL Works?
What are Data and Information ?
Data is facts and statistics stored or flow over a network, generally, it’s raw and unprocessed. It is an individual unit that contains raw materials.
For example, when you order something online, a lot of data about your order is stored, such as the order number, order date, customer number, and so on.
Data can be translated, processed, or structured into a new form called information, which is efficient and has a logical meaning that is normally used to analyze or plan something.
For example, aggregating orders over the years shows that the company is growing every year.
What is Database (DB) ?
By definition, a database is a collection of structured and related data organized in a way that data can be easily accessed and managed.
In short, the database is one way to store data. You deal with databases every day, for example, your photos are stored in your smartphone’s gallery, this gallery is a database.
There are many different types of databases such as relational databases, distributed databases, cloud databases, data warehouses, NoSQL databases:
Relational (SQL) Database
A Relational (SQL) Database consists of different tables like customers, orders, products..etc which are related to each other and have a fixed schema.
If your data is very structured, easy to understand, highly organized, SQL is a great choice.
Non-Relational (NoSQL) Database
A non-relational (NoSQL) database is ideal for projects facing changing data requirements, those that
If you are facing changing data requirements, you have to store different types of data such as unstructured data, or your data hard to understand, NoSQL may be your best bet.
What is DBMS ?
A Database Management System (DBMS) is software that allows the creation, definition, and manipulation of data in the database easily and effectively.
DBMS offers you an interface and tools to perform various actions such as the creation of database and tables, query data, and updating data.
At the present, there are almost 380 DBMSs such as:
According to StackOverflow’s 2021 Developer survey, the following DBMS are the most popular among developers:
In another ranking site such as DB-Engines, you will find a ranking list of the most popular DBMS based on different criteria such as a number of jobs, general interest, and number of mentions on websites:
Our tutorial is based on MySQL which is the most commonly used database these days.
What is SQL ?
SQL stands for Structured Query Language and by definition is a query language used for storing, retrieving, managing, or manipulating the data inside databases.
In short, SQL is the language you use to talk to databases.
You might hear on the Internet about the neverending battles about how SQL should be pronounced. Many English-speaking database professionals are for Sequel, others are for S-Q-L.
I pronounce it as S-Q-L, you can choose what suits you.
How does SQL Works ?
There is two ways to interact with DBMS
- Users can you DBMS software such as the interface of MySQL Workbench to interact with the databases using SQL.
- Applications can establish a connection to the DBMS to interact with the database using SQL.
Once an SQL Statement is executed, three steps will be done:
- DBMS will process the query, optimize it and then send it to the database.
- The database will perform a set of operations depends on the SQL statement such as creating, deleting, backup, inserting, and other database tasks.
- The database then returns the result to the DBMS interface or the application. The result may contain data represented as a table or info.