SQL Constraints and Commands
Constraints List
Here are a few commonly used constraints:
Constraint Description NOT NULLvalues cannot be NULL UNIQUEvalues cannot match any older value PRIMARY KEYused to uniquely identify a row FOREIGN KEYreferences a row in another table SQL can perform many tasks such as
- retrieving data
- creating tables
- inserting and changing rows
- deleting tables
- and so on
Due to the wide range of tasks SQL can perform, it can be overwhelming to remember all the commands.
To make it easier to understand different SQL commands, we can categorize SQL commands into several sublanguages:
- Data Query Language (DQL) -
SELECT - Data Manipulation Language (DML) -
INSERT,UPDATE,DELETE - Data Definition Language (DDL) -
CREATE TABLE,CREATE DATABASE,ALTER TABLE,DROP TABLE - Data Control Language (DCL) -
GRANT,REVOKE - Transaction Control Language (TCL) -
SAVEPOINT,ROLLBACK,COMMIT
Comments
Post a Comment