Skip to content

Instantly share code, notes, and snippets.

@vinbarnes
Last active August 29, 2015 14:19
Show Gist options
  • Select an option

  • Save vinbarnes/653e648c5215f18cf45f to your computer and use it in GitHub Desktop.

Select an option

Save vinbarnes/653e648c5215f18cf45f to your computer and use it in GitHub Desktop.
SQL Antipatterns
CREATE TABLE accounts (
account_id integer NOT NULL primary key,
account_name character varying(20),
first_name character varying(20),
last_name character varying(20),
email character varying(100),
portrait_image bytea,
hourly_rate numeric(9,2)
);
CREATE SEQUENCE accounts_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER SEQUENCE accounts_id_seq OWNED BY accounts.account_id;
CREATE TABLE bug_status (
status character varying(20) primary key
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment