About sql create table generator
Describe your columns in plain words and get a CREATE TABLE statement.
Design basics
- Give every table a primary key.
- Choose the smallest suitable type for each column.
- Add NOT NULL and UNIQUE where the data requires it.
- Add indexes for columns you search or join on.
Back up before you run SQL
Review generated statements, run them on a test database first and keep a backup. UPDATE and DELETE without a WHERE clause affect every row. Values pasted into SQL by hand can also open the door to SQL injection, so use parameterised queries in application code.
A worked example
Describing 'id integer primary key, name text not null, email text unique, created timestamp' gives a CREATE TABLE statement with the right keywords for your database. Add indexes for columns you search often, and foreign keys that link to other tables.
