SQL Introduction





SQL is an acronym for Structured Query Language and is a standard relational query language (SQL has been standardized by both ANSI and ISO) used for interaction with databases.

SQL was developed by IBM in 1970s and has its roots in the relational algebra defined by Codd in 1972. SQL functionality goes beyond the relational algebra, allowing to retrieve data, insert data, modify existing data and delete data from/to a RDBMS. SQL features arithmetic operators like division, multiplication, subtraction and addition, and comparison operators (=, >=, <=). SQL also defines several aggregate functions like MAX, MIN, AVG, COUNT, and SUM.

SQL defines many keywords, which can be divided into several categories. The first SQL keyword category is for keywords used for data retrieval like the SELECT keyword. The second category is for the SQL keywords used for data manipulation like the INSERT, UPDATE, and DELETE SQL keywords. The third category is the transactional SQL keywords category, featuring keywords like COMMIT and ROLLBACK. Another SQL keyword category is the SQL Data Definition Language category featuring words like CREATE and DROP. Yet another category of SQL keywords controls the authorization and permission aspects of RDBMS (GRANT and REVOKE keywords).

SQL is pronounced as "S-Q-L" or "see-quill".

SQL uses -- character sequence as a single line comment identifier.

SQL commands are not case sensitive and the following SQL queries are equivalent:

SELECT * FROM Users


select * from Users

There are many SQL implementations also called SQL dialects and SQL extensions. For example MS SQL Server specific version of the SQL is called Transact-SQL, Oracle version of SQL is called PL/SQL, MS Access version of SQL is called JET SQL.

This SQL Tutorial will show you how to use SQL and its commands. You will be able to apply most of the knowledge gathered from this SQL tutorial to any Relational Database Management System.