SQL (Structured Query Language)


What Is SQL? SQL Is a Standard—BUT....
Although SQL is an ANSI standard, there are many different versions of the SQL language. To be compliant with the ANSI standard, they all support at least the major commands in a similar manner, but most of the SQL databases also have their own proprietary extensions.

Database Tables
A database most often contains one or more tables. Each table is identified by a name (e.g. customer or order). Tables contain records (rows) with data. Below is an example of a table called person:

person_id last_name first_name address city
1 Hansen Ola Timoteivn 10 Sandnes
2 Svendson Tove Borgvn 23 Sandnes
3 Pettersen Kari Storgt 20 Stavanger

The table above contains three records (one for each person) and five columns (person_id, last_name, first_name, address, and city).

SQL Statements
Most of the actions you need to perform on a database are done with SQL statements. The following SQL statement will select all the records in the person table:
 SELECT  last_name  FROM  person;
last_name
Hansen
Svendson
Pettersen



Demonstration
Below is an SQL test area from W3Schools, which uses the well-known Northwind sample database. The tables here are for read only because of the problem of embedding the scripts. For a fully working example, check this by using Chrome.

SQL Statement:

Edit the SQL statement and click     to see the result, or  

Result:
The Database includes:
The Database includes:

TablenameRecord
Customers91
Categories8
Employees10
OrderDetails518
Orders196
Products77
Shippers3
Suppliers29


Review: SQL (Structured Query Language)
Which is NOT true about SQL (Structured Query Language)?
      A relational database most often contains one or more tables.
      Most of the SQL databases do NOT have their own proprietary extensions.
      SQL is a standard language for accessing and manipulating databases.
      SQL is an ANSI (American National Standards Institute) standard.
Result: