SQL for QA and Testing Engineer
What
is SQL ?
SQL stands for
Structured Query Language.It is a language that provides an interface to
relational database systems. The pronunciation of SQL is "ess cue
ell," and not "sequel" .SQL was developed by IBM in the 1970s
for use in System R, and is a de facto standard, as well as an ISO and ANSI
standard.
SQL also
encompasses DML (Data Manipulation Language), for INSERTs, UPDATEs, DELETEs and
DDL (Data Definition Language), used for creating and modifying tables and
other database structures.
The
development of SQL is governed by standards. A major revision to the SQL
standard was completed in 1992, called SQL2. SQL3 support object extensions and
are (partially?) implemented in Oracle8 and 9i.
What are the differences between DDL, DML and DCL commands?
DDL - Stands for Data Definition Language: statements used to define the structure of database or schema. examples
What are the differences between DDL, DML and DCL commands?
DDL - Stands for Data Definition Language: statements used to define the structure of database or schema. examples
§ CREATE - use to create Table in the database
§ ALTER - use to alters the Table structure of
the database
§ DROP - use to delete tables from the database.
§ TRUNCATE - use to remove all records from a
table, including all spaces allocated for the records
§ COMMENT - use to add comments to the data
dictionary
§ RENAME - use to rename an object
DML - Stands for Data Manipulation Language: statements used
for retrieving and updating data within schema objects.
examples:
§ SELECT - use to retrieve data from the a
database
§ INSERT - use to insert data into a table
§ UPDATE - use to updates existing data
within a table
§ DELETE - use to deletes all records from a
table, the space for the records remain
DCL - Stands for Data Control Language.
examples:
§ GRANT - it gives user's access privileges to
database
§ REVOKE - use to withdraw access privileges
given with the GRANT command
TCL - It stands for Transaction Control:
statements are used to manage the changes made by DML statements. It allows
statements to be grouped together into logical transactions.
examples
§ COMMIT - Use to save work done
§ SAVEPOINT - use to identify a point in a
transaction to which you can later roll back
§ ROLLBACK - use to restore database to original
since the last COMMIT
§ SET TRANSACTION - use to change transaction
options like isolation level and what rollback segment to use
Note:-DML are not
auto-commit. i.e. you can roll-back the operations, but DDL are auto-commit
Comments
Post a Comment