Introduction to SQL
School:Computer Science -> Topic:Databases -> Topic:SQL
![]() |
Wikibooks has a book on the topic of Structured Query Language. |
What is SQL? [edit]
SQL is an acronym for Structured Query Language used for managing databases. This unit introduces SQL concepts in terms of structure, client/server relationships, access control, language elements (syntax and semantics) and other common aspects.
There are mainly 3 kinds of statements in SQL:
- DDL (Data Definition Language)
- DML (Data Manipulation Language)
- DCL (Data Control Language)
SQL commands such as CREATE, ALTER & DROP are DDL statements. SQL commands such as INSERT, DELETE & UPDATE are DML statements. GRANT & REVOKE are DCL.
Note: All DDL statements are autocommitted, i.e. user need not perform any commit after executing DDL statements. DML statements do not commit automatically.
ex: Truncate is a DDL statement whereas delete is a DML statement.
- Truncate tablename commits automatically
- delete from tablename does not commit automatically.
courtesy RaviChandra tarun & Santosh Reddy DBA (TATA CONSULTANCY SERVICES)
SQL was adopted as a standard by ANSI (American National Standards Institute) in 1986 and ISO (International Organization for Standardization) in 1987. This lesson is designed as a prerequisite for product-specific courses that cover the three principal client/server products:
Learners interested in SQL should participate at Topic:Databases and might also consider Topic:Object-relational databases.
Language basics [edit]
under construction - instructors needed
Resources [edit]
- A Gentle Introduction to SQL By Andrew Cumming - School of Computing, Napier University, Edinburgh, UK. 1999-2005 (Available in Albanian, German, Spanish, Chinese, French, Italian and Portuguese)
- SQL Tutorial at 1Keydata.com
- SQL Quick Reference SQL for common statements across SQL-92, Postgres, Sybase, SQL Server, Oracle and MySQL