- SQL keywords are not case-sensitive which means SELECT is the same as select.
- Database and Table names may be case-sensitive, that depends on the operating system. This means database and table names are case-sensitive on Linux/Unix operating systems and case-insensitive on Windows operating systems.
Comments in SQL
Comments are ingored by database engine. We write comments to provide information and better understanding of the SQL statement.
There are two ways to write comments in SQL statements
- Begin the comment with — (two hyphens): It is best for single line comment
- Begin the comment with a slash and an asterisk (/*) and end the comment with an asterisk and a slash (*/): It is Best for multi-line comment.
For single-line comment
-- This is for single line comment SELECT column_name FROM tble_name WHERE condition;
For multi-line comment
/* This is for multi-line comments*/ SELECT column_name FROM tble_name WHERE condition;
SQL Syntax
Syntax for SQL SELECT Statement
Syntax for SQL UPDATE
Syntax for SQL DELETE
Syntax for SQL CREATE DATABASE
Syntax for SQL ALTER DATABASE
Syntax for SQL CREATE TABLE
Syntax for SQL ALTER TABLE
Syntax for SQL DROP TABLE
Syntax for SQL CREATE INDEX
Syntax for SQL DROP INDEX
Syntax for SQL INSERT INTO