Skip to main content

Posts

Showing posts with the label how to creat a table in mysql

Creating Database Tables

After the database structure is designed and the database has been created, individual tables can be added. Using accurate assignment of data types and their associated options, tables can be added to the database.   The command syntax is shown below, including the various column and table options;   CREATE TABLE <table> ( <column name> <column type> [<column options>], [<column name> <column type>  [<column options>],…,] [<index list>] )[<table options> ];   Example:   mysql> CREATE TABLE CountryLanguage (          ->  CountryCode CHAR(3) NOT NULL,          ->  Language CHAR(30) NOT NULL,          ->  IsOfficial ENUM('True', 'False') NOT NULL DEFAULT 'False',          ->  Percentage FLOAT(3,1) NOT NULL,          ->  PRIMARY KEY(Country, Language)          ->  )ENGINE = MyISAM COMMENT='Lists Language Spoken';   A line-by-line description of the above  CREATE TABLE st