The main goal of this book is to learn by example and we are achieving this by developing an online news/magazine website. We will assume the following tables as mandatory:
User
UserGroup
UserProfile
Article
ArticleCategory
ArticleTranslation
ArticleCategoryArticle
Hashtag
ArticleHashtagArticle
These are basic tables, and we will add a few more in the later chapters. I like to use singular terms as part of the naming convention, but it's a matter of choice. To work faster, I recommend tools such as PhpMyAdmin or MySQL Workbench. Let's start with the first table.
The User
table will hold basic information about a user:
CREATE TABLE IF NOT EXISTS `user` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_first_name` varchar(16) COLLATE utf8_unicode_ci NOT NULL, `user_last_name` varchar(16) COLLATE utf8_unicode_ci NOT NULL, `user_email` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `user_password` varchar(128) COLLATE utf8_unicode_ci NOT NULL, `user_group_id...