Friday 24 May 2013

SQL

SQL

Wow my first taste of SQL and it is so much fun.

First download WampServer at http://sourceforge.net/projects/wampserver/?source=dlp

Here is my first go 

First I create the database -
create database MyFirstDatabase;

Now that it is created I can use it -
use MyFirstDatabase;

Now I create a table in the database, and define the data format for each of  the table fields -
create table MyFirstTable (TableID int auto_increment primary key, TableValue varchar (200) not null);

Now I can see my table and the format of the table -
show columns from MyFirstTable;

Now I can insert data into the first row -
insert into MyFirstTable (TableValue) values ('Hello World');

And now I can check the data in my table -
select * from MyFirstTable;

Some great online resources for SQL, (and most other languages), are

StackOverflow   http://stackoverflow.com

W3Schools   http://www.w3schools.com

No comments:

Post a Comment