Skip to content

Instantly share code, notes, and snippets.

@xlbruce
Created September 15, 2015 20:13
Show Gist options
  • Save xlbruce/d0b0d6535f929fed96a1 to your computer and use it in GitHub Desktop.
Save xlbruce/d0b0d6535f929fed96a1 to your computer and use it in GitHub Desktop.
Derby utils
--Criação de uma chave primária
CREATE TABLE <nome_tabela> (
id INT NOT NULL PRIMARY KEY GENERATED ALWAYS as IDENTITY(START WITH 1, INCREMENT by 1)
);
--Criação de chave estrangeira
ALTER TABLE <nome_tabela> ADD FOREIGN KEY(<chave_estrangeira) REFERENCES <tabela_chave_estrangeira>(<chave_da_outra_tabela);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment