Database

Create tables

In the tutorials on this site, we sometimes refer to a database (examples) and tables in this database (my_first_table and my_second_table). Please find these tables below.

For now we ill assume you have a database management system such as phpmyadmin installed, or know how to operate your database system. Below are the codes for automated creation of the tables. So go ahead, create a new database called examples, and use the specifications below to create tables my_first_table and my_second_table.

Table structure for table `my_first_table`

CREATE TABLE `my_first_table` (
`M_id` smallint(6) NOT NULL auto_increment,
`M_name` tinytext NOT NULL,
`M_url` tinytext NOT NULL,
`M_description` mediumtext NOT NULL,
PRIMARY KEY (`M_id`)
) ENGINE=MyISAM DEFAULT CHARSET=ascii COMMENT=’An example database’ AUTO_INCREMENT=1 ;

Table structure for table `my_second_table`

CREATE TABLE `my_second_table` (
`Ms_id` smallint(6) NOT NULL default ’0′,
`Ms_description` mediumtext character set ascii NOT NULL,
`Ms_L_nr` tinyint(4) NOT NULL default ’0′
) ENGINE=MyISAM DEFAULT CHARSET=ascii8;

Leave a Reply