"PHP additions and Deletions Example" section III-MySQL build table

Source: Internet
Author: User

This section to add some test data to the database.
Log in to MySQL:
Locate the%xampp%\mysql\bin directory,
Open a command window here to log in to MySQL with the root user

User table-built table sql:

CREATE TABLE tm_users (
idInt (one) not NULL auto_increment,
usernamevarchar (255) CHARACTER SET UTF8 DEFAULT NULL,
passwordvarchar (255) DEFAULT NULL,
nicknamevarchar (255) CHARACTER SET UTF8 DEFAULT NULL,
createtimeDateTime DEFAULT NULL,
updatetimeDateTime DEFAULT NULL,
isdeletevarchar (255) DEFAULT NULL,
PRIMARY KEY ( id )
) Engine=innodb auto_increment=14 DEFAULT Charset=utf8;

Copy it in, enter.


This means that the building is ready.

The Department table is the same.

The Department table builds the table sql:

CREATE TABLE tm_dept (
idInt (one) not NULL auto_increment COMMENT ' primary key ',
deptidvarchar (one) DEFAULT NULL COMMENT ' Department number (format bm_001) ',
deptnamevarchar (255) DEFAULT NULL COMMENT ' Department name ',
createtimeDateTime DEFAULT NULL COMMENT ' creation time ',
updatetimeDateTime DEFAULT NULL COMMENT ' Last update Time ',
PRIMARY KEY ( id )
) Engine=innodb auto_increment=6 DEFAULT Charset=utf8;

Test data:
INSERT into tm_dept VALUES (' 6 ', ' bm_001 ', ' Ministry of Science ', ' 2018-04-17 13:50:21 ', ' 2018-04-17 13:50:21 ') ;
INSERT into tm_dept VALUES (' 7 ', ' bm_002 ', ' Finance department ', ' 2018-04-17 13:50:59 ', ' 2018-04-17 13:50:59 ');
INSERT into tm_dept VALUES (' 8 ', ' bm_003 ', ' Cooking department ', ' 2018-04-17 13:51:05 ', ' 2018-04-17 13:51:05 ');
INSERT into tm_dept VALUES (' 9 ', ' bm_004 ', ' Test Department ', ' 2018-04-17 13:51:09 ', ' 2018-04-17 13:51:09 ');
INSERT into tm_dept VALUES (' Ten ', ' bm_005 ', ' development department ', ' 2018-04-17 13:51:14 ', ' 2018-04-17 13:51:14 ');
INSERT into tm_dept VALUES (' One ', ' bm_006 ', ' production department ', ' 2018-04-17 13:51:19 ', ' 2018-04-17 13:51:19 ');

INSERT into tm_users VALUES (' + ', ' zhangsan ', ' 123 ', ' Zhang San ', ' 2018-04-17 13:48:31 ', ' 2018-04-17 13:48:31 ', ' 0 ');
INSERT into tm_users VALUES (' Lisi ', ' 123 ', ' John Doe ', ' 2018-04-17 13:48:52 ', ' 2018-04-17 13:48:52 ', ' 0 ');
INSERT into tm_users VALUES (' + ', ' Wangwu ', ' 123 ', ' Harry ', ' 2018-04-17 13:49:01 ', ' 2018-04-17 13:49:01 ', ' 0 ');

Anyway, just copy it in.

"PHP additions and Deletions Example" section III-MySQL build table

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.