SQL stands for structured query language. It is used to manage and access data from database.
A database may contain more than one table having unique name for each table.
SQL language have many different versions but it supports most of the commands in similar manner :-
- SELECT:- SELECT command is used to select the data from database.Syntax of SELECT command is
SELECT * FROM table_name
To select particular column from table:
SELECT column_name FROM table_name
INSERT:- INSERT command is used to insert elements in the column of a table.
Syntax of INSERT command is:
INSERT INTO table_name(attributes) VALUES (values)
UPDATE:- UPDATE command is used to make changes in the table.
Syntax of UPDATE command is :
UPDATE table_name SET column1=value1 WHERE column1=value2
DELETE:- DELETE command is used to delete some content from the table.
Syntax of DELETE command:
To delete whole content
DELETE * FROM table_name
To delete particular column from the table
DELETE FROM table_name WHERE name(attributes)= xyz(values)
ORDER BY:- ORDER BY command is used to arrange record in ascending order automatically.
Syntax of ORDER BY command is:
To arrange in ascending order:
SELECT column_name FROM table_name ORDER BY column_name
To arrange record in descending order:
SELECT column_name FROM table_name ORDER BY column_name DESC