SQL Tutorial – Learn SQL Programming

This SQL tutorial contains explanations of the most used SQL commands:
lessons are supported by examples, schemas and quizzes.
you can use the practice center to execute queries against a real database.
at the end of each lesson and quiz, you can ask questions if something is not clear.

SQL lessons with pictures and quizzes:

Learn basic concepts
This section defines in a simple way basic terms like tables, columns, rows, DBMS. Get Started
Learn how to retrieve information with SQL
This section explains how to retrieve information in a database using SQL. It explains commands like SELECT, GROUP, JOIN. Get Started
Learn how to modify information with SQL
This section explains how to insert and update information in a database using SQL. Get Started
Learn how to administer a database with SQL
This section explains how to create and modify database elements using SQL. Get Started

SQL practice and rehearsal tools:

Practice SQL
Test your SQL skills by writing SQL queries against a real database. Get Started
Rehearse SQL
This tool can help you rehearse SQL before an exam or a job interview. Get Started

What is SQL?

SQL is a programming language. SQL stands for Structured Query Language.
Its purpose is to send orders to a database, which is a source of information, to:

  • retrieve information stored in this database.
  • insert, update or delete information.
  • modify the way this information is organised in this database.
  • manage access rights to the database (who can access which information).

Example: your database contains information about a company’s customers, payments, employees… In order to retrieve the customer’s name and phone numbers in California, you would use a query written in SQL:

select first_name, last_name, phone_number from clients where state = “California”

This query is sent to the database to retrieve this information and display it to you.

This is the type of information that the database would return:

first_namelast_namephone_number
barunrao832-799-2933
xavierwilson832-799-2978
zhangwei832-799-2955
johnsmith799-757-2988
jennysmith732-799-2923
carolwilson732-899-8877

History of SQL

In 1970, Edgar Codd, an IBM engineer, imagined a new type of database called “relational databases”. Relational databases offered a more flexible way of organizing data in databases. This work was an inspiration for the creators of the SQL language and of the first databases using SQL.

Engineers from IBM started to work on a project called System/R in 1974. Among them were Donald D. Chamberlin and Raymond F. Boyce based in sunny San Jose, California.

During this System/R project, they defined the SEQUEL language, which they renamed as SQL, because the name SEQUEL was already used by another company.

Although SQL was invented by IBM engineers, the first commercial database using SQL was sold by Oracle in 1979. IBM followed in 1981 with a product called SQL/DS, and in 1983 with a database called DB2. In 1989, Microsoft released commercially SQL Server. In 1994, Michael Widenius and David Axmark started working on the development of mySQL databases.

Go to the next lesson

Latest Tricks (blog):


February 11, 2016 : 27 SQL Performance Tuning Techniques

May 10, 2015 : SQL Server: send mails based on a table.

April 19, 2015 : SQL server script to insert test data massively

March 24, 2015 : Create Random Data with SQL Server

February 24, 2015 : Triggers in SQL server

February 15, 2015 : Use stored procedures with SQL server

Full list of SQL tricks

 
Please help this site survive, share on: