Sublanguages Flashcards
DCL
Data Control Language, setting user permissions (GRANT, REVOKE)
DDL
Data Definition Language, working with database structure (CREATE, ALTER, TRUNCATE, DROP) EX: CREATE TABLE (Schema)[TableName] (Column definitions (Constraints))
ALTER TABLE [TableName] ADD (Column) [Column definition] ADD (Constraint clause) DROP [column] [cascade] DROP Constraint ALTER COLUMN [definition]
DML
Data Manipulation Language, working with the rows of data itself (INSERT, UPDATE, DELETE) EX: INSERT INTO [TableName] [columns] VALUES (data input) SELECT (drop entire result set into table)
DQL
Data Query Language, retrieving rows of data (SELECT). EX: SELECT [columnList] FROM [tableList] WHERE [conditionList] GROUP BY [columnList] //For aggregate functions HAVING [condition] ORDER BY [columnList]
TCL
Transaction Control Language, managing transactions (COMMIT, ROLLBACK, SAVEPOINT)
Sequences
Generate numeric sequence, mostl for creating/managing primary keys, EX: CREATE OR REPLACE SEQUENCE [Name] MINVALUE value, MAXVALUE value, START WITH value, INCREMENT BY value, CACHE value
Triggers
Series of PL/SQL commands which execute in response to some DML action, either before or after.
Views
Virtual table that displays the results of a SELECT statement, lets you reuse and store complex queries
Indexes
Physical ordering of a column or group of columns, having unique indexes
Alias
The AS or IS keyword allows you to set a Table name or column name as a short variable.
Aggregate
Functions (AVG, MIN, MAX, SUM, COUNT) perform an action on an entire column
Scalar functions
(LOWER, UPPER, NVL) operate on individual entries