# Create the project table CREATE TABLE project_table ( project_id int NOT NULL AUTO_INCREMENT PRIMARY KEY, parent_id int NULL , target_version varchar (15) NULL , target_date datetime NULL , project_title varchar (30) NOT NULL , project_summary varchar (255) NULL , project_details text NULL , project_owner varchar (30) NOT NULL , project_status tinyint NOT NULL , project_priority tinyint NOT NULL , accesskey int NOT NULL , INDEX (project_id), INDEX (project_title), INDEX (project_owner), INDEX (project_status), INDEX (project_priority) ); # Create the item table CREATE TABLE item_table ( item_id int NOT NULL AUTO_INCREMENT PRIMARY KEY, project_table_id int NOT NULL , target_version varchar (15) NULL , target_date datetime NULL , item_title varchar (30) NOT NULL , item_summary varchar (255) NULL , item_priority tinyint NOT NULL , item_history text NULL , item_owner varchar (30) NOT NULL , accesskey int NOT NULL , INDEX (item_id), INDEX (project_table_id), INDEX (item_title), INDEX (item_owner), INDEX (item_priority) ); # Create the assignment table CREATE TABLE assignment_table ( assignment_id int NOT NULL AUTO_INCREMENT PRIMARY KEY, item_table_id int NOT NULL , assignment_status tinyint NOT NULL , assignment_doer varchar (30) NULL , assignment_approver varchar (30) NULL , assignment_qa varchar (30) NULL , assignment_summary varchar (255) NULL , accesskey int NOT NULL , INDEX (assignment_id), INDEX (item_table_id), INDEX (assignment_status) ); #show tables; +------------------+ | Tables in wt_bug | +------------------+ | assignment_table | | item_table | | project_table | +------------------+