Converting document-oriented JSON into relational SQL requires inspecting sample records, determining optimal column data types, and synthesizing DDL.
1. Supported SQL Dialects
- PostgreSQL: Uses
SERIAL PRIMARY KEY,VARCHAR,BOOLEAN,TIMESTAMP WITH TIME ZONE,JSONB. - MySQL: Uses
AUTO_INCREMENT,DATETIME,TEXT,JSON. - SQLite: Uses
INTEGER PRIMARY KEY AUTOINCREMENT,TEXT,REAL.
-- Generated PostgreSQL DDL
CREATE TABLE users (
id INT PRIMARY KEY,
name VARCHAR(255) NOT NULL,
email VARCHAR(255) NOT NULL,
is_active BOOLEAN DEFAULT TRUE,
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);
-- Generated INSERT DML
INSERT INTO users (id, name, email, is_active) VALUES
(1, 'Alice Smith', '[email protected]', true),
(2, 'Bob Jones', '[email protected]', false);
Try Our Free Client-Side Developer Tools
Zero latency, 100% data privacy, and Web Worker performance.
Launch Tool →