Skip to content

Instantly share code, notes, and snippets.

@alexleventer
Created December 29, 2015 01:32
Show Gist options
  • Save alexleventer/b1a89a122fe2108185dc to your computer and use it in GitHub Desktop.
Save alexleventer/b1a89a122fe2108185dc to your computer and use it in GitHub Desktop.
CREATE TABLE companies
(
_id INT UNSIGNED NOT NULL AUTO_INCREMENT,
company VARCHAR(100) NOT NULL,
domain VARCHAR(100) NOT NULL,
city VARCHAR(100),
state VARCHAR(100),
country VARCHAR(100),
industry VARCHAR(100),
PRIMARY KEY(_id),
UNIQUE KEY domain_email_key (company, domain),
INDEX domain_ind (domain),
INDEX city_ind (city),
INDEX state_ind (state),
INDEX country (country),
INDEX industry (industry),
FOREIGN KEY (domain)
REFERENCES domainEmails(domain)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment