Archive of SQL examples
Home SQL simple SQL advanced TSQL Spatial SQL MySQL/PHP Links

Welcome to my archive of SQL examples.

SQL (Structured Query Language) is a widely used language for quering relational databases. The code in this archive is addressing real life tasks like generating sales statistics, calculating next birthday of employee and so on, using Transact-SQL, MySQL and Jet-SQL syntax. Most of the scripts reference the "Colombo Ltd" database. This is a sample database with some business data in it. As for the standards, most of the features discussed are part of the SQL-89, SQL-92 specifications and few are from those introduced in SQL-99.

Latest Adds:

   Backup SQL server database using TSQL script
MS-SQL. Find invalid geometry in given Spatial table
Procedure that splits character string to words
UDF Min/Max value function in MS-Access SQL
MS-SQL. Procedure to find N nearest neighbors
Identify and Remove Duplicate records

This archive stores more than 160 sql examples (and solutions) usefull for learning sql programming technique, but is not a systematic SQL tutorial for beginners. If you need one, go to: Or:

Be aware of making proper checks when using the scripts and samples from this site, cause I do not warrant their correctness.

Have a (: time.

amper102 AT