Thank you StarLion and megazoid. I forgot to mentioned that I want to learn the mysql joins, so I will not use Navicat anymore. But to do that I have to design the databases correct . Taking another example, and comparing with yours megazoid, I arrived to this database, lets say for jokes, with categories, subcategories, pages and users.
Please tell me if I designed in the right why to perform correct the mysql joins.
CREATE TABLE categories
(
category_id
SMALLINT NOT NULL AUTO_INCREMENT,
subcategory_id
SMALLINT NOT NULL,
category
VARCHAR(30) NOT NULL,
PRIMARY KEY (category_id
),
UNIQUE KEY category
(category
)
) ;
CREATE TABLE subcategories
(
subcategory_id
SMALLINT NOT NULL AUTO_INCREMENT,
subcategory
VARCHAR(30) NOT NULL,
PRIMARY KEY (subcategory_id
),
UNIQUE KEY subcategory
(subcategory
)
) ;
CREATE TABLE users
(
user_id
INT UNSIGNED NOT NULL AUTO_INCREMENT,
type
ENUM(‘member’,‘admin’, ‘superadmin’) NOT NULL,
username
VARCHAR(30) NOT NULL,
email
VARCHAR(80) NOT NULL,
pass
VARBINARY(32) NOT NULL,
first_name
VARCHAR(20) NOT NULL,
last_name
VARCHAR(40) NOT NULL,
date_expires
DATE NOT NULL,
date_created
TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
date_modified
TIMESTAMP NOT NULL DEFAULT ‘0000-00-00 00:00:00’,
PRIMARY KEY (user_id
),
UNIQUE KEY username
(username
),
UNIQUE KEY email
(email
)
) ;
CREATE TABLE pages
(
id
MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT,
category_id
SMALLINT UNSIGNED NOT NULL,
user_id
SMALLINT UNSIGNED NOT NULL,
title
VARCHAR(100) NOT NULL,
content_page
LONGTEXT NOT NULL,
date_created
TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (id
),
KEY category_id
(category_id
),
KEY creation_date
(date_created
)
);