CREATE TABLE student ( id int(2) NOT NULL auto_increment, name varchar(50) NOT NULL default '',
class varchar(10) NOT NULL default '', mark int(3) NOT NULL default '0',
UNIQUE KEY id (id) ) TYPE=MyISAM;
This will create the table for us. We can see that there are three fields in the
table. One is id which is an auto increment and will take one unique number each
time one record is added to the table. Next field is name of 50 length, this
will store the student name. Next is class field of 10 length.
INSERT INTO student VALUES (1, 'John Deo', 'Four', 75);
INSERT INTO student VALUES (2, 'Max Ruin', 'Three', 85);
INSERT INTO student VALUES (3, 'Arnold', 'Three', 55);
INSERT INTO student VALUES (4, 'Krish Star', 'Four', 60);
INSERT INTO student VALUES (5, 'John Mike', 'Four', 60);
INSERT INTO student VALUES (6, 'Alex John', 'Five', 55);
This SQL code will insert six records to the student table. Now our table with data is ready. We will start learning
one SQL command now .
alvin | 15-01-2010 |
nice tutorials |
Randy Orton | 05-07-2010 |
What is diferrence among SQL,MySQL and Oracle. I wanna Know that..! |
Neha | 23-08-2010 |
these are different database servers made by different companies. |
Wathum Nestore | 27-08-2010 |
I like what this site gives to the public! |
Marc | 30-05-2012 |
Need a step by step guide to the selection query and the rest of the most common queries and how to build put them all together |
sunil | 10-11-2012 |
i have just one word for this tutorial "awesome". |