Wednesday 5 March 2014

Structured Query Language

Stuctured query language (SQL) is
  • The American National Standard Institute (ANSI) standard language for operating relational database
  • Efficient, easy to learn and use
  • Functionality complete (With SQL, you can define, retrieve, and manipulate data in tables

Sample of SQL syntax :
     select  employee_name, employee_number, salary
    from  employee_table
   where  salary > 1000000;

The SQL language is subdivided into several language elements, including:
  • Clauses, which are constituent components of statements and queries. (In some cases, these are optional.)
  • Expressions, which can produce either scalar values, or tables consisting of columns and rows of data.
  • Predicates, which specify conditions that can be evaluated to SQL three-valued logic (3VL)(true/false/unknown) or Boolean truth values and which are used to limit the effects of statements and queries, or to change program flow. 
          Image below show you about 3VL :
          

  • Statements, which may have a persistent effect on schemata and data, or which may control transactions, program flow, connections, sessions, or diagnostics.




SQL Statement consist of :
1. Data Manipulation Language, consist of several comment are :
  • Select 
  • Insert
  • Update
  • Delete
  • Merge 
2. Data Definition Language, consist of several comment are :
  • Create
  • Alter
  • Drop
  • Rename
  • Truncate
  • Comment
3. Data Control Language, consist of several comment are :
  • Grant
  • Revoke
4. Transaction Control, consist of several comment are :
  • Commit
  • Rollback
  • Savepoint

No comments:

Post a Comment