An interactive SQL tutorial. Including online access to SQL engines running MySQL, SQL Server, Oracle and Access.

Tutorials

1) SELECT:
In which we query the CIA World Factbook.
2) SELECT in SELECT:
In which we form queries using other queries.
3) SUM & COUNT:
In which we summarise and aggregate and order.
4) JOINS:
In which we join actors to movies in the Movie Database.
5) OUTER JOINS:
In which we include the parties without people and the people outwith parties in the Scottish Parliament.
6) SELF JOINS:
In which we join Edinburgh bus routes to Edinburgh bus routes.

Quick reference: how to...

1) CREATE and DROP:
How to create tables, indexes, views and other things. How to get rid of them.
2) INSERT and DELETE
How to put records into a table, and how to take them out again.
3) GRANT and REVOKE
How to specify who can do what to your tables.
4) Functions
String functions, logical functions and mathematical functions that may be used. (see Tutorial 3 for aggregate functions).
5) How to use schema/databases.
Getting at other peoples tables.
6) How to monitor/limit resource usage

Assessments

Answers

Other information

Diversions

This material is brought to you by Andrew Cumming of the School of Computing of Napier University, Edinburgh, UK

Original copy of this material is at http://www.dcs.napier.ac.uk/~andrew/gisq/


Acknowledgements

Data has been taken from various sources which are freely available. The data donors offer no endorsement. No guarantee can be made for the accuracy of the data - or even that it matches the original source.

Thanks are due to the following excellent organisations:

About "A Gentle Introduction to SQL"