September 2017
Intermediate to advanced
244 pages
6h 44m
English
The following is the SQL for users table. Note, we are using MySQL as RDBMS in our example. There can be a slight change in the queries for other databases:
CREATE TABLE `blog`.`users` ( `id` INT NOT NULL AUTO_INCREMENT , `name` VARCHAR(100) NOT NULL , `email` VARCHAR(50) NOT NULL , `password` VARCHAR(50) NOT NULL , PRIMARY KEY (`id`), UNIQUE `email_unique` (`email`))ENGINE = InnoDB;
This query will create a posts table as described above. The only thing that we haven't discussed is the database engine. The last line of this query ENGINE = InnoDB sets the database engine for this table as InnoDB. Also, on line 1, `blog` represents the name of the database. If you have named the database anything else other than blog, ...
Read now
Unlock full access