Skip to content

SQL

Basics

Create database

CREATE DATABASE dbName;

Delete database

DROP DATABASE dbname;

Create user

CREATE USER miriam WITH PASSWORD 'password' VALID UNTIL '2005-01-01';

Delete user

DROP USER username;

Delete table

DROP TABLE tablename;

Update field for table

UPDATE tablename SET COLUME WHERE CONDITION;

Update user's password

ALTER ROLE username WITH PASSWORD 'password';

Alter table column

ALTER TABLE Customers DROP COLUMN `ContactName`;

Show indexs

SHOW INDEXS FROM `TableName`

Cleanup the table

TRUNCATE TABLE `TableName`;
Back to top