SQL Full Form

SQL is a declarative language laying its basics on relation algebra. It is a standardized language supported by all major commercial databases. The query optimizer is an important component of SQL which takes an input the SQL query and executes, it in the fastest way possible.

These are main classification of SQL queries:

  1. Data Manipulation Language (DML) –
    It deals with the queries related to insertion, deletion and modification of rows.

  2. Data Definition Language (DDL) –
    It deals with the creation, deletion and modification of definitions for tables and views.

A basic SQL query has the following syntax:

SELECT (attribute list)
FROM   (table list)
[WHERE (condition)]
[GROUP BY (grouping attributes)]
[HAVING (group condition)]
[ORDER BY (attribute list)] 

where the SELECT and FROM clauses are mandatory.

  1. The SELECT clause lists the attributes to be retrieved.
  2. The FROM Clause specifies all tables
  3. The WHERE clause specifies the conditions for selection of records from these tables, including join conditions.
  4. GROUP BY specifies grouping attributes
  5. HAVING specifies a condition for retrieval of groups.

Various aggregator functions COUNT, SUM, MIN, MAX, and AVG can be in conjunction with grouping. ORDER BY specifies an order for displaying the result of a query.

Characteristics :

  • Tables, also called as relations are represented by a name, not exceeding 20 characters in length.
  • The table names as well as the column fields should have unique names.
  • While table definition, the field list is separated using commas, and each field name consists of a data type followed by length attribute enclosed in brackets.
  • SQL statements must end with a semicolon.

Advantages :

  • High performance.
  • Easily compatible with most of the databases like MS Access, MS SQL server.
  • Good flexibility in terms of creation of new Data Base tables and deletion of redundant tables.
  • Can handle large records and multiple transactions.
  • Easily accessible in the form of an open-source programming language.
  • High Security: Tables, procedures and views can easily be protected using permissions
  • Easy to learn and understand data

Disadvantages :

  • Complex interface to understand and deal with it.
  • Higher cost required to set up.
  • It is a platform dependent and compound based language.
  • Extra space is required for each record storage.
  • Partial control given to databases, due to hidden permissions.

Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

Article Tags :
Practice Tags :

Be the First to upvote.

Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.