You are invited to Log in or Register a free Frihost Account!

SQL Tutorial


Check the above site. it has a good set of lessions on SQL. to be more specific, TSQL.

THis is just not tutorilal, it also has feature "practice what you learn using the on-line SQL interpreter". You will receive immediate results after submitting your SQL commands. Starting from Basics it shows you to write complex queries.

Try it.

All the Best

hey thanks for the post im looking for a sql tutorial and finally i spotted this section...hehehehe i will surf that Very Happy
hey thankz for the post buddy.nice one
Its always a pleasure sharing knowledge. If you want more tutorials on SQL just PM me I will send you more.
thanks for the post
very nice. Thanks for sharing i've been looking for a tutorial like this for a long time Smile
i think my sql is quite difficult to learn
thx for sharing
thank you

it is quite useful and i will bookmark it
Thanks guys !

Your support keeps me posting good tutorials !

Very Happy
good site, is it urs?
This is a really nice tutorial, I´ll be looking further into that later. Cool
really good tutorial,thx
I don't understand a thing. Could someone tell me exactly what SQL is? in english--english.....not english -- codes
engeland wrote:
I don't understand a thing. Could someone tell me exactly what SQL is? in english--english.....not english -- codes

SQL keywords

SQL keywords fall into several groups.

Data retrieval

The most frequently used operation in transactional databases is the data retrieval operation.

* SELECT is used to retrieve zero or more rows from one or more tables in a database. In most applications, SELECT is the most commonly used DML command. In specifying a SELECT query, the user specifies a description of the desired result set, but they do not specify what physical operations must be executed to produce that result set. Translating the query into an optimal query plan is left to the database system, more specifically to the query optimizer.
o Commonly available keywords related to SELECT include:
+ FROM is used to indicate which tables the data is to be taken from, as well as how the tables join to each other.
+ WHERE is used to identify which rows to be retrieved, or applied to GROUP BY.
+ GROUP BY is used to combine rows with related values into elements of a smaller set of rows.
+ HAVING is used to identify which rows, following a GROUP BY, are to be retrieved.
+ ORDER BY is used to identify which columns are used to sort the resulting data.


Data manipulation

First there are the standard Data Manipulation Language (DML) elements. DML is the subset of the language used to add, update and delete data.

* INSERT is used to add zero or more rows (formally tuples) to an existing table.
* UPDATE is used to modify the values of a set of existing table rows.
* MERGE is used to combine the data of multiple tables. It is something of a combination of the INSERT and UPDATE elements.
* DELETE removes zero or more existing rows from a table.
* TRUNCATE deletes all data from a table (non-standard, but common SQL command).


Data transaction

Transaction, if available, can be used to wrap around the DML operations.

* BEGIN WORK (or START TRANSACTION, depending on SQL dialect) can be used to mark the start of a database transaction, which either completes completely or not at all.
* COMMIT causes all data changes in a transaction to be made permanent.
* ROLLBACK causes all data changes since the last COMMIT or ROLLBACK to be discarded, so that the state of the data is "rolled back" to the way it was prior to those changes being requested.

COMMIT and ROLLBACK interact with areas such as transaction control and locking. Strictly, both terminate any open transaction and release any locks held on data. In the absence of a BEGIN WORK or similar statement, the semantics of SQL are implementation-dependent.

Data definition

The second group of keywords is the Data Definition Language (DDL). DDL allows the user to define new tables and associated elements. Most commercial SQL databases have proprietary extensions in their DDL, which allow control over nonstandard features of the database system.

The most basic items of DDL are the CREATE and DROP commands.

* CREATE causes an object (a table, for example) to be created within the database.
* DROP causes an existing object within the database to be deleted, usually irretrievably.

Some database systems also have an ALTER command, which permits the user to modify an existing object in various ways -- for example, adding a column to an existing table.

Data control

The third group of SQL keywords is the Data Control Language (DCL). DCL handles the authorisation aspects of data and permits the user to control who has access to see or manipulate data within the database.

Its two main keywords are:

* GRANT - authorises a user to perform an operation or a set of operations e.g. grant all privileges to user identified by passwd?
* REVOKE - removes or restricts the capability of a user to perform an operation or a set of operations.


Database systems using SQL

* List of SQL database management systems
* List of object-relational database management systems


Criticisms of SQL

Technically, SQL is a declarative computer language for use with "relational databases". Theorists note that many of the original SQL features were inspired by, but in violation of, tuple calculus. Recent extensions to SQL achieved relational completeness, but have worsened the violations, as documented in The Third Manifesto.

In addition, there are also some criticisms about the practical use of SQL:

* The language syntax is rather complex (sometimes called "COBOL-like").
* It does not provide a standard way to split large commands into multiple smaller ones that reference each other by name (however some implementations allow for set-based functions to grant this functionality). This tends to result in "run-on SQL sentences".
* Implementations are inconsistent and, at times, incompatible between vendors.
* It is at times too difficult a syntax for DBAs (database administrators) to extend.
* Over-reliance on "NULLs", which some consider a flawed or over-used concept.
* For larger statements, it is often difficult to factor repeated patterns and expressions into one or fewer places to avoid repetition and avoid having to make the same change to different places in a given statement.
* Unexplained difference between value-to-column assignments in UPDATE and INSERT syntax.


Alternatives to SQL

A distinction should be made between alternatives to relational and alternatives to SQL. The list below are proposed alternatives to SQL, but are still (allegedly) relational. See navigational database for alternatives to relational.

* IBM BS12
* TQL Proposal (Not to be confused with Luca Cardelli's TQL)
* Hibernate Query Language (HQL) - A Java-based tool that uses modified SQL
* Quel introduced in 1974 by the U.C. Berkeley Ingres project.


External links

* The 1995 SQL Reunion: People, Projects, and Politics (early history of SQL)



* BiteSize Inc.'s Learn SQL tutorial
* A Gentle Introduction to SQL at SQLzoo
* SQL Tutorial
* SQL Help and Tutorial
Why thank you, very helpful.
Nice link share. Going to check it. . . Very Happy
Related topics
form mail for php
PHP Tutorials
[PhP] News Posting Tutorial (code, actually ^^')
SQL in java
Tuto de crear modulo
A very good PHP MySQL Tutorial
Noob attempting to learn MYSQL
AJAX tutorial [2nd part now updated]
PhpNuke Installation Tutorial
Edit Profile script
QTP Guru
[TUTORIAL] Criar Server de Mu (Parte 1) SQL E INSTRUÇÕES
whats the best websites for learning mysql?
Reply to topic    Frihost Forum Index -> Miscellaneous -> Tutorials

© 2005-2011 Frihost, forums powered by phpBB.