Structured Query Language (SQL)

1 - About

SQL is the standard language used to operate on table and its auxiliary data Structure (such as view, aggregate,...).

SQL permits application designers to manipulate sets of rows with a non-procedural (or :"declarative") language, rather than writing iterative loops in conventional languages that process records one at a time.

You specify the result you want, not how to derive it with set processing operations like joins and subqueries to achieve the result you want.

In 1981, The SQL database language was first introduced commercially by Oracle.

The scope of SQL is the definition of data structure and the operations on data stored in that structure.

In 1989, the American National Standards Institute (http://www.ansi.org) published a SQL specification.

SQL is a widely used language for data retrieval and manipulation in databases.

SQL statement can be used:

  • to create, alter and drop database objects
  • to add, change or remove data

Over the years, the SQL language has been standardized by ANSI and adopted by a large number of database manufacturers.

SQL original intent was to provide ad-hoc access to data derived from the definition of the relational data model — but not as a development language or as a database interface tool. With the advent of ODBC, Jdbc and other generic interfaces, SQL became the de-facto standard used to manipulate databases.

Because the SQL language is English-like in its structure, it is easy to learn and understand. The basic SQL directives are:

  • SELECT to read and return data
  • UPDATE to alter existing data records
  • INSERT to add records
  • DELETE to remove data records

SQL is inherently transactional.

The first steps to do when reading a sql statement is to read:

  1. the from clause
  2. the type of join(s)
  3. and the predicates(s)

2 - Example

SELECT *
FROM ORDER o, item i
WHERE
o.order = i.order

For every order, find the item that match o.order = i.order.

3 - Other implementation

3.1 - Quick SQL

https://apex.oracle.com/en/quicksql/ - Quick SQL enables you to rapidly design and prototype data models using a markdown-like shorthand syntax that expands to standards-based Oracle SQL. You can easily create master detail relationships, check constraints, and even generate sample data.

In the browser thanks to Kris: http://jsfiddle.net/krisrice/bkf145mL/1/

4 - Documentation / Reference

data/type/relation/sql/start.txt · Last modified: 2018/10/18 11:23 by 141.101.69.235