CreateTable demo

← List all

← Parse another

Parsing "CREATE TABLE `item` (\n `it..."

Input

Original

CREATE TABLE `item` (
  `item_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `item_fp_type` enum('classic','romantic','high fashion') DEFAULT NULL,
  `item_category_id` tinyint(3) unsigned NOT NULL,
  `item_rareness_id` tinyint(3) unsigned NOT NULL,
  `item_name` varchar(32) NOT NULL,
  `item_asset_id` smallint(5) unsigned NOT NULL,
  `item_data` text NOT NULL,
  PRIMARY KEY (`item_id`)
) ENGINE=InnoDB AUTO_INCREMENT=892 DEFAULT CHARSET=utf8

Results

  1. Table structure
  2. Cross-platform SQL
  3. Errata

CreateTable is still young—please comment on any errors or surprises in the Errata section! Thank you.

Table structure

Number of columns: 7

name data_type allow_null default primary_key unique autoincrement charset collate
item_id SMALLINT(5) UNSIGNED false true true true
item_fp_type ENUM('CLASSIC','ROMANTIC','HIGH FASHION') true NULL false false false
item_category_id TINYINT(3) UNSIGNED false false false false
item_rareness_id TINYINT(3) UNSIGNED false false false false
item_name CHARACTER VARYING(32) false false false false
item_asset_id SMALLINT(5) UNSIGNED false false false false
item_data TEXT false false false false

Cross-platform SQL

MySQL
CREATE TABLE item ( item_id SMALLINT(5) UNSIGNED PRIMARY KEY AUTO_INCREMENT, item_fp_type ENUM('CLASSIC','ROMANTIC','HIGH FASHION'), item_category_id TINYINT(3) UNSIGNED, item_rareness_id TINYINT(3) UNSIGNED, item_name CHARACTER VARYING(32), item_asset_id SMALLINT(5) UNSIGNED, item_data TEXT )
PostgreSQL
CREATE TABLE item ( item_id SMALLINT(5) UNSIGNED PRIMARY KEY, item_fp_type ENUM('CLASSIC','ROMANTIC','HIGH FASHION'), item_category_id TINYINT(3) UNSIGNED, item_rareness_id TINYINT(3) UNSIGNED, item_name CHARACTER VARYING(32), item_asset_id SMALLINT(5) UNSIGNED, item_data TEXT )
Sqlite3
CREATE TABLE item ( item_id SMALLINT(5) UNSIGNED PRIMARY KEY AUTOINCREMENT, item_fp_type ENUM('CLASSIC','ROMANTIC','HIGH FASHION'), item_category_id TINYINT(3) UNSIGNED, item_rareness_id TINYINT(3) UNSIGNED, item_name CHARACTER VARYING(32), item_asset_id SMALLINT(5) UNSIGNED, item_data TEXT )

Errata

comments powered by Disqus

© 2017 Brighter Planet, Inc.