SQL is almost like simple English. It’s made up largely of English words, put together into strings of words that sound similar to English sentences.
The first word of each statement is its name, which is an action word (verb) that tells MySQL what you want to do. For example, CREATE, DROP, ALTER, SHOW, INSERT, LOAD, SELECT, UPDATE, and DELETE.
The statement name is followed by words and phrases that tell MySQL how to perform the action. For example,
SELECT lastName FROM Member
When a statement uses SELECT, it’s known as a query, because you are querying the database for information. This query retrieves all the last names stored in the table named Member.
Most Important SQL Statements
- SELECT - extracts data from a database
- UPDATE - updates data in a database
- DELETE - deletes data from a database
- INSERT INTO - inserts new data into a database
- CREATE DATABASE - creates a new database
- ALTER DATABASE - modifies a database
- CREATE TABLE - creates a new table
- ALTER TABLE - modifies a table
- DROP TABLE - deletes a table
- CREATE INDEX - creates an index (search key)
- DROP INDEX - deletes an index