The 3T database
The following SQL statements define the MySQL tables used in 3T. It is possible to use any database, and MySQL-specific code is highlighted to identify differences with ANSI SQL.
The company table
A company has projects for which we need to keep track of the time spent on different tasks. The company is, hence, the first table that needs to be defined. It is a very simple structure:
create table ttt_company( id_company int unsigned not null auto_increment, company_name varchar(200) not null, primary key(id_company) );
The auto_increment
keyword is used by MySQL to identify a number column that should automatically be incremental (the default rate of increment is by one number) based on the current highest value in the column. This is used to generate the id_company
primary key values. Let's add some company data:
insert into ttt_company(company_name) values ('PACKT Publishing'); insert into ttt_company(company_name) values ('Gieman It Solutions&apos...