Tutorial SQL: Select, Insert, Update, Delete

The following tutorial can be used as dictionary for beginner on SQL syntax. SQL syntaxes are used to manipulate data which are select, insert, update, and delete on database.

1. Select

Select command is used to get rows of data from table.


SELECT [column] FROM [table] WHERE [condition] ORDER BY [column]


SELECT * FROM country_data WHERE city = 'New York' ORDER BY postal_code
SELECT name, age FROM country_data ORDER BY name

2. Insert

Insert command is used to insert row to table.


INSERT INTO [table] (column1, column2, ...) VALUES (data1, data2, ...)


INSERT INTO country_data (name, age) VALUES ('john','25')

3. Update

Update command is used to modify row on table.


UPDATE [table] SET column1 = data1, column2 = data2, ... WHERE [condition]


UPDATE country_data SET name = 'john doe', age='30' WHERE id = 1

4. Delete

Delete command is used to remove data from table.


DELETE FROM [table] WHERE [condition]


DELETE FROM country_data WHERE name = 'john'

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.