Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

SQL Guide

SQL Guide


SQL - Structured Query Language

SQL is the standard computer language for accessing and processing databases.

Common database management systems: MySQL, SQL Server, Access, Oracle, Sybase, and DB2

For those who wish to store and retrieve data in databases, knowledge of SQL is invaluable.


What is SQL?


SQL database tables

A database usually contains one or more tables. Each table is identified by a name (e.g., "Customers" or "Orders"). A table contains records (rows) with data.

The following example is a table named "Persons":

LastName FirstName Address City
Hansen Ola Timoteivn 10 Sandnes
Svendson Tove Borgvn 23 Sandnes
Pettersen Kari Storgt 20 Stavanger

The table above contains three records (each for one person) and four columns (last name, first name, address, and city).


SQL query program

With SQL, we can query a database and get a returned result set.

The query program looks like this:

SELECT LastName FROM Persons

The result set looks like this:

LastName
Hansen
Svendson
Pettersen

How to learn SQL?

Visit our complete SQL tutorial