Search
Left Quote    Knowledge speaks, but wisdom listens.
- Jimi Hendrix    
Right Quote
 
[login] | [Register]
 

Introduction to SQL

by: Jester
Page: 1 of 3
(View All)

Introduction


More and more people are getting into web designing, yet many are put off by SQL for reasons which I don't understand. I assure you it is very easy, in this tutorial I'll try to introduce you to the extreme basics of the structured query language.


The Database

In an SQL database there can be many tables, these tables store the data that you want to get at, let's have a look at an example of a simple table. Table: People


ID NAME GENDER LOCATION AGE
1 Bob Male UK 31
2 Jill Female USA 24
3 Joe Male Germany 19
4 Jeff Male France 46
5 Sue Female UK 29

Above we have a representation of a table in an SQL database. You can see why they are named tables. They have rows and columns, each row is a separate line in the database, and each column represents a data group for the table. We can use SQL to retrieve selective data, update and change data, delete data... etc. from this table.


Selecting

Note that the above table is named people, let's have a look at a very simple SELECT statement:




That's it, read it. Select name from, we are telling SQL to select the name column from the people table, what would this select?
Bob, Jill, Joe, Jeff, Sue

Simple enough right? We can select more than one column:




This would select the name column and the gender column, what would this select?
Bob, male, Jill, female, Joe, male, Jeff, male, Sue, female

There is a short-hand way to select all of the columns:




The * means select all columns (id, name, gender, location and age).

1  |  2  |  3  |  
Next »


No Comments for this page.

You Must be logged in or a member to comment.


Tutorial Stats

Tutorial Stats

24,007 Views
0 Total Comments
2 Rating of 5 (1 Votes)

Options

Tutorial Options

· Login to Rate This Article
· Login to Post a Comment
· Read more by this author
Digg This Article! Del.icio.us: Bookmark This Article Reddit: Bookmark This Article BlinkList: Blink This Article! YahooMyWeb BlogMarks: Add This Mark! Furl: Save This Article Spurl: Mark This Article

Articles

Related    

Your Article Here



"AllSyntax.com" Copyright © 2002-2018; All rights lefted, all lefts righted.
Privacy Policy  |  Internet Rank