When using a database, we need to establish communication with it in some way, and it is through SQL that we are able to achieve this communication. So, SQL is a structured and declarative query language through which we are able to communicate with the database.

SQL

What is SQL?

As I mentioned in the introduction, it is a language used for communicating with a database. SQL was developed in the 1970s by IBM. With this language we perform such actions as retrieving data from the database, adding new data, modifying it. SQL also works great when we need to filter individual data and retrieve it. It is also used for database management systems such as MySQL. It's also worth mentioning that the SQL language has become a standard for establishing communication with database servers.

 

Are you looking for a contractor working with SQL ?
logo

The most common queries used in SQL

SELECT - this query is used to display a table along with its contents.

SELECT * FROM animals;

 

Such a query will retrieve for us the entire contents of the animals table. If we want to retrieve only specific columns, then instead of "*", we enter the names of the columns we are interested in. Example below.

SELECT Name, Age FROM animals;

 

WHERE - this query is used to filter the records.

SELECT * FROM animals
WHERE Age > 5;

Such a query will return a list of animals, where the age of the animal is greater than 5.

 

ORDER BY - is used to sort the data in ascending or descending order.

SELECT * FROM animals

ORDER BY Age;

The query will return a list of animals sorted by the age column.

 

UPDATE - is used to modify existing records in the table.

UPDATE animals
SET Name = 'Boring Owl', Age= '4'
WHERE animalID = 1;

The query modifies the record with id 1.

Our offer

Web development

Find out more

Mobile development

Find out more

E-commerce

Find out more

UX/UI Design

Find out more

Outsourcing

Find out more

Related articles

Show all articles