The standard SQL commands to interact with relational databases are CREATE, SELECT, INSERT,
UPDATE, DELETE and DROP.
DDL - Data Definition Language:
DML - Data Manipulation Language:
DCL - Data Control Language:
DQL - Data Query Language:
What is RDBMS?
A Relational database management system (RDBMS) is a database management system (DBMS) that is based
on the relational model as introduced by E. F. Codd.
What is NULL value?
A NULL value in a table is a value in a field that appears to be blank, which means a field with a NULL value is a
field with no value.
SQL Constraints: Constraints are the rules enforced on data columns on table. These are used to limit
the type of data that can go into a table. This ensures the accuracy and reliability of the data in the
database.
Following are commonly used constraints available in SQL:
NOT NULL Constraint: Ensures that a column cannot have NULL value.
DEFAULT Constraint: Provides a default value for a column when none is specified.
UNIQUE Constraint: Ensures that all values in a column are different.
PRIMARY Key: Uniquely identified each rows/records in a database table.
FOREIGN Key: Uniquely identified a rows/records in any another database table.
CHECK Constraint: The CHECK constraint ensures that all values in a column satisfy certain conditions.
INDEX: Use to create and retrieve data from the database very quickly.
NOT NULL Constraint:
By default, a column can hold NULL values. If you do not want a column to have a NULL value, then you
need to define such constraint on this column specifying that NULL is now not allowed for that column.
A NULL is not the same as no data, rather, it represents unknown data
UNIQUE Constraint:
The UNIQUE Constraint prevents two records from having identical values in a particular column.
PRIMARY Key:
A primary key is a field in a table which uniquely identifies each row/record in a database table. Primary
keys must contain unique values. A primary key column cannot have NULL values.
A table can have only one primary key, which may consist of single or multiple fields. When multiple
fields are used as a primary key, they are called a composite key.
FOREIGN Key:
A foreign key is a key used to link two tables together. This is sometimes called a referencing key
CREATE DATABASE statement is used to create new SQL database.
DROP or DELETE Database:
DROP DATABASE statement is used to drop an existing database in SQL schema.