Monday, June 27, 2011

SQL (Structured Query language)

             SQL  is a specialized language for updating, deleting, and requesting information from databases. SQL is an ANSI and ISO standard, and is the standard database query language. Database products from Oracle and Microsoft SQL Server supports SQL.  Certified by ANSI and ISO, SQL has become a database query language standard.It serves both industry-level and academic needs and is used on both individual computers and corporate servers. The SQL queries are the most common and essential SQL operations. Via an SQL query, one can search the database for the information needed. SQL queries are executed with the “SELECT” statement.SELECT retrieves data from one or more tables, or expressions.

A query includes a list of columns to be included in the final result immediately following the SELECT keyword. An asterisk ("*") can also be used to specify that the query should return all columns of the queried tables. SELECT is the most complex statement in SQL, with optional keywords and clauses that include:
  • The FROM clause which indicates the table(s) from which data is to be retrieved. The FROMJOIN subclauses to specify the rules for joining tables. clause can include optional
  • The WHERE clause includes a comparison predicate, which restricts the rows returned by the query. The WHERE clause eliminates all rows from the result set for which the comparison predicate does not evaluate to True.
  • The GROUP BY clause is used to project rows having common values into a smaller set of rows. GROUP BY is often used in conjunction with SQL aggregation functions or to eliminate duplicate rows from a result set. The WHERE clause is applied before the GROUP BY clause.
  • The HAVING clause includes a predicate used to filter rows resulting from the GROUP BYGROUP BY clause, aggregation functions can be used in the HAVING clause predicate. clause. Because it acts on the results of the
  • The ORDER BY clause identifies which columns are used to sort the resulting data, and in which direction they should be sorted (options are ascending or descending). Without an ORDER BY clause, the order of rows returned by an SQL query is undefined.

What Can SQL do?

  • SQL can execute queries against a database
  • SQL can retrieve data from a database
  • SQL can insert records in a database
  • SQL can update records in a database
  • SQL can delete records from a database
  • SQL can create new databases
  • SQL can create new tables in a database
  • SQL can create stored procedures in a database
  • SQL can create views in a database
  • SQL can set permissions on tables, procedures, and views

No comments:

Post a Comment