Create database schema document: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
No edit summary |
||
| Line 3: | Line 3: | ||
== Table document == | == Table document == | ||
Sample result of mysql query: {{kbd | key =<nowiki>EXPLAIN <table></nowiki>}} | Sample result of mysql query<ref>[https://dev.mysql.com/doc/refman/8.0/en/show-columns.html MySQL :: MySQL 8.0 Reference Manual :: 13.7.6.5 SHOW COLUMNS Syntax]</ref>: {{kbd | key =<nowiki>EXPLAIN <table></nowiki>}} | ||
<pre> | <pre> | ||
Field | Type | Null | Key | Default | Extra | Field | Type | Null | Key | Default | Extra | ||
| Line 31: | Line 31: | ||
Tools: SQL syntax beautifier | Tools: SQL syntax beautifier | ||
* [http://www.dpriver.com/pp/sqlformat.htm Instant SQL Formatter] | * [http://www.dpriver.com/pp/sqlformat.htm Instant SQL Formatter] | ||
== References == | |||
<references /> | |||
Related pages: | Related pages: | ||
Revision as of 16:07, 30 October 2018
Create database schema document from existing MySQL database.
Table document
Sample result of mysql query[1]: EXPLAIN <table>
Field | Type | Null | Key | Default | Extra
sample result of mysql query: SHOW FULL COLUMNS FROM <table>
Field | Type | Collation | Null | Key | Default | Extra | Privileges | Comment
Steps of create database schema document for MySQL
- Using phpMyAdmin
- SQL query: EXPLAIN <table> or SHOW FULL COLUMNS FROM <table>
- Click "Print view (with full texts)"
- Copy the table to other word processors
DDL document
Data definition language (DDL): Sample result of mysql query: SHOW CREATE TABLE <table>
CREATE TABLE `table` ( `id` varchar(30) NOT NULL, `note` varchar(30) DEFAULT NULL, `status` int(1) NOT NULL DEFAULT '1', `update_time` datetime DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8
Tools: SQL syntax beautifier
References
Related pages: