Skip to content

Instantly share code, notes, and snippets.

@wmantly
Created July 6, 2015 20:46
Show Gist options
  • Select an option

  • Save wmantly/6c8332c7cb0ab9fe9399 to your computer and use it in GitHub Desktop.

Select an option

Save wmantly/6c8332c7cb0ab9fe9399 to your computer and use it in GitHub Desktop.
sqlite> .schema
CREATE TABLE `users` (
`id` INTEGER,
`name` VARCHAR,
`email` VARCHAR,
`city` VARCHAR,
`state` VARCHAR,
`last_visit` DATE,
`page_views` INTEGER,
PRIMARY KEY (`id`)
);
CREATE TABLE `search_terms` (
`id` INTEGER,
`word` VARCHAR,
PRIMARY KEY (`id`)
);
CREATE TABLE `user_searches` (
`id` INTEGER,
`user_id` INTEGER,
`term_id` INTEGER,
FOREIGN KEY (`user_id`) REFERENCES users(id),
FOREIGN KEY (`term_id`) REFERENCES search_terms(id),
PRIMARY KEY (`id`)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment