You are on page 1of 1

SQL Syntax

SQL syntax are statements which perform actions in databases. For example,

SELECT * FROM Customers;


The above mentioned line is a statement that selects all records from a table named “Customers”. The
most interesting feature of SQL is its keywords are not case sensitive. Here the SELECT performs same
action as select. Using semicolon helps to separate more than one statement. It also standardize the code
and fill up requirements of several database systems .
A list of SQL commands are written below:

 SELECT: Select command extracts data from a database.


 UPDATE: This command updates data in a database.
 DELETE: This command is used for deleting data from a database.
 INSERT INTO: This command is used for inserting a new data in a database.
 CREATE DATABASE: It is a very essential command for creating a database.
 ALTER DATABASE: Sometimes modification of an existing database is necessary. This alter
database command can modify an existing data base.
 CREATE TABLE: It is a basic command for creating a new table.
 ALTER TABLE: In order to modify an existing table, this command is used frequently.
 DROP TABLE: In order to delete a table DROP TABLE command is executed.
 CREATE INDEX: A very useful command for creating an index.
 DROP INDEX: This command deletes an index.

The SQL SELECT Statement


This statement is used to select data from a database. The data returned is a stored result table that is
labeled as result-set. The syntax is given below.
SELECT Syntax:

SELECT column1,  column2,...
FROM table_name;
In this syntax, column1, column2, ... are the field names of the table from which data are going to be
selected from.
The following syntax is useful for selecting all the fields in a table:

SELECT * FROM table_name;

You might also like