SQL stands for Structured Query Langauge. It is the standardized programming language for relational databases.

In order to learn relational databases, you need to learn SQL first. The most basic SQL commands are CRUD which stands for Create, Read, Update and Delete.

  • :bell: The typical CREATE commands examples:
CREATE DATABASE test

:notes: create a database named test

CREATE TABLE one (id INT, name VARCHAR(20), age INT, gender CHAR(1))

:notes: create a table

CREATE USER 'xiaoming'@'localhost' identified by '123' 

:notes: create a new user and password

  • :bell: The typical READ commands examples:
SELECT * FROM one

:notes: select everything from table one

SELECT * FROM one ORDER BY id DESC

:notes: select everything from table one by descending order

SELECT * FROM one WHERE id = 1

:notes: select the record whose id is 1 from table one

SELECT * FROM one WHERE name LIKE 'xi%'

:notes: select the records whose name begins with xi from table one

  • :bell: The typical UPDATE command example:
UPDATE one SET name = 'xiaohong' WHERE id = 1

:notes: change the name of the record with id 1 to xiaohong

  • :bell: The typical DELETE commands examples:
DELETE * FROM one

:notes: delete everything from table one

DELETE * FROM one WHERE id =2 

:notes: delete the record with id = 2 from table one

The above :point_up: basic SQL commands are fundamental commands and are the basics for programming database web pages and applications.

There are plenty of SQL books :books: out there. You can just grab one and it should serve your needs.