Basic SQL Syntax
SELECT
This command is used to obtain zero or more rows from one or more tables in the database. Generally keywords that accompanies the SELECT command is:
- FROM
Keyword to tell the origin table for which data is accessible also means table in combination. - WHERE
This keyword is used to determine which rows will be displayed based on the criteria listed in this clause. In the WHERE clause can use logical operators. - GROUP BY
This keyword is used to combine rows with related value. - HAVING
This keyword is used to find part of a combination of lines (line combinations generated when the query using the keywords GROUP BY or when the SELECT command contains aggregation) are produced. - ORDER BY
This keyword is used to determine the column used to sort the resulting data.
INSERT
This command is used to insert zero or more rows to the table.
UPDATE
This command is used to change the value of a set of rows in the table are available
DELETE
This command is used to remove zero or more existing rows from the table.
Example:
1 2 3 4 | SELECT * FROM myTable WHERE columnA = 'valueA' INSERT INTO myTable (columnA, columnB, columnC) VALUES (‘valueA’, ‘valueB’, ‘valueC’) UPDATE myTable SET columnA = ‘updateA’, columnB = ‘updateB’ WHERE columnC = ‘valueC’ DELETE FROM myTable WHERE columnA = ‘valueA’ |