Skip to content

Instantly share code, notes, and snippets.

@brewdium
brewdium / CreateTableInDerby
Created March 13, 2015 04:22
Table Creation in Derby including primary key, auto increment and current timespamp
CREATE TABLE Contacts
(
id INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 0, INCREMENT BY 1),
firstname VARCHAR(30),
lastname VARCHAR(30),
telephone VARCHAR(15),
email VARCHAR(30),
created TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT primary_key PRIMARY KEY (id)
) ;