- execute queries against a database
- retrieve data from a database
- insert records in a database
- update records in a database
- delete records from a database
- create new databases
- create new tables in a database
- create stored procedures in a database
- create views in a database
- set permissions on tables, procedures, and view.
We can divide SQL in two parts:
1.DML:Data Manipulation Language
2.DDL:Data Definition Language
The query and update command forms the DML part of SQL.Few of the commands are as follows:
1.SELECT: This command is used to extract data from a database
2.UPDATE:We use this to update data in a database
3.DELETE:This is used to delete data from a database.
4.INSERT INTO:We use this to insert a new data into a database.
The DDL part of the SQL permits databases tables to be created or deleted.It also define indexes,specifies link between tables,and impose constraints between tables.The most important DDL statement in SQL are:
1.CREATE DATABASE: It creates a new database
2.ALTER DATABASE: It modifies a database
3.CREATE TABLE: It creates a new table
4.ALTER TABLE: It modifies a table .
5.DROP TABLE: It deletes a table
6.CREATE INDEX: It creates an index
7.DROP INDEX: It deletes an index
SQL is too simple to learn... It can be learnt too easily ... in much lesser time than any other language.I am giving here the syntax of few of the commands that i learnt today.
SELECT Statement:
It is used to select a data from the database.
Syntax:
SELECT column_name(s) FROM table_name
SELECT DISTINCT:
It is used to return only distinct values from a table.
Syntax:
SELECT DISTINCT column_name(s) FROM table_name
WHERE:
It is used to extract only those records that fulfill a specified criterion.
Syntax:
SELECT col_name(s) FROM table_name(s) WHERE col_name operator value
similarly there are many commands which is used to access data from a database.The complete reference can be taken from the website http://www.w3schools.com.
All the commands are very easy to learn.
To build a website that shows some data from a database,we need the following: - An RDBMS database program (i.e. MS Access, SQL Server, MySQL)
- A server-side scripting language, like PHP or ASP
- SQL
- HTML / CSS
So a good knowledge of SQL is must for all web application developers....
Few of the websites that i found too good to learn SQL online are:
http://www.sqlcourse.com
http://www.w3schools.com