SQL Statements

ALTER TABLE

ALTER TABLE TABLE_NAME 
[MODIFY | ADD | DROP] 
  [COLUMN COLUMN_NAME][DATATYPE|NULL NOT NULL] [RESTRICT|CASCADE]
[ADD | DROP]  CONSTRAINT CONSTRAINT_NAME]

Description: Alters a table's columns.

COMMIT

COMMIT [ TRANSACTION ]

Description: Saves a transaction to the database.

CREATE DOMAIN

CREATE DOMAIN DOMAIN_NAME AS DATA_TYPE [ NULL | NOT NULL]

Description: Creates a domain—an object that is associated with a data type and constraints.

CREATE INDEX

CREATE INDEX INDEX_NAME
ON TABLE_NAME (COLUMN_NAME)

Description: Creates an index on a table.

CREATE ROLE

CREATE ROLE ROLE NAME 
[ WITH ADMIN [CURRENT_USER | CURRENT_ROLE]]

Description: Creates a database role to which system and object privileges can be granted ...

Get Sams Teach Yourself SQL in 24 Hours, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.