Structured Query Language (SQL) is a standard data-oriented language which is primarily used to store, retrieve and manipulate data using simple code snippets, called queries, in an RDBMS (relational database management system).
The data is stored in the RDBMS in a structured way, where there exist relations between the different entities and variables in the data. These relations are defined by the database schema which does not only specify the relation between various entities but also the organization of data associated with those entities in the database.
Since SQL can be used to store, retrieve as well as manipulate the data in an RDBMS, it comes packed with many statements that are used to achieve those operations. Given is a list of some commonly used SQL statements:
Given below is an example. You first create a table, insert some data in it and then view all the data in that table.
-- Creating a table in database-- CREATE TABLE <Table name>CREATE TABLE Persons (-- <Variable name> <Variable type>FirstName varchar(255),LastName varchar(255),Country varchar(255));-- InsertingINSERT INTO-- <Table name>Persons-- <Variable names>(FirstName, LastName, Country)VALUES-- <Variable values>('Faysal', 'Herminio', 'Tanzania'),('Bertha', 'Cleisthenes', 'Spain'),('Jonatan', 'Netanel', 'United States');-- Selecting everything we stored in the table to viewSELECT *FROM Persons;