Skip to main content

Posts

Showing posts from January, 2012

SQL - A QuickView for Testers

>> 4 Categories
## DDL - Data Definition Language - Used to define format and type i.e. structure of objects.
-- CREATE, ALTER, DROP, TRUNCATE, COMMENT, RENAME
## DML - Data Manipulation Language - Used to manipulate data stored in tables.
-- SELECT, INSERT, UPDATE, DELETE, MERGE, CALL, EXPLAIN PLAN, LOCK TABLE
## DCL - Data Control Language - Used to define roles, permissions, referential integrities and other security features.
-- GRANT, REVOKE
## TCL - Transactional Control Language - Used to manage transactions happening in database.
-- COMMIT, ROLLBACK, SAVEPOINT, SET TRANSACTION

>> Objects
>> General
>> Tables - Objects which will stay permanently in database. Contains columns and rows.
CREATETABLE Emp1(ID int Primary Key, FirstName VARCHAR(255), LastName VARCHAR(255), Salary int) CREATETABLE Emp2(ID int Primary Key, Area VARCHAR(255), Track VARCHAR(255)) >> Views - Same as tables, but resides dynamically not permanently. But database will have query to make the …