Beginner's SQL Tutorial: Getting Started
DiggBlinkRedditDeliciousTechnorati
article by Bejaan
Structured Query Language (SQL) is something everyone in this industry should be familiar with, if not master, at a very early stage in his or her career. You'll be using it for the next 3 decades in a majority of IT specializations.
This is a basic tutorial aimed at beginner's to get them started.
What is this SQL thingy?
Consider SQL as a set of commands you can use to store, modify or fetch content from a database management system.
Is it very complicated?
Hardly! It is just like constructing an english statement, but you are allowed to use only a finite set of words.
SQL Data Manipulation Language (DML)
* SELECT - extracts data from a database table
* UPDATE - updates data in a database table
* DELETE - deletes data from a database table
* INSERT INTO - inserts new data into a database table
SELECT Statement Examples
SELECT LastName,FirstName FROM Persons
SELECT * FROM Persons
SELECT DISTINCT Company FROM Orders
SELECT * FROM Persons WHERE City='Sandnes'
INSERT Statement Examples
INSERT INTO table_name (column1, column2,...) VALUES (value1, value2,....)
UPDATE Statement Example
UPDATE table_name
SET column_name = new_value
WHERE column_name = some_value
DELETE Statement Example
DELETE FROM table_name
WHERE column_name = some_value