As we know, to store the data, which is the foundation of any company, we need a database. There are multiple platforms like SQL, Oracle, etc. So today, in this topic, we will talk about SQL. I will discuss What Is SQL And Free Syntax is Used in SQL.
The full name of SQL is Structured Query Language, and with its help, you can access your data, store it, and also manipulate it.
Table of Contents
What can SQL do?
In simple language, SQL is a platform where you can insert, delete, update, and access your data.
In SQL, multiple syntaxes are used, and these are easy to remember and use. For example, I will share one syntax with you.
If you want to save any data in your system, the syntax is as follows:
Insert into tablename values(11, ‘Deepak’, getdate())
With its help, data under the name Deepak will be stored in a particular table.
What is SQL And Free Syntax is Used in SQL
Execute Command: SQL can execute multiple queries against a database.
Retrieve Command: SQL can extract data from a database.
Insert Command: SQL can add records to a database.
Update Command: SQL can modify records in a database.
Delete Command: SQL can remove records from a database.
Create Command: SQL can create new databases.
Create Table: SQL can create new tables in a database.
Procedure: SQL can create stored procedures in a database.
View Database: SQL can create views in a database.
Grant Permission: SQL can set permissions on tables, procedures, and views.
With the help of the multiple commands given above, you can make changes to your database and store your data in the form of a record, and you can use it.
For Learning about the MS Powerpoint please visit Link
Multiple Syntax Used in SQL
In SQL, many syntaxes are used, and we will discuss one by one the most important ones, understanding how they can help us retrieve and access data.
The table format we are using for SQL syntax is given below.
CustomerNo | CustomerName | Name | Address | City | PostCode | Country |
---|---|---|---|---|---|---|
1 | Buzztechie.com | Deepak | Delhi | Delhi | 122001 | India |
2 | Geeks | Ana | Newyork | Newyork | 05021 | USA |
SQL Select:
The SELECT command is used to select data, and the syntax is "SELECT * FROM table name."
SQL Distinct:
The use of DISTINCT command is to choose different values, for example, if you have a column in your table called Country and countries are repeating and you need distinct country values, then we will use SELECT DISTINCT Country FROM Tablename;
SQL Where:
The WHERE clause is used to filter data, and the syntax used is SELECT * FROM Tablename.
WHERE Country='';
SQL Order By:
The use of the ORDER BY clause is for sorting data, such as when we need the data in ascending or descending order. SELECT * FROM Tablename ORDER BY Columnname;
SQL And :
Basically, the "AND" command is used to filter data based on the "where" condition, and you can use the "AND" command with one or more "where" conditions. Syntax : SELECT *
FROM Customers WHERE Country = 'Newyork' AND CustomerName LIKE 'Geek%';
SQL Or :
The where clause can contain one or more OR operators, so if at least one condition is true among two records, the record will become visible. Syntax : SELECT * FROM Customers WHERE Country = 'New York' OR Country = 'Japan';
SQL Insert :
The INSERT command is used to insert data, and the syntax is INSERT INTO table_name. (column1, column2...) VALUES (value1, value2 ...)
SQL Update :
The update command is used to update data.
UPDATE table_name SET column1 = value1, column2 = value2, ...
WHERE condition;
SQL Delete :
The DELETE command is used to delete data, and the syntax is DELETE FROM table_name WHERE condition;
SQL Count :
The count command tells you the number of data entries, and the syntax is
SELECT COUNT(*) FROM Products;
SQL Between :
The BETWEEN command is used for a range of data, and the syntax is SELECT * FROM Tablename WHERE columnname BETWEEN 10 AND 20;
SQL Group By :
The GROUP BY clause is used to organize data in a group format, and it allows the use of functions like COUNT(), SUM(), and AVG(). The syntax is as follows:
SELECT column_name
FROM table_name
WHERE condition
GROUP BY column_name
ORDER BY column_name
1 thought on “What is SQL And Free Syntax is Used in SQL”