Saturday, 12 March 2011

Create a Table

      

                                        1)First of all Open the MYSQL command Line.Then log your account.Next type this code for creating a  database.(attention ! you have to use this mark ( ) finally of every 
command.)
(you can use suitable name instead of the word "first")


CREATE DATABASE  first;




  2) selecting the  database is next step.()


USE first;


3)now we selected the database which we made first.then type this command for creating a database.



CREATE TABLE first (
          id INT,
          data VARCHAR(100)
        ) TYPE=innodb;


                               CREATE TABLE mean a SQL  keyword.first means just only a name.it means you can use your favorite name.INT means a data type.id means name of INT.and you can be use any thing for the VARCHAR. 





                       Now Table has been created.


4)If you want to see Table type this command


SHOW TABLES;




                                                     

No comments:

Post a Comment