CreateTable demo

← List all

← Parse another

Parsing "CREATE TABLE pets (\r\n name..."

Input

Original

CREATE TABLE pets (
  name varchar(255) primary key,
  color varchar(255) unique,
  license int,
  weight float
)

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: 4

name data_type allow_null default primary_key unique autoincrement charset collate
name CHARACTER VARYING(255) false true true false
color CHARACTER VARYING(255) true false true false
license INTEGER true false false false
weight FLOAT true false false false

Cross-platform SQL

MySQL
CREATE TABLE pets ( `name` CHARACTER VARYING(255) PRIMARY KEY, color CHARACTER VARYING(255) UNIQUE, license INTEGER, weight FLOAT )
PostgreSQL
CREATE TABLE pets ( "name" CHARACTER VARYING(255) PRIMARY KEY, color CHARACTER VARYING(255) UNIQUE, license INTEGER, weight FLOAT )
Sqlite3
CREATE TABLE pets ( "name" CHARACTER VARYING(255) PRIMARY KEY, color CHARACTER VARYING(255) UNIQUE, license INTEGER, weight FLOAT )

Errata

comments powered by Disqus

© 2017 Brighter Planet, Inc.