Introduction to Oracle SQL / PL-SQL
The American National Standards Institute (ANSI) published its first SQL standard in 1986 and a second widely adopted standard in 1989. ANSI released updates in 1992, known as SQL92 and SQL2, and again in 1999, termed both SQL99 and SQL3. Each time, ANSI added new features and incorporated new commands and capabilities into the language.
SQL is a simple, yet powerful, language used to create, access, and manipulate data and structure in the database.
DDL is used to define. alter, or drop database objects and their privileges DDL statements will implicitly perform a commit.
DDL Statements:
Create : It is used to create objects(tables, views) in the database. Alter It is used to alter the structure of the database objects.
Drop : delete database objects (It will invalidate the dependent objects ,it also drops indexes. triggers and referential integrity constraints ).
Truncate : remove all records from a table, including all spaces allocated for the records are removed (It is fast as compared to Delete and does not generate undo information as Delete does. It performs an implicit commit as it is a DDL. It resets the high water mark.)
Grant : assigning privileges
DML - Data Manipulation Language.
DML is used to access, create, modify or delete data in the structures of the database.
DML Statements:
Select : Select data from the database
Insert : It is used to insert data into a table
Update : It is used to update existing data within a table
Delete : It removes rows from the table.
DCL - Data Control Language
Following are the examples of Data control Statements.
DCL Statements:
Commit : It will end the current transaction making the changes permanent and visible to all users.
Set- Transaction : It is used to define the properties of a transaction