sajad torkamani

In a nutshell

SQL (Structured Query Language) is a programming language used to work with relational databases. You can use SQL to create, read, update, and delete data from a relational database.

Here are some examples of using SQL:

Create a table to store data about users

CREATE TABLE users
(
    id       INT          NOT NULL AUTO_INCREMENT,
    email    VARCHAR(255) NOT NULL UNIQUE,
    password VARCHAR(255) NOT NULL,
    PRIMARY KEY (id)
);

Read data from users table

CREATE TABLE users
(
    id       INT          NOT NULL AUTO_INCREMENT,
    email    VARCHAR(255) NOT NULL UNIQUE,
    password VARCHAR(255) NOT NULL,
    PRIMARY KEY (id)
);

Update record from users table

UPDATE users
SET password = 'new_password'
WHERE id = 1;

Delete record from users table

DELETE FROM users
WHERE id = 1;
Tagged: MySQL