MySQL SQL
What is SQL?
SQL is the standard language for dealing with Relational Databases.
SQL is used to insert, search, update, and delete database records.
How to Use SQL
The following SQL statement selects all the records in the "Customers" table:
Example
SELECT * FROM Customers;
Keep in Mind That...
- SQL keywords are NOT case sensitive:
select
is the same asSELECT
In this tutorial we will write all SQL keywords in upper-case.
Semicolon after SQL Statements?
Some database systems require a semicolon at the end of each SQL statement.
Semicolon is the standard way to separate each SQL statement in database systems that allow more than one SQL statement to be executed in the same call to the server.
In this tutorial, we will use semicolon at the end of each SQL statement.
Some of The Most Important SQL Commands
SELECT
- extracts data from a databaseUPDATE
- updates data in a databaseDELETE
- deletes data from a databaseINSERT INTO
- inserts new data into a databaseCREATE DATABASE
- creates a new databaseALTER DATABASE
- modifies a databaseCREATE TABLE
- creates a new tableALTER TABLE
- modifies a tableDROP TABLE
- deletes a tableCREATE INDEX
- creates an index (search key)DROP INDEX
- deletes an index