SQL - Syntax - Tutorialspoint
SQL - Syntax - Tutorialspoint
SQL - Syntax
SQL is followed by a unique set of rules and guidelines called Syntax. This tutorial gives you a
quick start with SQL by listing all the basic SQL Syntax.
All the SQL statements start with any of the keywords like SELECT, INSERT, UPDATE,
DELETE, ALTER, DROP, CREATE, USE, SHOW and all the statements end with a semicolon
(;).
The most important point to be noted here is that SQL is case insensitive, which means
SELECT and select have same meaning in SQL statements. Whereas, MySQL makes
difference in table names. So, if you are working with MySQL, then you need to give table
names as they exist in the database.
All the examples given in this tutorial have been tested with a MySQL server.
FROM table_name;
FROM table_name;
FROM table_name
WHERE CONDITION;
FROM table_name
https://www.tutorialspoint.com/sql/sql-syntax.htm 1/4
8/8/2021 SQL - Syntax - Tutorialspoint
SQL IN Clause
FROM table_name
FROM table_name
FROM table_name
FROM table_name
WHERE CONDITION
SELECT SUM(column_name)
FROM table_name
WHERE CONDITION
GROUP BY column_name;
SELECT COUNT(column_name)
FROM table_name
WHERE CONDITION;
SELECT SUM(column_name)
FROM table_name
https://www.tutorialspoint.com/sql/sql-syntax.htm 2/4
8/8/2021 SQL - Syntax - Tutorialspoint
WHERE CONDITION
GROUP BY column_name
column1 datatype,
column2 datatype,
column3 datatype,
.....
columnN datatype,
);
DESC table_name;
https://www.tutorialspoint.com/sql/sql-syntax.htm 3/4
8/8/2021 SQL - Syntax - Tutorialspoint
UPDATE table_name
[ WHERE CONDITION ];
WHERE {CONDITION};
USE database_name;
COMMIT;
ROLLBACK;
https://www.tutorialspoint.com/sql/sql-syntax.htm 4/4