1/13
SQL
Stands for Structured Query Language and consists of commands to create database structures, perform data manipulation, and query the database.
Query
A specific request for data manipulation issued by the end-user or the application to the DBMS.
CREATE DATABASE
SQL command used to create a new database. Syntax: CREATE DATABASE database_name;
DROP DATABASE
SQL command used to delete an existing database. Syntax: DROP DATABASE database_name;
CREATE TABLE
SQL command used to create a new table in a database. Syntax: CREATE TABLE table_name (column1 datatype, …);
DROP TABLE
SQL command used to delete an existing table in a database. Syntax: DROP TABLE table_name;
TRUNCATE TABLE
SQL command used to delete only the data within a table. Syntax: TRUNCATE TABLE table_name;
ALTER TABLE
SQL command used to add, delete, or modify columns in an existing table.
NOT NULL Constraint
Ensures that a column cannot have a NULL value.
UNIQUE Constraint
Ensures that all values in a column are different.
PRIMARY KEY Constraint
Uniquely identifies each row in a table.
FOREIGN KEY Constraint
Uniquely identifies a row in another table; establishes a link between tables.
CHECK Constraint
Ensures that all values in a column satisfy a specific condition.
DEFAULT Constraint
Sets a default value for a column when no value is specified.