| |
|
SQL Syntax Question Posted on 23 Oct 2019 Home >> Tutorial >> SQL >> SQL Syntax |
SQL Syntax
There are some unique set of rules and guidelines which are called syntax in SQL. Below are the basic SQL syntax.
-SQL is not case sensitive and SQL keywords is generally written in uppercase.
-We can perform most of the action in database with the help of SQL statements.
-SQL statement are basically dependent on text lines and we can place a single SQL statement on one or multiple text lines.
-SQL basically depends on relational algebra and tuple relational calculus.
Now something about SQL statement
SQL statements are started with SQL commands or keywords like SELECT, INSERT, UPDATE, DELETE, ALTER, DROP etc. and all the SQL statement ends with semicolon.
SELECT "column_name" FROM "table_name";
Now question raise why we use semicolon after SQL statements:
We used semicolon to separate SQL statements. It is called standard way to separate SQL statements. And by adding semicolon we can add more then one query in sql statements.
Now come to SQL Commands
Below are the some important SQL command:
SELECT: it used to get data from a database.
UPDATE: it used to updates data in database.
DELETE: it used to deletes data from database.
CREATE TABLE: it is used creates a new table.
ALTER TABLE: it is basically used to modify the table.
DROP TABLE: it is used to delete a table.
CREATE DATABASE: it is used to creates a new database.
ALTER DATABASE: It is mainly used to modify a database.
INSERT INTO: It is used to insert new data into a database.
CREATE INDEX: It is mainly used to create an index (search key).
DROP INDEX: It is used to delete an index. | |
|
|
|
|